Files
kotlin/compiler/testData/codegen/boxAgainstJava/visibility/protectedAndPackage/protectedAccessor.kt
pyos 75aef4633a JVM_IR: add accessors for protected members in divergent hierarchies
Class B : A cannot access a protected field of A through a reference to
an instance of C : A.
2019-10-24 12:46:48 +02:00

22 lines
347 B
Kotlin
Vendored

// FILE: protectedPack/A.java
package protectedPack;
public class A {
protected final String field;
public A(String value) {
field = value;
}
}
// FILE: B.kt
import protectedPack.A
class B(value: String) : A(value) {
inner class C : A(field) {
val result = field
}
}
fun box(): String = B("OK").C().result