Refine isVisible for protected visibility

#KT-7437 Fixed
 #KT-7971 Fixed
 #KT-7051 Fixed
 #KT-6125 Fixed
 #KT-6186 Fixed
This commit is contained in:
Denis Zharkov
2016-03-23 20:03:52 +03:00
parent 182b349492
commit 935355ad2f
20 changed files with 411 additions and 44 deletions
@@ -0,0 +1,18 @@
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
}
}