ASSIGN_RIGHT¶
Requires that there exists an instantiation of the right type parameters such that the right type is a supertype of the left type when substituted. Type parameters of the left type are treated as fixed.
The constructed substitutor contains mappings for all type parameters of the right type such that the substituted right type is a supertype of the left type. If a correct instantiation doesn't exist, no substitutor is produced.
Examples:¶
T: Number is always a subtype of Number with any possible instantiation of T. The ASSIGN_RIGHT unification substitutor here is empty as the right type doesn't have any type parameters.
The ASSIGN_RIGHT unification substitutor here is { R -> T }.
Since List<T> is not guaranteed to be a subtype of List<R> for all possible instantiations of T (consider { T -> kotlin/Number }), ASSIGN_RIGHT unification fails and no substitutor is constructed.