[commit: ghc] wip/T12618: ConApp: Lint check to ensure arity matches (d5ea9b2)

git at git.haskell.org git at git.haskell.org
Sat Oct 1 21:52:50 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/T12618
Link       : http://ghc.haskell.org/trac/ghc/changeset/d5ea9b23640a988e369dff8189c2f4c170eed3bf/ghc

>---------------------------------------------------------------

commit d5ea9b23640a988e369dff8189c2f4c170eed3bf
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Thu Sep 29 17:41:20 2016 -0400

    ConApp: Lint check to ensure arity matches


>---------------------------------------------------------------

d5ea9b23640a988e369dff8189c2f4c170eed3bf
 compiler/coreSyn/CoreLint.hs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs
index 502030a..3b1fdf9 100644
--- a/compiler/coreSyn/CoreLint.hs
+++ b/compiler/coreSyn/CoreLint.hs
@@ -706,6 +706,8 @@ lintCoreExpr e@(ConApp dc args)
          when (lf_check_static_ptrs lf && dataConName dc == staticPtrDataConName) $
             failWithL $ text "Found StaticPtr nested in an expression: " <+>
                         ppr e
+         when (length args /= dataConRepFullArity dc) $
+            failWithL $ hang (text "Un-saturated data con application") 2 (ppr e)
          let dc_ty = dataConRepType dc
          addLoc (AnExpr e) $ foldM lintCoreArg dc_ty args
 



More information about the ghc-commits mailing list