StgLint: Show constructor arity in mismatch message
authorBen Gamari <bgamari.foss@gmail.com>
Mon, 4 Sep 2017 12:14:11 +0000 (08:14 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 5 Sep 2017 11:20:01 +0000 (07:20 -0400)
Reviewers: austin

Subscribers: rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D3921

compiler/stgSyn/StgLint.hs

index 5140a47..90628f0 100644 (file)
@@ -490,7 +490,7 @@ mkAlgAltMsg3 :: DataCon -> [Id] -> MsgDoc
 mkAlgAltMsg3 con alts
   = vcat [
         text "In some algebraic case alternative, number of arguments doesn't match constructor:",
-        ppr con,
+        ppr con <+> parens (text "arity" <+> ppr (dataConRepArity con)),
         ppr alts
     ]