1. Substitution variance (sv) is a substitution composition of type alias argument variance (av)
and corresponding expanding type argument variance (ev):
sv =
| av == ev -> av
| av == INVARIANT -> ev
| ev == INVARIANT -> av
| else -> (variance conflict error; av)
2. Resulting variance (rv) is a type argument composition of sv and type parameter variance (pv):
rv =
| sv == tv => INVARIANT
| sv == INVARIANT => INVARIANT
| tv == INVARIANT => sv
| else -> (variance conflict error; sv)
When resolving arguments on inner classifier, one can omit the arguments
for outer class 'Outer' if they are present implicitly in the scope:
- One of the supertypes of current class is Outer
- One of the outer classes or one of their supertypes is Outer
Relevant arguments are obtained from the first type found by
the algorithm above
Note that before this commit implicit arguments were only been searched
in containing classes
#KT-11123 Fixed