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

git at git.haskell.org git at git.haskell.org
Sat Oct 1 21:00:44 UTC 2016


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

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

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

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

    ConApp: Lint check to ensure arity matches


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

a736cb9eb9124bc102b5653003a067bdf440e92e
 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