935355ad2f
#KT-7437 Fixed #KT-7971 Fixed #KT-7051 Fixed #KT-6125 Fixed #KT-6186 Fixed
19 lines
301 B
Kotlin
Vendored
19 lines
301 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.<!INVISIBLE_MEMBER!>foo<!>() // Error: receiver is not suitable
|
|
}
|
|
}
|