FIR: unwrap intersection overrides when looking for owner class
But not substitution overrides! This is important if the method called is an intersection override where one of the intersected types is a subtype of a generic type.
This commit is contained in:
+33
@@ -0,0 +1,33 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// MODULE: lib
|
||||
// FILE: I.java
|
||||
package test;
|
||||
|
||||
public interface I {
|
||||
String foo();
|
||||
}
|
||||
|
||||
// FILE: J.java
|
||||
package test;
|
||||
|
||||
class JBase<T> {
|
||||
public String foo() { return "OK"; }
|
||||
}
|
||||
|
||||
public class J extends JBase<String> {}
|
||||
|
||||
// FILE: JImpl.java
|
||||
package test;
|
||||
|
||||
public class JImpl {
|
||||
public static class C1 extends J implements I {}
|
||||
public static class C2 extends J implements I {}
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: main.kt
|
||||
import test.JImpl
|
||||
|
||||
fun <T> select(a: T, b: T): T = a
|
||||
|
||||
fun box() = select(JImpl.C1(), JImpl.C2()).foo()
|
||||
Reference in New Issue
Block a user