You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The analyzer function FunctionTypeImpl.relateTypeFormals substitutes type bound inside the same loop that generates the substitution. This means that if one type variable refers to a later type variable, the later type variable won't get substituted when checking the bound for the former. E.g.:
would return false, since during the first loop iteration, it would only substitute fresh type variables for T and V, causing it to call relation(W, U).
What we should do instead is build up a full substitution of fresh type variables for all of the type variables in f1 and f2 first, and then check all the bounds.
This fix needs to be made in both analyzer and front_end (see TypeConstraintGatherer._matchTypeFormals).