IR: remove isFromJava check from isOverridableMemberOrAccessor

This is needed because in case a static member is inherited via a Kotlin
class (class C in the newly added test), its origin becomes
FAKE_OVERRIDE which is technically not Java anymore. After this change,
we'll build fake overrides for static members from superclasses
regardless of whether they come from Java or Kotlin.

Also, move the previous logic of
isOverridableFunction/isOverridableProperty to the only call site at
IdSignatureFactory.

 #KT-65589 Fixed
This commit is contained in:
Alexander Udalov
2024-02-09 13:25:49 +01:00
committed by Space Team
parent 03418c11c3
commit b72effab98
15 changed files with 105 additions and 26 deletions
@@ -0,0 +1,26 @@
// TARGET_BACKEND: JVM
// FILE: A.java
public class A {
public static String o = "O";
public static String k() {
return "K";
}
}
// FILE: B.kt
open class B : A()
// FILE: C.kt
open class C : B()
// FILE: D.java
public class D extends C {}
// FILE: E.kt
class E : D() {
fun g(): String = o + k()
}
// FILE: box.kt
fun box(): String = E().g()