[FIR] Fixed Replace ConeTypeVariable on ConeTypeParameter ^KT-51017

in AbstractConeCallConflictResolver.computeParameterTypes
This commit is contained in:
Ivan Kochurkin
2022-01-28 22:48:52 +03:00
committed by teamcity
parent 5391ee91af
commit a0510f4a67
9 changed files with 81 additions and 13 deletions
@@ -0,0 +1,12 @@
// FIR_IDENTICAL
// ISSUE: KT-51017
interface A
interface B : A
fun <V : A> V.foo(): V = this
fun <T : B> T.foo(): T = this
fun test(list: List<B>) {
B::foo // No ambiguity, T.foo wins
}
@@ -0,0 +1,17 @@
package
public fun test(/*0*/ list: kotlin.collections.List<B>): kotlin.Unit
public fun </*0*/ T : B> T.foo(): T
public fun </*0*/ V : A> V.foo(): V
public interface A {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface B : A {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -1,10 +0,0 @@
// KT-11075 NONE_APPLICABLE reported for callable reference to an overloaded generic function with expected type provided
object TestCallableReferences {
fun <A> foo(x: A) = x
fun <B> foo(x: List<B>) = x
fun test0(): (String) -> String = TestCallableReferences::foo
fun <T> test1(): (List<T>) -> List<T> = TestCallableReferences::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// KT-11075 NONE_APPLICABLE reported for callable reference to an overloaded generic function with expected type provided
object TestCallableReferences {