1ed79d534f
#KT-151 Fixed Visibilities.INHERITED constant added (occurs only during resolve), changed after overridden descriptors resolve Fake descriptors are created for invisible properties as well (is necessary for better error reporting)
85 lines
1.3 KiB
Plaintext
85 lines
1.3 KiB
Plaintext
package b
|
|
|
|
open class A {
|
|
internal open fun foo() {}
|
|
}
|
|
|
|
class B : A() {
|
|
<!CANNOT_CHANGE_ACCESS_PRIVILEGE!>protected<!> override fun foo() {}
|
|
}
|
|
|
|
class C : A() {
|
|
internal override fun foo() {}
|
|
}
|
|
|
|
//------------
|
|
open class D {
|
|
private open fun self() : D = this
|
|
}
|
|
|
|
class E : D() {
|
|
internal <!CANNOT_OVERRIDE_INVISIBLE_MEMBER!>override<!> fun self() = this
|
|
|
|
fun test() {
|
|
val <!UNUSED_VARIABLE!>s<!> : E = self()
|
|
}
|
|
}
|
|
|
|
//------------
|
|
open class F {
|
|
protected open fun protected_fun() {}
|
|
}
|
|
|
|
class G : F() {
|
|
override fun protected_fun() {}
|
|
}
|
|
|
|
fun test_fun_stays_protected(g: G) {
|
|
g.<!INVISIBLE_MEMBER!>protected_fun<!>()
|
|
}
|
|
|
|
//------------
|
|
open class H {
|
|
internal protected open fun pi_fun() {}
|
|
}
|
|
|
|
class I : H() {
|
|
protected override fun pi_fun() {}
|
|
}
|
|
|
|
class J : H() {
|
|
internal override fun pi_fun() {}
|
|
}
|
|
|
|
class K : H() {
|
|
public override fun pi_fun() {}
|
|
}
|
|
|
|
//-------------
|
|
trait T {
|
|
public fun foo() {}
|
|
}
|
|
|
|
open class L : T {
|
|
override fun foo() {}
|
|
}
|
|
|
|
class M : L() {
|
|
<!CANNOT_WEAKEN_ACCESS_PRIVILEGE!>internal<!> override fun foo() {}
|
|
}
|
|
//---------------
|
|
trait R {
|
|
internal protected fun foo() {}
|
|
}
|
|
|
|
trait P : R {
|
|
internal override fun foo() {}
|
|
}
|
|
|
|
trait Q : R {
|
|
protected override fun foo() {}
|
|
}
|
|
|
|
class S : P, Q {
|
|
<!CANNOT_CHANGE_ACCESS_PRIVILEGE!>internal<!> override fun foo() {}
|
|
} |