Files
kotlin-fork/compiler/testData/codegen/box/jvmStatic/protectedInSuperClass/simpleFunction.kt
T
2021-03-31 00:08:52 +02:00

22 lines
406 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// WITH_RUNTIME
// FILE: 1.kt
package a
open class A {
companion object {
@JvmStatic // Required to be accessible from subclasses of A in other packages.
protected fun foo() = "OK"
}
}
// FILE: 2.kt
import a.*
class B : A() {
fun bar() = foo() // calls static A.foo(), not inaccessible A.Companion.foo()
}
fun box() = B().bar()