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

git at git.haskell.org git at git.haskell.org
Sun Oct 2 03:04:25 UTC 2016


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

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

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

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

    ConApp: Lint check to ensure arity matches


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

2e2727431d634e3a974a9c2d7e48362a5ad19a7d
 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