Deduce receiver type of callable reference from LHS, not from descriptor
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
// !CHECK_TYPE
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
interface A
|
||||
interface B : A
|
||||
|
||||
fun A.foo() {}
|
||||
|
||||
fun take(f: (A) -> Unit) {}
|
||||
fun take(f: () -> Unit) {}
|
||||
|
||||
fun test() {
|
||||
B::foo checkType { _<KFunction1<B, Unit>>() }
|
||||
|
||||
<!NONE_APPLICABLE!>take<!>(B::foo)
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package
|
||||
|
||||
public fun take(/*0*/ f: () -> kotlin.Unit): kotlin.Unit
|
||||
public fun take(/*0*/ f: (A) -> kotlin.Unit): kotlin.Unit
|
||||
public fun test(): kotlin.Unit
|
||||
public fun A.foo(): kotlin.Unit
|
||||
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user