[commit: ghc] wip/T12618: Use ConApp in tagToEnumRule (8399e73)
git at git.haskell.org
git at git.haskell.org
Thu Oct 6 23:20:18 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/T12618
Link : http://ghc.haskell.org/trac/ghc/changeset/8399e73a44287d5aa6ce6c61620c628f85033392/ghc
>---------------------------------------------------------------
commit 8399e73a44287d5aa6ce6c61620c628f85033392
Author: Joachim Breitner <mail at joachim-breitner.de>
Date: Tue Oct 4 14:35:23 2016 -0400
Use ConApp in tagToEnumRule
>---------------------------------------------------------------
8399e73a44287d5aa6ce6c61620c628f85033392
compiler/prelude/PrelRules.hs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/compiler/prelude/PrelRules.hs b/compiler/prelude/PrelRules.hs
index 8868047..197ddb3 100644
--- a/compiler/prelude/PrelRules.hs
+++ b/compiler/prelude/PrelRules.hs
@@ -31,7 +31,7 @@ import PrimOp ( PrimOp(..), tagToEnumKey )
import TysWiredIn
import TysPrim
import TyCon ( tyConDataCons_maybe, isEnumerationTyCon, isNewTyCon, unwrapNewTyCon_maybe )
-import DataCon ( dataConTag, dataConTyCon, dataConWorkId )
+import DataCon ( dataConTag, dataConTyCon )
import CoreUtils ( cheapEqExpr, exprIsHNF )
import CoreUnfold ( exprIsConApp_maybe )
import Type
@@ -893,7 +893,7 @@ tagToEnumRule = do
correct_tag dc = (dataConTag dc - fIRST_TAG) == tag
(dc:rest) <- return $ filter correct_tag (tyConDataCons_maybe tycon `orElse` [])
ASSERT(null rest) return ()
- return $ mkTyApps (Var (dataConWorkId dc)) tc_args
+ return $ ConApp dc (map Type tc_args)
-- See Note [tagToEnum#]
_ -> WARN( True, text "tagToEnum# on non-enumeration type" <+> ppr ty )
More information about the ghc-commits
mailing list