Calls to non-@JvmStatic protected members of companion objects from subclasses are now errors (unsupported yet)

This commit is contained in:
Mikhail Glukhikh
2015-11-25 20:21:31 +03:00
parent e39ca63bcc
commit ea4f167091
11 changed files with 269 additions and 2 deletions
@@ -0,0 +1,11 @@
open class A {
protected fun foo() = "OK"
}
class B {
companion object : A()
fun bar() = foo()
}
fun box() = B().bar()
@@ -0,0 +1,10 @@
open class A {
companion object {
protected fun foo() = "OK"
}
class B : A() {
fun bar() = foo()
}
}
fun box() = A.B().bar()