[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
This commit is contained in:
committed by
Space Team
parent
576d8d1c10
commit
907ebb36d0
@@ -0,0 +1,58 @@
|
||||
// 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) {}
|
||||
@@ -0,0 +1,58 @@
|
||||
// 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.<!RESOLUTION_TO_CLASSIFIER!>I<!> {}
|
||||
}
|
||||
|
||||
fun K.testK() {
|
||||
<!UNRESOLVED_REFERENCE!>C<!>()
|
||||
C2()
|
||||
<!UNRESOLVED_REFERENCE!>I<!> {}
|
||||
}
|
||||
|
||||
fun testK2(k: K) {
|
||||
k.<!UNRESOLVED_REFERENCE!>C<!>()
|
||||
k.C2()
|
||||
k.<!RESOLUTION_TO_CLASSIFIER!>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) {}
|
||||
Reference in New Issue
Block a user