Files
kotlin-fork/compiler/testData/codegen/box/javaInterop/protectedField.kt
T
2020-06-17 20:02:26 +03:00

23 lines
397 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// 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")