[v1 X1: B1, ..., vn Xn: Bn] -> C[X1, ..., Xn]
where v1, ..., vn and B1, ..., Bn are the variances and bounds of the type parameters of the class C.
A type map that tries to reduce (part of) the result type of the type lambda
with the given
args(some of which are wildcard arguments represented by type bounds).
Non-wildcard arguments are substituted everywhere as usual. A wildcard argument
>: L <: H is substituted for a type lambda parameter
X only under certain conditions.
If Mode.AllowLambdaWildcardApply is set: The wildcard argument is substituted only if
Xappears in a toplevel application of the form
C[..., X, ...]
and there are no other occurrences of
X in the reduced type. In that case
the refinement above is replaced by
C[..., _ >: L <: H, ...]
allReplaced field indicates whether all occurrences of type lambda parameters
in the reduced type have been replaced with arguments.
If Mode.AllowLambdaWildcardApply is not set: All
Xarguments are replaced by:
_ >: L <: H
Any other occurrence of
tycon is replaced by
U, if the
tycon is covariant, or nonvariant, or by
if the occurrence is contravariant.
The idea is that the
AllowLambdaWildcardApply mode is used to check whether
a type can be soundly reduced, and to give an error or warning if that
is not the case. By contrast, the default mode, with
not set, reduces all applications even if this yields a different type, so
its postcondition is that no type parameters of
tycon appear in the
result type. Using this mode, we can guarantee that
appliedTo will never
produce a higher-kinded application with a type lambda as type constructor.
Adapt all arguments to possible higher-kinded type parameters using etaExpandIfHK
Assert type is not a TypeBounds instance and return it unchanged
v1 conform to variance
This is the case if the variances are the same or
sym is nonvariant.
Does the variance of type parameter
tparam1 conform to the variance of type parameter
Do the variances of type parameters
tparams1 conform to the variances
of corresponding type parameters
This is only the case of
tparams2 have the same length.