Broken up massive patch -=chak
Original log message:
This is (sadly) all done in one patch to avoid Darcs bugs.
It's not complete work... more FC stuff to come. A compiler
using just this patch will fail dismally.
-- GHC
import TcType ( tcIsForAllTy, tcView )
import TypeRep ( Type(..) )
-- GHC
import TcType ( tcIsForAllTy, tcView )
import TypeRep ( Type(..) )
+import Coercion ( coercionKind )
import StaticFlags (opt_Flatten)
import Panic (panic)
import ErrUtils (dumpIfSet_dyn)
import StaticFlags (opt_Flatten)
import Panic (panic)
import ErrUtils (dumpIfSet_dyn)
else extendContext [lb] (liftCaseDataCon b alts)
letWrapper lExpr b lalts
else extendContext [lb] (liftCaseDataCon b alts)
letWrapper lExpr b lalts
-lift (Note (Coerce t1 t2) expr) =
- do
+lift (Cast expr co) =
+ do
- let lt1 = liftTy t1
- return ((Note (Coerce lt1 (liftTy t2)) lexpr), lt1)
+ let lco = liftTy co
+ let (t1, t2) = coercionKind lco
+ return ((Cast expr lco), t2)
lift (Note note expr) =
do
lift (Note note expr) =
do
(c, bnds, substIdEnv (delVarEnvList env bnds) expr)
substIdEnv env (Note n expr) =
Note n (substIdEnv env expr)
(c, bnds, substIdEnv (delVarEnvList env bnds) expr)
substIdEnv env (Note n expr) =
Note n (substIdEnv env expr)
+substIdEnv env (Cast e co) = Cast (substIdEnv env e) co
substIdEnv env e@(Type t) = e
substIdEnv env e@(Type t) = e
arrUsage (Type t) =
typeArrayUsage t
arrUsage (Type t) =
typeArrayUsage t
+-- not quite sure this is right
+arrUsage (Cast expr co) =
+ arrUsage expr
+
bindType (b, expr) =
let
bT = varArrayUsage b
bindType (b, expr) =
let
bT = varArrayUsage b