Files
kotlin-fork/compiler/testData/diagnostics/tests/scopes/kt151.fir.kt
T
Dmitriy Novozhilov bf1a00c73a [FIR] Rework resolution of declaration statuses
There is introduced algorithm of resolution with jumps: before
  resolution of some class we resolve all status of members of its
  supertypes, so we can properly determine inherited visibility
  and modifiers
2020-10-21 11:53:10 +03:00

41 lines
608 B
Kotlin
Vendored

//KT-151 Inherit visibility when overriding
package kt151
open class A {
protected open fun x() {}
}
class B : A() {
override fun x() {} // No visibility modifier required
}
fun test(b: B) {
b.<!HIDDEN!>x<!>()
}
//more tests
open class C {
internal open fun foo() {}
}
interface T {
fun foo() {}
}
class D : C(), T {
protected override fun foo() {}
}
class E : C(), T {
internal override fun foo() {}
}
class F : C(), T {
<!INCOMPATIBLE_MODIFIERS!>private<!> <!INCOMPATIBLE_MODIFIERS!>override<!> fun foo() {}
}
class G : C(), T {
public override fun foo() {}
}