on master help sign in
Show nice name when there's a problem with tuple patterns

Fix https://github.com/elm-lang/error-message-catalog/issues/160

commitcef671fde9c4b26f27b544c13af4a22ff5ec8b68 authorEvan Czaplicki <evancz@users.noreply.github.com> dateWed 26 Oct 2016, 16:56 (10 years ago) parent1ed20ac
1 file changed+4−3
src/Reporting/Error/Type.hs+4−3
src/Reporting/Error/Type.hs+4−3
@@ -415,15 +415,16 @@ mismatchToReport localizer (MismatchInfo hint leftType rightType maybeReason) =
415415 case patErr of
416416 PVar name -> "variable `" ++ name ++ "`"
417417 PAlias name -> "alias `" ++ name ++ "`"
418− PData name -> "tag `" ++ name ++ "`"
419− PRecord -> "a record"
418+ PRecord -> "this record"
419+ PData name ->
420+ if Help.isTuple name then "this tuple" else "tag `" ++ name ++ "`"
420421 in
421422 report
422423 Nothing
423424 ( Help.capitalize thing ++ " is causing problems in this pattern match."
424425 )
425426 ( cmpHint
426− "This pattern matches things of type:"
427+ "The pattern matches things of type:"
427428 "But the values it will actually be trying to match are:"
428429 []
429430 )