diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2017-06-28 12:32:48 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2017-06-28 12:32:48 +0100 |
commit | 4bdac331207e10650da9d3bf1b446bc8be3c069a (patch) | |
tree | 8bab00171ef6701c0b7af2ccb766041ea887f987 /compiler | |
parent | 22b917eeb1d101cf0b6af2c94826446e4e2f2cdb (diff) | |
download | haskell-4bdac331207e10650da9d3bf1b446bc8be3c069a.tar.gz |
Fix the in-scope set in TcHsType.instantiateTyN
See Trac #13879
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/typecheck/TcHsType.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/typecheck/TcHsType.hs b/compiler/typecheck/TcHsType.hs index 46b306d130..7c8a89a0a2 100644 --- a/compiler/typecheck/TcHsType.hs +++ b/compiler/typecheck/TcHsType.hs @@ -929,11 +929,16 @@ instantiateTyN n ty ki num_to_inst = length bndrs - n -- NB: splitAt is forgiving with invalid numbers (inst_bndrs, leftover_bndrs) = splitAt num_to_inst bndrs + empty_subst = mkEmptyTCvSubst (mkInScopeSet (tyCoVarsOfType ki)) in if num_to_inst <= 0 then return (ty, ki) else - do { (subst, inst_args) <- tcInstBinders inst_bndrs + do { (subst, inst_args) <- tcInstBindersX empty_subst Nothing inst_bndrs ; let rebuilt_ki = mkPiTys leftover_bndrs inner_ki ki' = substTy subst rebuilt_ki + ; traceTc "instantiateTyN" (vcat [ ppr ty <+> dcolon <+> ppr ki + , ppr subst + , ppr rebuilt_ki + , ppr ki' ]) ; return (mkNakedAppTys ty inst_args, ki') } --------------------------- |