Improve message for errors when unifying rigid type variables
This commit is contained in:
parent
91007fc4f9
commit
6ff938c7cf
1 changed files with 9 additions and 3 deletions
|
@ -111,9 +111,15 @@ actuallyUnify span variable1 variable2 = do
|
||||||
_ -> comparableError Nothing
|
_ -> comparableError Nothing
|
||||||
|
|
||||||
rigidError variable = TS.addError span (Just hint) variable1 variable2
|
rigidError variable = TS.addError span (Just hint) variable1 variable2
|
||||||
where hint = "There is a problem with the '" ++
|
where
|
||||||
render (pretty Never variable) ++
|
var = "'" ++ render (pretty Never variable) ++ "'"
|
||||||
"' in the type signature. It currently is not possible to unify type variables that appear in top-level declarations and again in subexpressions"
|
hint = concat
|
||||||
|
[ "This probably relates to a type annotation. A type "
|
||||||
|
, "annotation may say ", var, " but should be a more "
|
||||||
|
, "specific type. Also, type variables are not "
|
||||||
|
, "shared between type annotations, so ", var, " in one "
|
||||||
|
, "is not the same as " ++ var ++ " in another. "
|
||||||
|
, "Something like that happened" ]
|
||||||
|
|
||||||
superUnify =
|
superUnify =
|
||||||
case (flex desc1, flex desc2, name desc1, name desc2) of
|
case (flex desc1, flex desc2, name desc1, name desc2) of
|
||||||
|
|
Loading…
Reference in a new issue