Files
kotlin-fork/compiler/testData/codegen/box/javaInterop/protectedField.kt
T
2020-04-16 15:08:11 +03:00

24 lines
427 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// FILE: ProtectedField.java
public abstract class ProtectedField {
protected String field = "fail";
}
//FILE: test.kt
package test
import ProtectedField
class Derived: ProtectedField() {
fun setAndGetField(arg: String) = myRun {
super.field = arg
super.field
}
}
fun myRun(f: () -> String) = f()
fun box() = Derived().setAndGetField("OK")