summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-11-05 09:56:52 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2011-11-05 09:56:52 -0400
commitfe997cad0b4ba41c1fcd2f6ba9bb2402afecf72e (patch)
treea5b880e2e6cd1d825386ca2ec8d486ac865713ea /src
parent938bcbbea4b80f042840b0723a021244e68715e6 (diff)
Fix confusing error message when record unification fails because enclosed types are incompatible
Diffstat (limited to 'src')
-rw-r--r--src/elaborate.sml10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/elaborate.sml b/src/elaborate.sml
index 15c253e7..a80f11d0 100644
--- a/src/elaborate.sml
+++ b/src/elaborate.sml
@@ -919,7 +919,9 @@
if consEq env loc (c1, c2) then
findPointwise fs1
else
- SOME (nm1, c1, c2, (unifyCons env loc c1 c2; NONE) handle CUnify (_, _, err) => SOME err)
+ SOME (nm1, c1, c2, (unifyCons env loc c1 c2; NONE)
+ handle CUnify (_, _, err) => (reducedSummaries := NONE;
+ SOME err))
in
raise CUnify' (CRecordFailure (unsummarize s1, unsummarize s2, findPointwise (#fields s1)))
end
@@ -939,7 +941,8 @@
val c = summaryToCon {fields = fs1, unifs = unifs1, others = others1}
in
if occursCon r c then
- raise CUnify' (COccursCheckFailed (cr, c))
+ (reducedSummaries := NONE;
+ raise CUnify' (COccursCheckFailed (cr, c)))
else
(r := SOME (squish nl c))
handle CantSquish => default ()
@@ -949,7 +952,8 @@
val c = summaryToCon {fields = fs2, unifs = unifs2, others = others2}
in
if occursCon r c then
- raise CUnify' (COccursCheckFailed (cr, c))
+ (reducedSummaries := NONE;
+ raise CUnify' (COccursCheckFailed (cr, c)))
else
(r := SOME (squish nl c))
handle CantSquish => default ()