Commit f4a14d6c authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Use substTyUnchecked in TcMType.new_meta_tv_x

Sadly, one of the indirect callers of this function doesn't yet
enforce the in-scope set.  It's in the TcHsType.tc_infer_args swamp,
so I'm not going to wade in there today.

The assertion tripped when investigating Trac #12785; but this patch
does NOT fix the actual bug reported there.
parent 7a509660
......@@ -806,7 +806,12 @@ new_meta_tv_x info subst tv
; details <- newMetaDetails info
; let name = mkSystemName uniq (getOccName tv)
-- See Note [Name of an instantiated type variable]
kind = substTy subst (tyVarKind tv)
kind = substTyUnchecked subst (tyVarKind tv)
-- Unchecked because we call newMetaTyVarX from
-- tcInstBinderX, which is called from tc_infer_args
-- which does not yet take enough trouble to ensure
-- the in-scope set is right; e.g. Trac #12785 trips
-- if we use substTy here
new_tv = mkTcTyVar name kind details
subst1 = extendTvSubstWithClone subst tv new_tv
; return (subst1, new_tv) }
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