diff options
author | Adam Chlipala <adam@chlipala.net> | 2011-11-05 09:56:52 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2011-11-05 09:56:52 -0400 |
commit | 120ec7b5ffbf8be08f8f9672d043ec86d9fc7cfe (patch) | |
tree | a5b880e2e6cd1d825386ca2ec8d486ac865713ea /src/elaborate.sml | |
parent | 9aa9c1fc665f38a1569ea6cdbf90ce4aee7c10af (diff) |
Fix confusing error message when record unification fails because enclosed types are incompatible
Diffstat (limited to 'src/elaborate.sml')
-rw-r--r-- | src/elaborate.sml | 10 |
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 () |