@@ -47,7 +47,7 @@ toReport _localizer err =
47 "MISSING PATTERNS"
47 "MISSING PATTERNS"
49 "This `case` does not have branches for all possibilities."
49 "This `case` does not have branches for all possibilities."
50− (text (unhandledError unhandled newTagsMessage))
50+ (text (unhandledError unhandled (missingBranchesMessage (length unhandled))))
52 Redundant ->
52 Redundant ->
53 Report.report
53 Report.report
@@ -74,7 +74,7 @@ unhandledError unhandledPatterns relevantMessage =
75 ++ "If you are seeing this error for the first time, check out these hints:\n"
75 ++ "If you are seeing this error for the first time, check out these hints:\n"
76 ++ Help.hintLink "missing-patterns" ++ "\n"
76 ++ Help.hintLink "missing-patterns" ++ "\n"
77− ++ "The recommendations about `Debug.crash` and wildcard patterns are important!"
77+ ++ "The recommendations about wildcard patterns and `Debug.crash` are important!"
80toCaseMessage :: String
80toCaseMessage :: String
@@ -82,7 +82,11 @@ toCaseMessage =
82 "Switch to a `case` expression to handle all possible patterns."
82 "Switch to a `case` expression to handle all possible patterns."
85−newTagsMessage :: String
85+missingBranchesMessage :: Int -> String
86−newTagsMessage =
86+missingBranchesMessage numUnhandled =
87− "Did you add a new tag to a union type? Add a branch for it here!"
87+ if numUnhandled == 1 then
88+ "Add a branch to cover this pattern!"
91+ "Add branches to cover each of these patterns!"