on master help sign in
Make presentation of type errors a bit nicer with comparison operators
3f45254Evan Czaplicki
compiler/src/Reporting/Error/Type.hs+3−3
@@ -320,8 +320,8 @@ typeComparison localizer actual expected iAmSeeing insteadOf contextHints =
320 , D.reflow insteadOf
320 , D.reflow insteadOf
321 , D.indent 4 expectedDoc
321 , D.indent 4 expectedDoc
322 ]
322 ]
323− ++ problemsToHint problems
324 ++ contextHints
323 ++ contextHints
324+ ++ problemsToHint problems
325
325
326
326
327loneType :: L.Localizer -> T.Type -> T.Type -> D.Doc -> [D.Doc] -> D.Doc
327loneType :: L.Localizer -> T.Type -> T.Type -> D.Doc -> [D.Doc] -> D.Doc
@@ -1541,7 +1541,7 @@ badCompRight localizer op tipe expected =
1541 "I need both sides of (" <> op <> ") to be the same type:"
1541 "I need both sides of (" <> op <> ") to be the same type:"
1542 ,
1542 ,
1543 typeComparison localizer expected tipe
1543 typeComparison localizer expected tipe
1544− "The left side of is:"
1544+ ("The left side of (" <> op <> ") is:")
1545 "But the right side is:"
1545 "But the right side is:"
1546 [ D.reflow $
1546 [ D.reflow $
1547 "I cannot compare different types though! Which side of (" <> op <> ") is the problem?"
1547 "I cannot compare different types though! Which side of (" <> op <> ") is the problem?"
@@ -1561,7 +1561,7 @@ badEquality localizer op tipe expected =
1561 "I need both sides of (" <> op <> ") to be the same type:"
1561 "I need both sides of (" <> op <> ") to be the same type:"
1562 ,
1562 ,
1563 typeComparison localizer expected tipe
1563 typeComparison localizer expected tipe
1564− "The left side of is:"
1564+ ("The left side of (" <> op <> ") is:")
1565 "But the right side is:"
1565 "But the right side is:"
1566 [ if isFloat tipe || isFloat expected then
1566 [ if isFloat tipe || isFloat expected then
1567 D.toSimpleNote $
1567 D.toSimpleNote $