Skip to content

Don't default type variables in type families

sheaf requested to merge sheaf/ghc:T17536 into master

This MR removes the defaulting of type variables of kind RuntimeRep, Levity and Multiplicity inside type families.

To do this, a datatype is added that records which things should be defaulted in a call to quantifyTyVars. Then, when calling quantifyTyVars in tcTyFamInstEqnGuts or tcDataFamInstHeader, we set these options to avoid the previously mentioned defaulting.

This avoids wildcards being defaulted, which caused type families to unexpectedly fail to reduce (see e.g. #17536 (closed)). Note that kind defaulting, applicable only with -XNoPolyKinds, is not modified at all.

Edited by sheaf

Merge request reports