fix(typeclass/context): standardize eUnify fail message

This commit is contained in:
Daniel Selsam 2019-10-03 17:10:16 -07:00 committed by Leonardo de Moura
parent 7e63caa47e
commit 1a1daf8aba
2 changed files with 3 additions and 3 deletions

View file

@ -190,7 +190,7 @@ partial def slowWhnf : Expr → Expr
partial def eUnify : Expr → Expr → EState String Context Unit
| e₁, e₂ =>
if !e₁.hasMVar && !e₂.hasMVar
then unless (e₁ == e₂) $ throw "fail"
then unless (e₁ == e₂) $ throw $ "eUnify: " ++ toString e₁ ++ " !=?= " ++ toString e₂
else do
e₁ ← slowWhnf <$> (EState.fromState $ eShallowInstantiate e₁);
e₂ ← slowWhnf <$> (EState.fromState $ eShallowInstantiate e₂);

View file

@ -7,8 +7,8 @@
(ok foo)
(ok f a)
(error "eUnify: f !=?= g")
(error "eUnify: f !=?= g")
(error "eUnify: a !=?= b")
(error "eUnify: f a !=?= g a")
(error "eUnify: f a !=?= f b")
(error "eUnify: f a !=?= f")
(ok foo)
(ok f ?_tc_alpha.0 ?_tc_alpha.1)