@@ -47,7 +47,7 @@ toReport _localizer err =
4747 "MISSING PATTERNS"
4848 Nothing
4949 "This `case` does not have branches for all possibilities."
50− (text (unhandledError unhandled newTagsMessage))
50+ (text (unhandledError unhandled (missingBranchesMessage (length unhandled))))
5151
5252 Redundant ->
5353 Report.report
@@ -74,7 +74,7 @@ unhandledError unhandledPatterns relevantMessage =
7474 ++ "\n"
7575 ++ "If you are seeing this error for the first time, check out these hints:\n"
7676 ++ 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!"
7878
7979
8080toCaseMessage :: String
@@ -82,7 +82,11 @@ toCaseMessage =
8282 "Switch to a `case` expression to handle all possible patterns."
8383
8484
85−newTagsMessage :: String
86−newTagsMessage =
87− "Did you add a new tag to a union type? Add a branch for it here!"
85+missingBranchesMessage :: Int -> String
86+missingBranchesMessage numUnhandled =
87+ if numUnhandled == 1 then
88+ "Add a branch to cover this pattern!"
89+
90+ else
91+ "Add branches to cover each of these patterns!"
8892