ASSIGN_ALL¶
Requires that there exists an instantiation of the left and right type parameters such that the substituted left type is a subtype of the substituted right type.
The constructed substitutor contains mappings for all type parameters of both the left type and the right type such that the substituted left type is a subtype of the substituted right type. If a correct instantiation doesn't exist, no substitutor is produced.
Examples:¶
fun <A> rightTypes(rightType1: List<Int>, rightType2: List<A>) {}
fun <B> leftTypes(leftType1: List<B>, leftType2: List<Int>) {}
Both ASSIGN_RIGHT and ASSIGN_LEFT here return no substitutor, as these pairs are inverses of each other. However, ASSIGN_ALL is able to freely assign all type parameters, so { A -> kotlin/Int, B -> kotlin/Int } is produced. With this substitution, both constraints are satisfied.