Note [Promote monomorphic tyvars]
Promote any type variables that are free in the environment. Eg
f :: forall qtvs. bound_theta => zonked_tau
The free vars of f's type become free in the envt, and hence will show
up whenever 'f' is called. They may currently at rhs_tclvl, but they
had better be unifiable at the outer_tclvl! Example: envt mentions
alpha[1]
tau_ty = beta[2] -> beta[2]
constraints = alpha ~ [beta]
we don't quantify over beta (since it is fixed by envt)
so we must promote it! The inferred type is just
f :: beta -> beta
NB: promoteTyVarSet ignores coercion variables References 0
This Note does not link to any other.
Referenced by 4
- Deciding quantification GHC.Tc.Solver
- GHC.Tc.Solver call site
- decideAndPromoteTyVars GHC.Tc.Solver
- GHC.Tc.Utils.TcMType call site