Files
kotlin/compiler/testData/codegen/boxWithJava/properties/protectedJavaProperty.kt
Alexander Udalov daab3db062 Add WITH_RUNTIME and WITH_REFLECT directives to box tests
Currently all tests in boxWithStdlib/ run with both runtime and reflection
included; eventually they'll be merged into box/ using these directives
2016-03-03 16:11:21 +03:00

38 lines
571 B
Kotlin
Vendored

// WITH_RUNTIME
// FILE: JavaBaseClass.java
public class JavaBaseClass {
private String field = "fail";
protected String getFoo() {
return field;
}
protected void setFoo(String foo) {
field = foo;
}
}
// FILE: kotlin.kt
package z
import JavaBaseClass
object KotlinExtender : JavaBaseClass() {
@JvmStatic fun test(): String {
return runSlowly {
foo = "OK"
foo
}
}
}
fun runSlowly(f: () -> String): String {
return f()
}
fun box(): String {
return KotlinExtender.test()
}