Commit e913ed4d authored by chak@cse.unsw.edu.au.'s avatar chak@cse.unsw.edu.au.

Better error message for unsolvable equalities

parent 3ebcc2d0
......@@ -591,10 +591,11 @@ decompInst i@(EqInst {})
| con1 /= con2 && not (isOpenSynTyCon con1 || isOpenSynTyCon con2)
-- not matching data constructors (of any flavour) are bad news
= do { env0 <- tcInitTidyEnv
; let (env1, tidy_ty1) = tidyOpenType env0 ty1
(env2, tidy_ty2) = tidyOpenType env1 ty2
extra = sep [ppr tidy_ty1, char '~', ppr tidy_ty2]
msg = ptext SLIT("Couldn't match expected type against inferred type")
; let (env1, tidy_ty1) = tidyOpenType env0 ty1
(env2, tidy_ty2) = tidyOpenType env1 ty2
extra = sep [ppr tidy_ty1, char '~', ppr tidy_ty2]
msg =
ptext SLIT("Unsolvable equality constraint:")
; failWithTcM (env2, hang msg 2 extra)
}
where
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment