on master help sign in
Make presentation of type errors a bit nicer with comparison operators
commit3f45254238a2bd1eec5c1eed10fdd6606e7c64c9 authorEvan Czaplicki <evancz@users.noreply.github.com> dateTue 15 May 2018, 12:41 (8 years ago) parent442bba3
1 file changed+3−3
compiler/src/Reporting/Error/Type.hs+3−3
compiler/src/Reporting/Error/Type.hs+3−3
@@ -320,8 +320,8 @@ typeComparison localizer actual expected iAmSeeing insteadOf contextHints =
320320 , D.reflow insteadOf
321321 , D.indent 4 expectedDoc
322322 ]
323− ++ problemsToHint problems
324323 ++ contextHints
324+ ++ problemsToHint problems
325325
326326
327327loneType :: L.Localizer -> T.Type -> T.Type -> D.Doc -> [D.Doc] -> D.Doc
@@ -1541,7 +1541,7 @@ badCompRight localizer op tipe expected =
15411541 "I need both sides of (" <> op <> ") to be the same type:"
15421542 ,
15431543 typeComparison localizer expected tipe
1544− "The left side of is:"
1544+ ("The left side of (" <> op <> ") is:")
15451545 "But the right side is:"
15461546 [ D.reflow $
15471547 "I cannot compare different types though! Which side of (" <> op <> ") is the problem?"
@@ -1561,7 +1561,7 @@ badEquality localizer op tipe expected =
15611561 "I need both sides of (" <> op <> ") to be the same type:"
15621562 ,
15631563 typeComparison localizer expected tipe
1564− "The left side of is:"
1564+ ("The left side of (" <> op <> ") is:")
15651565 "But the right side is:"
15661566 [ if isFloat tipe || isFloat expected then
15671567 D.toSimpleNote $