Commit 4bdac331 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Fix the in-scope set in TcHsType.instantiateTyN

See Trac #13879
parent 22b917ee
......@@ -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') }
---------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment