Calls to non-@JvmStatic protected members of companion objects from subclasses are now errors (unsupported yet)
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
open class A {
|
||||
protected fun foo() = "OK"
|
||||
}
|
||||
|
||||
class B {
|
||||
companion object : A()
|
||||
|
||||
fun bar() = foo()
|
||||
}
|
||||
|
||||
fun box() = B().bar()
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
open class A {
|
||||
companion object {
|
||||
protected fun foo() = "OK"
|
||||
}
|
||||
class B : A() {
|
||||
fun bar() = foo()
|
||||
}
|
||||
}
|
||||
|
||||
fun box() = A.B().bar()
|
||||
Reference in New Issue
Block a user