on master help sign in
switch to the "custom-types" hint in a couple error messages
b585ba7Evan Czaplicki
compiler/src/Reporting/Error/Type.hs+12−12
@@ -253,11 +253,11 @@ toPatternReport source localizer patternRegion category tipe expected =
253 , patternTypeComparison localizer tipe expectedType
253 , patternTypeComparison localizer tipe expectedType
254 (addPatternCategory ("The " <> D.ordinal index <> " pattern is trying to match") category)
254 (addPatternCategory ("The " <> D.ordinal index <> " pattern is trying to match") category)
255 "But all the previous patterns in the list are:"
255 "But all the previous patterns in the list are:"
256− [ D.toSimpleHint $
256+ [ D.link "Hint"
257− "Everything in the list needs to be the same type of value.\
257+ "Everything in a list must be the same type of value. This way, we never\
258− \ This way you never run into unexpected values partway through.\
258+ \ run into unexpected values partway through a List.map, List.foldl, etc. Read"
259− \ To mix different types in a single list, create a \"union type\" as\
259+ "custom-types"
260− \ described in: <http://guide.elm-lang.org/types/union_types.html>"
260+ "to learn how to “mix” types."
261 ]
261 ]
262 )
262 )
263
263
@@ -694,11 +694,11 @@ toExprReport source localizer exprRegion category tipe expected =
694 , "The " <> ith <> " element of this list does not match all the previous elements:"
694 , "The " <> ith <> " element of this list does not match all the previous elements:"
695 , "The " <> ith <> " element is"
695 , "The " <> ith <> " element is"
696 , "But all the previous elements in the list are:"
696 , "But all the previous elements in the list are:"
697− , [ D.toSimpleHint $
697+ , [ D.link "Hint"
698− "Everything in the list needs to be the same type of value.\
698+ "Everything in a list must be the same type of value. This way, we never\
699− \ This way you never run into unexpected values partway through.\
699+ \ run into unexpected values partway through a List.map, List.foldl, etc. Read"
700− \ To mix different types in a single list, create a \"union type\" as\
700+ "custom-types"
701− \ described in: <http://guide.elm-lang.org/types/union_types.html>"
701+ "to learn how to “mix” types."
702 ]
702 ]
703 )
703 )
704
704
@@ -745,7 +745,7 @@ toExprReport source localizer exprRegion category tipe expected =
745 , [ D.link "Hint"
745 , [ D.link "Hint"
746 "All branches in an `if` must produce the same type of values. This way, no\
746 "All branches in an `if` must produce the same type of values. This way, no\
747 \ matter which branch we take, the result is always a consistent shape. Read"
747 \ matter which branch we take, the result is always a consistent shape. Read"
748− "union-types"
748+ "custom-types"
749 "to learn how to “mix” types."
749 "to learn how to “mix” types."
750 ]
750 ]
751 )
751 )
@@ -760,7 +760,7 @@ toExprReport source localizer exprRegion category tipe expected =
760 , [ D.link "Hint"
760 , [ D.link "Hint"
761 "All branches in a `case` must produce the same type of values. This way, no\
761 "All branches in a `case` must produce the same type of values. This way, no\
762 \ matter which branch we take, the result is always a consistent shape. Read"
762 \ matter which branch we take, the result is always a consistent shape. Read"
763− "union-types"
763+ "custom-types"
764 "to learn how to “mix” types."
764 "to learn how to “mix” types."
765 ]
765 ]
766 )
766 )