on master help sign in
Show nice name when there's a problem with tuple patterns
cef671fEvan Czaplicki
src/Reporting/Error/Type.hs+4−3
@@ -415,15 +415,16 @@ mismatchToReport localizer (MismatchInfo hint leftType rightType maybeReason) =
415 case patErr of
415 case patErr of
416 PVar name -> "variable `" ++ name ++ "`"
416 PVar name -> "variable `" ++ name ++ "`"
417 PAlias name -> "alias `" ++ name ++ "`"
417 PAlias name -> "alias `" ++ name ++ "`"
418+ PRecord -> "this record"
418− PData name -> "tag `" ++ name ++ "`"
419+ PData name ->
419− PRecord -> "a record"
420+ if Help.isTuple name then "this tuple" else "tag `" ++ name ++ "`"
420 in
421 in
421 report
422 report
422 Nothing
423 Nothing
423 ( Help.capitalize thing ++ " is causing problems in this pattern match."
424 ( Help.capitalize thing ++ " is causing problems in this pattern match."
424 )
425 )
425 ( cmpHint
426 ( cmpHint
426− "This pattern matches things of type:"
427+ "The pattern matches things of type:"
427 "But the values it will actually be trying to match are:"
428 "But the values it will actually be trying to match are:"
428 []
429 []
429 )
430 )