changeset 1717:16ee7ff7f119

Avoid kindof failures in elaboration
author Adam Chlipala <adam@chlipala.net>
date Sat, 21 Apr 2012 13:57:10 -0400
parents 05ae68e019b6
children dd12d6d9e9a7
files src/elaborate.sml tests/unbound.ur
diffstat 2 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/elaborate.sml	Mon Apr 16 10:12:04 2012 -0400
+++ b/src/elaborate.sml	Sat Apr 21 13:57:10 2012 -0400
@@ -1,4 +1,4 @@
-(* Copyright (c) 2008-2011, Adam Chlipala
+(* Copyright (c) 2008-2012, Adam Chlipala
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -393,11 +393,10 @@
                                         | SOME sgn => ((L'.StrProj (str, m), loc), sgn))
                                    ((L'.StrVar n, loc), sgn) ms
 
-                  val k = case E.projectCon env {sgn = sgn, str = str, field = s} of
-                              NONE => (conError env (UnboundCon (loc, s));
-                                       kerror)
-                            | SOME (k, _) => k
-                 val (c, k) = elabConHead env (L'.CModProj (n, ms, s), loc) k
+                  val (c, k) = case E.projectCon env {sgn = sgn, str = str, field = s} of
+                                   NONE => (conError env (UnboundCon (loc, s));
+                                            (cerror, kerror))
+                                 | SOME (k, _) => elabConHead env (L'.CModProj (n, ms, s), loc) k
               in
                   (c, k, [])
               end)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/unbound.ur	Sat Apr 21 13:57:10 2012 -0400
@@ -0,0 +1,3 @@
+structure M = struct end
+
+fun f (x : $M.r) : $([A = int] ++ M.r) = x