6a94a3331f
Usually we create synthetic property in java class if there is a property
from the base kotlin class and getter/setter with a corresponding name
in the declared scope or one of supertype scopes. But there is a case,
where the same supertype contains both property and getter:
```
// FILE: Base.kt
open class Base {
open val b = "O"
@JvmName("getBJava")
fun getB() : String = "K"
}
// FILE: Derived.java
public class Derived extends Base {}
```
In this case we shouldn't create synthetic property, because `getB()`
function is invisible for `Derived` class
^KT-66020 Fixed
27 lines
433 B
Kotlin
Vendored
27 lines
433 B
Kotlin
Vendored
// TARGET_BACKEND: JVM_IR
|
|
// WITH_STDLIB
|
|
// ISSUE: KT-66020
|
|
|
|
// FILE: Base.kt
|
|
open class Base {
|
|
open val b = "O"
|
|
|
|
@JvmName("getBJava")
|
|
fun getB() : String = "K"
|
|
}
|
|
|
|
// FILE: Derived.java
|
|
public class Derived extends Base {
|
|
public static String box() {
|
|
Impl x = new Impl();
|
|
return x.getB() + x.getBJava();
|
|
}
|
|
}
|
|
|
|
// FILE: Impl.kt
|
|
class Impl : Derived()
|
|
|
|
fun box(): String {
|
|
return Derived.box()
|
|
}
|