[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
This commit is contained in:
+2
-2
@@ -35,7 +35,7 @@ class G : F() {
|
||||
}
|
||||
|
||||
fun test_fun_stays_protected(g: G) {
|
||||
g.protected_fun()
|
||||
g.<!HIDDEN!>protected_fun<!>()
|
||||
}
|
||||
|
||||
//------------
|
||||
@@ -82,4 +82,4 @@ interface Q : R {
|
||||
|
||||
class S : P, Q {
|
||||
internal override fun foo() {}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ class B : A() {
|
||||
}
|
||||
|
||||
fun test(b: B) {
|
||||
b.x()
|
||||
b.<!HIDDEN!>x<!>()
|
||||
}
|
||||
|
||||
|
||||
@@ -37,4 +37,4 @@ class F : C(), T {
|
||||
|
||||
class G : C(), T {
|
||||
public override fun foo() {}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -40,7 +40,7 @@ class KotlinClass2 : JavaClass() {
|
||||
|
||||
fun test(a: KotlinClass, b: KotlinClass2) {
|
||||
a.<!HIDDEN!>foo<!>() // Error, protected_and_package declared in different package
|
||||
b.foo() // Error, protected visibility in same package (but could be protected_and_package)
|
||||
b.<!HIDDEN!>foo<!>() // Error, protected visibility in same package (but could be protected_and_package)
|
||||
|
||||
a.<!HIDDEN!>field<!>
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -5,7 +5,7 @@ open class A {
|
||||
fun bar(x: B) {
|
||||
x.foo() // OK, foo declared in A
|
||||
x.<!HIDDEN!>baz<!>() // Declared in B
|
||||
x.foobaz() // Declared in B
|
||||
x.<!HIDDEN!>foobaz<!>() // Declared in B
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user