summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2012-04-21 13:57:10 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2012-04-21 13:57:10 -0400
commit48bcb8af10e648f4b31ddf4b46e7700eb53d229c (patch)
tree44cf7b1e34f56820aebd71db45bd5dd28c351aeb
parenta403a8d5343719e7bfc663cfb45ca09ade0ad77d (diff)
Avoid kindof failures in elaboration
-rw-r--r--src/elaborate.sml11
-rw-r--r--tests/unbound.ur3
2 files changed, 8 insertions, 6 deletions
diff --git a/src/elaborate.sml b/src/elaborate.sml
index 26825951..a11787a9 100644
--- a/src/elaborate.sml
+++ b/src/elaborate.sml
@@ -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)
diff --git a/tests/unbound.ur b/tests/unbound.ur
new file mode 100644
index 00000000..3f508e5f
--- /dev/null
+++ b/tests/unbound.ur
@@ -0,0 +1,3 @@
+structure M = struct end
+
+fun f (x : $M.r) : $([A = int] ++ M.r) = x