summaryrefslogtreecommitdiff
path: root/src/elaborate.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-10-29 17:30:34 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2011-10-29 17:30:34 -0400
commit7be772d91d592c9a1ec201fb4bc07e8dd1f5a9f5 (patch)
tree0304d9c5614cecb6cec0fe974de29dc18a71ad15 /src/elaborate.sml
parent28e1f4daf5dd22a771359449ba79d5e7901bc41e (diff)
Shorter, more focused error messages about undetermined unification variables
Diffstat (limited to 'src/elaborate.sml')
-rw-r--r--src/elaborate.sml39
1 files changed, 21 insertions, 18 deletions
diff --git a/src/elaborate.sml b/src/elaborate.sml
index 5b54db9a..9051299a 100644
--- a/src/elaborate.sml
+++ b/src/elaborate.sml
@@ -500,9 +500,9 @@
case c of
L'.CUnif (_, loc, k, _, r as ref NONE) =>
(case #1 (hnormKind k) of
- L'.KUnit => (r := SOME (L'.CUnit, loc); NONE)
- | _ => SOME loc)
- | _ => NONE
+ L'.KUnit => (r := SOME (L'.CUnit, loc); false)
+ | _ => true)
+ | _ => false
val kunifsInDecl = U.Decl.exists {kind = kunifsRemain,
con = fn _ => false,
@@ -512,13 +512,13 @@
str = fn _ => false,
decl = fn _ => false}
- val cunifsInDecl = U.Decl.search {kind = fn _ => NONE,
+ val cunifsInDecl = U.Decl.exists {kind = fn _ => false,
con = cunifsRemain,
- exp = fn _ => NONE,
- sgn_item = fn _ => NONE,
- sgn = fn _ => NONE,
- str = fn _ => NONE,
- decl = fn _ => NONE}
+ exp = fn _ => false,
+ sgn_item = fn _ => false,
+ sgn = fn _ => false,
+ str = fn _ => false,
+ decl = fn _ => false}
fun occursCon r =
U.Con.exists {kind = fn _ => false,
@@ -4473,19 +4473,22 @@ fun elabFile basis topStr topSgn env file =
if ErrorMsg.anyErrors () then
()
else
- ignore (List.exists (fn d => if kunifsInDecl d then
- (declError env'' (KunifsRemain [d]);
- true)
- else
- false) file);
+ if List.exists kunifsInDecl file then
+ case U.File.findDecl kunifsInDecl file of
+ NONE => ()
+ | SOME d => declError env'' (KunifsRemain [d])
+ else
+ ();
if ErrorMsg.anyErrors () then
()
else
- ignore (List.exists (fn d => case cunifsInDecl d of
- NONE => false
- | SOME _ => (declError env'' (CunifsRemain [d]);
- true)) file);
+ if List.exists cunifsInDecl file then
+ case U.File.findDecl cunifsInDecl file of
+ NONE => ()
+ | SOME d => declError env'' (CunifsRemain [d])
+ else
+ ();
if ErrorMsg.anyErrors () then
()