diff options
author | Bartosz Nitka <niteria@gmail.com> | 2016-04-20 09:35:47 -0700 |
---|---|---|
committer | Bartosz Nitka <niteria@gmail.com> | 2016-04-20 09:36:25 -0700 |
commit | 62943d2adc51c4a7a61bb1f48fd245791acfffe9 (patch) | |
tree | 5a2fa3ce5ba4d65423e3b69c2c5ec87cbde4adcf /compiler/coreSyn | |
parent | 687c77808b82e8cf8c77fba2c0ed2fe003c907cf (diff) | |
download | haskell-62943d2adc51c4a7a61bb1f48fd245791acfffe9.tar.gz |
Build a correct substitution in dataConInstPat
This adds the tyvars of the domain of the substitution into the in-scope
set as well.
What I'm not sure here is if the kinds can have any free vars that
should be in the in-scope set as well.
Test Plan: ./validate
Reviewers: goldfire, austin, bgamari, simonpj
Reviewed By: simonpj
Subscribers: thomie, simonmar
Differential Revision: https://phabricator.haskell.org/D2094
GHC Trac Issues: #11371
Diffstat (limited to 'compiler/coreSyn')
-rw-r--r-- | compiler/coreSyn/CoreUtils.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/coreSyn/CoreUtils.hs b/compiler/coreSyn/CoreUtils.hs index 82be8d9e28..887c313f71 100644 --- a/compiler/coreSyn/CoreUtils.hs +++ b/compiler/coreSyn/CoreUtils.hs @@ -1564,8 +1564,8 @@ dataConInstPat fss uniqs con inst_tys (zip3 ex_tvs ex_fss ex_uniqs) mk_ex_var :: TCvSubst -> (TyVar, FastString, Unique) -> (TCvSubst, TyVar) - mk_ex_var subst (tv, fs, uniq) = (Type.extendTvSubst subst tv - (mkTyVarTy new_tv) + mk_ex_var subst (tv, fs, uniq) = (Type.extendTvSubstWithClone subst tv + new_tv , new_tv) where new_tv = mkTyVar (mkSysTvName uniq fs) kind @@ -1574,7 +1574,7 @@ dataConInstPat fss uniqs con inst_tys -- Make value vars, instantiating types arg_ids = zipWith4 mk_id_var id_uniqs id_fss arg_tys arg_strs mk_id_var uniq fs ty str - = mkLocalIdOrCoVarWithInfo name (Type.substTyUnchecked full_subst ty) info + = mkLocalIdOrCoVarWithInfo name (Type.substTy full_subst ty) info where name = mkInternalName uniq (mkVarOccFS fs) noSrcSpan info | isMarkedStrict str = vanillaIdInfo `setUnfoldingInfo` evaldUnfolding |