[FIR] Fix lookup order for statics in super chains
The order was reversed and the static in the top-most class in the inheritance hierarchy would be found instead of the lowest one.
This commit is contained in:
committed by
Mikhail Glukhikh
parent
4ec369ac5b
commit
593fb8770b
@@ -0,0 +1,31 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
|
||||
// FILE: A.java
|
||||
|
||||
public class A {
|
||||
public static String s = "A.s: NOT OK";
|
||||
public static String f() {
|
||||
return "A.f: NOT OK";
|
||||
}
|
||||
|
||||
public static class B extends A {
|
||||
public static String s = "OK";
|
||||
public static String f() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// FILE: Kotlin.kt
|
||||
|
||||
class Kotlin: A.B() {
|
||||
fun getS() = s
|
||||
fun callF() = f()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val kotlin = Kotlin()
|
||||
if (kotlin.getS() != "OK") return "fail1"
|
||||
return kotlin.callF()
|
||||
}
|
||||
Reference in New Issue
Block a user