diff options
author | Richard Eisenberg <eir@cis.upenn.edu> | 2016-04-06 15:24:34 +0200 |
---|---|---|
committer | Richard Eisenberg <eir@cis.upenn.edu> | 2016-04-12 08:14:18 -0400 |
commit | 0b6dcf6d2ccac3b43037650279256022a352de53 (patch) | |
tree | af6deef394242781c6f91e4bee63c7dcdf5cc8ff /compiler | |
parent | dd99f2ece1bd139be02beddc6dc672862ee5ae34 (diff) | |
download | haskell-0b6dcf6d2ccac3b43037650279256022a352de53.tar.gz |
Fix #11814 by throwing more stuff into InScopeSets
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/stranal/WwLib.hs | 5 | ||||
-rw-r--r-- | compiler/types/Type.hs | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/compiler/stranal/WwLib.hs b/compiler/stranal/WwLib.hs index 7c85036c1f..4ec36baa5f 100644 --- a/compiler/stranal/WwLib.hs +++ b/compiler/stranal/WwLib.hs @@ -22,6 +22,7 @@ import MkCore ( mkRuntimeErrorApp, aBSENT_ERROR_ID, mkCoreUbxTup ) import MkId ( voidArgId, voidPrimId ) import TysPrim ( voidPrimTy ) import TysWiredIn ( tupleDataCon ) +import VarEnv ( mkInScopeSet ) import Type import Coercion import FamInstEnv @@ -127,7 +128,9 @@ mkWwBodies :: DynFlags -- E mkWwBodies dflags fam_envs fun_ty demands res_info - = do { (wrap_args, wrap_fn_args, work_fn_args, res_ty) <- mkWWargs emptyTCvSubst fun_ty demands + = do { let empty_subst = mkEmptyTCvSubst (mkInScopeSet (tyCoVarsOfType fun_ty)) + + ; (wrap_args, wrap_fn_args, work_fn_args, res_ty) <- mkWWargs empty_subst fun_ty demands ; (useful1, work_args, wrap_fn_str, work_fn_str) <- mkWWstr dflags fam_envs wrap_args -- Do CPR w/w. See Note [Always do CPR w/w] diff --git a/compiler/types/Type.hs b/compiler/types/Type.hs index c5561a32e6..89019680f3 100644 --- a/compiler/types/Type.hs +++ b/compiler/types/Type.hs @@ -1084,9 +1084,9 @@ mkCastTy ty co | isReflexiveCo co = ty mkCastTy (CastTy ty co1) co2 = mkCastTy ty (co1 `mkTransCo` co2) -- See Note [Weird typing rule for ForAllTy] -mkCastTy (ForAllTy (Named tv vis) inner_ty) co +mkCastTy outer_ty@(ForAllTy (Named tv vis) inner_ty) co = -- have to make sure that pushing the co in doesn't capture the bound var - let fvs = tyCoVarsOfCo co + let fvs = tyCoVarsOfCo co `unionVarSet` tyCoVarsOfType outer_ty empty_subst = mkEmptyTCvSubst (mkInScopeSet fvs) (subst, tv') = substTyVarBndr empty_subst tv in |