[commit: ghc] wip/T12618: Do not lint the bodz of the data con worker bindings introduced by CorePrep (7a62038)

git at git.haskell.org git at git.haskell.org
Mon Oct 10 21:43:12 UTC 2016


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

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

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

commit 7a6203882ee5af9db0cdc5463f23a60989ab7cee
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Fri Oct 7 21:59:46 2016 -0400

    Do not lint the bodz of the data con worker bindings introduced by CorePrep


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

7a6203882ee5af9db0cdc5463f23a60989ab7cee
 compiler/coreSyn/CoreLint.hs | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs
index 127ae0f..bccbd9f 100644
--- a/compiler/coreSyn/CoreLint.hs
+++ b/compiler/coreSyn/CoreLint.hs
@@ -471,6 +471,13 @@ lintSingleBinding :: TopLevelFlag -> RecFlag -> (Id, CoreExpr) -> LintM ()
 -- If you edit this function, you may need to update the GHC formalism
 -- See Note [GHC Formalism]
 lintSingleBinding top_lvl_flag rec_flag (binder,rhs)
+  -- CorePrep introduces bindings for data constructors. This is just a hack for the
+  -- code generator, the definitions do not matter (and would fail some of the
+  -- checks below). Therefore, skip these.
+  -- See Note [Data constructor workers] in CorePrep
+  | isDataConWorkId binder
+  = return ()
+  | otherwise
   = addLoc (RhsOf binder) $
          -- Check the rhs
     do { ty <- lintRhs rhs



More information about the ghc-commits mailing list