Files
kotlin-fork/compiler/testData/codegen/box/javaInterop/kjkPropertyAndExtensionProperty.kt
Alexander Udalov c997e9f142 Tests: move diagnostic test to testsWithJvmBackend
There's a difference in behavior of K1 and K2 here, see KT-66528.

 #KT-66528
2024-03-14 12:38:46 +00:00

80 lines
1.1 KiB
Kotlin
Vendored

// TARGET_BACKEND: JVM
// IGNORE_BACKEND_K1: JVM, JVM_IR
// FILE: J.java
public class J extends D {}
// FILE: JOverridesRegular.java
public class JOverridesRegular extends D {
@Override
public int getA() {
return 1;
}
}
// FILE: JOverridesExtension.java
public class JOverridesExtension extends D {
@Override
public int getA(String $this) {
return 1;
}
}
// FILE: JOVerridesBoth.java
public class JOVerridesBoth extends D {
@Override
public int getA() {
return 1;
}
@Override
public int getA(String $this) {
return 1;
}
}
// FILE: 1.kt
open class D {
open val a: Int
get() = 2
open val String.a: Int
get() = 1
}
class F : J() {
fun test() {
a
"".a
}
}
class F2 : JOverridesRegular() {
fun test() {
a
"".a
}
}
class F3 : JOverridesExtension() {
fun test() {
a
"".a
}
}
class F4 : JOVerridesBoth() {
fun test() {
a
"".a
}
}
fun box(): String {
F().test()
F2().test()
F3().test()
F4().test()
return "OK"
}