summaryrefslogtreecommitdiff
path: root/compiler/coreSyn/CoreOpt.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/coreSyn/CoreOpt.hs')
-rw-r--r--compiler/coreSyn/CoreOpt.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/coreSyn/CoreOpt.hs b/compiler/coreSyn/CoreOpt.hs
index f1ff68d133..552cc3b191 100644
--- a/compiler/coreSyn/CoreOpt.hs
+++ b/compiler/coreSyn/CoreOpt.hs
@@ -963,6 +963,9 @@ pushCoTyArg co ty
-- -- | tyL `eqType` tyR
-- -- = Just (ty, Nothing)
+ | isReflCo co
+ = Just (ty, Nothing)
+
| isForAllTy tyL
= ASSERT2( isForAllTy tyR, ppr co $$ ppr ty )
Just (ty `mkCastTy` mkSymCo co1, Just co2)
@@ -998,6 +1001,9 @@ pushCoValArg co
-- -- | tyL `eqType` tyR
-- -- = Just (mkRepReflCo arg, Nothing)
+ | isReflCo co
+ = Just (mkRepReflCo arg, Nothing)
+
| isFunTy tyL
, (co1, co2) <- decomposeFunCo Representational co
-- If co :: (tyL1 -> tyL2) ~ (tyR1 -> tyR2)