Files
kotlin-fork/compiler/testData/codegen/box/statics/protectedStatic.kt
T
Denis Zharkov 687a58843f FIR: Rewrite visibility checking
Unbound it from implicit receiver stack as it only needs scope structure/declaration nestedness
Semantics for protected has been changed in a way it works in old FE

NB: We should report additional diagnostic in case of CallCompanionProtectedNonStatic.fir.kt
(see KT-38814)
2020-05-15 16:04:44 +03:00

38 lines
656 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// FILE: First.java
public abstract class First {
protected static String TEST = "OK";
protected static String test() {
return TEST;
}
}
// FILE: First.kt
package anotherPackage
import First
class Second : First() {
val some = { First.TEST }
fun foo() = { First.test() }
val some2 = { TEST }
fun foo2() = { test() }
}
fun box(): String {
if (Second().some.invoke() != "OK") return "fail 1"
if (Second().foo().invoke() != "OK") return "fail 2"
if (Second().some2.invoke() != "OK") return "fail 3"
if (Second().foo2().invoke() != "OK") return "fail 4"
return "OK"
}