Files
kotlin-fork/compiler/testData/diagnostics/tests/samConversions/kt60983.fir.kt
T
Kirill Rakhman 907ebb36d0 [FIR] Filter out SAM constructors from MemberScopeTowerLevel
This tower level is for calls on a dispatch receiver, and it's not
allowed to call SAM constructors on a dispatch receiver.

#KT-60983 Fixed
2023-10-27 08:03:00 +00:00

58 lines
892 B
Kotlin
Vendored

// MODULE: m1
// FILE: J.java
public class J {
public static class C {}
public class C2 {}
public interface I {
void x();
}
}
// FILE: test.kt
class K {
open class C
inner class C2
fun interface I {
fun x()
}
}
fun J.testJ() {
<!UNRESOLVED_REFERENCE!>C<!>()
C2()
<!UNRESOLVED_REFERENCE!>I<!> {}
}
fun testJ2(j: J) {
j.<!UNRESOLVED_REFERENCE!>C<!>()
j.C2()
j.<!UNRESOLVED_REFERENCE!>I<!> {}
}
fun K.testK() {
<!UNRESOLVED_REFERENCE!>C<!>()
C2()
<!UNRESOLVED_REFERENCE!>I<!> {}
}
fun testK2(k: K) {
k.<!UNRESOLVED_REFERENCE!>C<!>()
k.C2()
k.<!UNRESOLVED_REFERENCE!>I<!> {}
}
// MODULE: m2(m1)
// FILE: testResolutionContinues.kt
fun J.testResolutionContinues() {
acceptI(I {})
}
fun K.testResolutionContinues() {
acceptI(I {})
}
fun interface I {
fun x()
}
fun acceptI(i: I) {}