Files
kotlin-fork/compiler/testData/diagnostics/tests/scopes/protectedVisibility/complexCompanion.fir.kt
T

19 lines
278 B
Kotlin
Vendored

open class A {
protected fun foo() {}
init {
B.foo() // Ok, receiver (B.Companion) is subtype of A
(B.Companion).foo()
}
}
class B {
companion object : A()
}
class C: A() {
init {
B.foo() // Error: receiver is not suitable
}
}