Use the new type inference for top-level callable reference resolution
^KT-47797 Fixed ^KT-47987 Fixed ^KT-45034 Fixed ^KT-48446 Fixed ^KT-13934 Fixed
This commit is contained in:
+3
@@ -1,8 +1,11 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun <K> id(x: K) = x
|
||||
|
||||
class A1 {
|
||||
fun <T> a1(t: T): Unit {}
|
||||
fun test1(): (String) -> Unit = A1()::a1
|
||||
fun test2(): (String) -> Unit = id(A1()::a1)
|
||||
}
|
||||
|
||||
class A2 {
|
||||
|
||||
+4
-1
@@ -1,8 +1,11 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun <K> id(x: K) = x
|
||||
|
||||
class A1 {
|
||||
fun <T> a1(t: T): Unit {}
|
||||
fun test1(): (String) -> Unit = A1()::a1
|
||||
fun test2(): (String) -> Unit = id(A1()::a1)
|
||||
}
|
||||
|
||||
class A2 {
|
||||
@@ -19,6 +22,6 @@ class A3<T> {
|
||||
fun test2(): (T) -> Unit = A3<T>()::a3
|
||||
fun test3(): (Int) -> String = A3<Int>()::a3
|
||||
|
||||
fun <R> test4(): (R) -> Unit = <!TYPE_MISMATCH!>this::<!TYPE_INFERENCE_PARAMETER_CONSTRAINT_ERROR!>a3<!><!>
|
||||
fun <R> test4(): (R) -> Unit = this::<!TYPE_MISMATCH!>a3<!>
|
||||
fun <R> test5(): (T) -> R = this::a3
|
||||
}
|
||||
+3
@@ -1,11 +1,14 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ K> id(/*0*/ x: K): K
|
||||
|
||||
public final class A1 {
|
||||
public constructor A1()
|
||||
public final fun </*0*/ T> a1(/*0*/ t: T): kotlin.Unit
|
||||
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 final fun test1(): (kotlin.String) -> kotlin.Unit
|
||||
public final fun test2(): (kotlin.String) -> kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user