diff src/elaborate.sml @ 1717:16ee7ff7f119

Avoid kindof failures in elaboration
author Adam Chlipala <adam@chlipala.net>
date Sat, 21 Apr 2012 13:57:10 -0400
parents 1584fd8d16dd
children 0bafdfae2ac7
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)