FIR: rename HIDDEN to INVISIBLE_REFERENCE

Some of them should be INVISIBLE_MEMBER though
This commit is contained in:
pyos
2021-04-19 10:14:16 +02:00
committed by Mikhail Glukhikh
parent f1cf6b54e7
commit e6d923f65c
139 changed files with 284 additions and 468 deletions
@@ -19,15 +19,15 @@ open class A {
fun fromOutside() {
devNull(A.internal_val)
devNull(A.public_val)
devNull(A.<!HIDDEN!>private_val<!>)
devNull(A.<!HIDDEN!>protected_val<!>)
devNull(A.<!INVISIBLE_REFERENCE!>private_val<!>)
devNull(A.<!INVISIBLE_REFERENCE!>protected_val<!>)
}
class B: A() {
fun fromSubclass() {
devNull(A.internal_val)
devNull(A.public_val)
devNull(A.<!HIDDEN!>private_val<!>)
devNull(A.<!INVISIBLE_REFERENCE!>private_val<!>)
devNull(A.protected_val)
}
}
@@ -35,7 +35,7 @@ class G : F() {
}
fun test_fun_stays_protected(g: G) {
g.<!HIDDEN!>protected_fun<!>()
g.<!INVISIBLE_REFERENCE!>protected_fun<!>()
}
//------------
@@ -23,8 +23,8 @@ class B extends A {
// FILE: test.kt
fun test() {
A.<!HIDDEN!>a<!>
A.<!HIDDEN!>foo<!>()
A.<!INVISIBLE_REFERENCE!>a<!>
A.<!INVISIBLE_REFERENCE!>foo<!>()
A.b
A.bar()
B.a
+1 -1
View File
@@ -8,6 +8,6 @@ class A {
class B() {
init {
A().<!HIDDEN!>a<!> = "Hello"
A().<!INVISIBLE_REFERENCE!>a<!> = "Hello"
}
}
+1 -1
View File
@@ -10,7 +10,7 @@ class B : A() {
}
fun test(b: B) {
b.<!HIDDEN!>x<!>()
b.<!INVISIBLE_REFERENCE!>x<!>()
}
+1 -1
View File
@@ -6,6 +6,6 @@ class A(private var i: Int, var j: Int) {
}
fun test(a: A) {
a.<!HIDDEN, HIDDEN!>i<!>++
a.<!INVISIBLE_REFERENCE, INVISIBLE_REFERENCE!>i<!>++
a.j++
}
+3 -3
View File
@@ -7,14 +7,14 @@ open class Some {
class SomeSubclass : Some() {
fun test() {
this.<!HIDDEN!>privateField<!> // 1. Unresolved reference
this.<!INVISIBLE_REFERENCE!>privateField<!> // 1. Unresolved reference
}
}
fun test() {
val s2 = Some()
s2.<!HIDDEN!>privateField<!> // 2. Can't access to 'privateField' in Some
s2.<!INVISIBLE_REFERENCE!>privateField<!> // 2. Can't access to 'privateField' in Some
val s1 = SomeSubclass()
s1.<!HIDDEN!>privateField<!> // 3. Unresolved reference
s1.<!INVISIBLE_REFERENCE!>privateField<!> // 3. Unresolved reference
}
+2 -2
View File
@@ -8,7 +8,7 @@ object MyObject {
fun test1() {
doSmth(MyObject.<!HIDDEN!>message<!>)
doSmth(MyObject.<!INVISIBLE_REFERENCE!>message<!>)
}
class Test {
@@ -17,7 +17,7 @@ class Test {
}
fun test2() {
doSmth(MyObject1.<!HIDDEN!>message<!>)
doSmth(MyObject1.<!INVISIBLE_REFERENCE!>message<!>)
}
}
+1 -1
View File
@@ -14,6 +14,6 @@ import a.C
class A : C() {
fun test() {
val v = <!HIDDEN!>myValue<!>
val v = <!INVISIBLE_REFERENCE!>myValue<!>
}
}
+1 -1
View File
@@ -11,6 +11,6 @@ class C() {
fun box(): String {
val c = C()
if (c.<!HIDDEN!>f<!> != 610) return "fail"
if (c.<!INVISIBLE_REFERENCE!>f<!> != 610) return "fail"
return "OK"
}
+1 -1
View File
@@ -12,5 +12,5 @@ class C: A() {
}
class D {
fun qux() { B().<!HIDDEN!>foo<!>() }
fun qux() { B().<!INVISIBLE_REFERENCE!>foo<!>() }
}
@@ -8,6 +8,6 @@ class Foo : BaseClass() {
fun bar() {
val f = foo()
f.x
f.<!HIDDEN!>y<!>
f.<!INVISIBLE_REFERENCE!>y<!>
}
}
@@ -39,20 +39,20 @@ class KotlinClass2 : JavaClass() {
}
fun test(a: KotlinClass, b: KotlinClass2) {
a.<!HIDDEN!>foo<!>() // Error, protected_and_package declared in different package
b.<!HIDDEN!>foo<!>() // Error, protected visibility in same package (but could be protected_and_package)
a.<!INVISIBLE_REFERENCE!>foo<!>() // Error, protected_and_package declared in different package
b.<!INVISIBLE_REFERENCE!>foo<!>() // Error, protected visibility in same package (but could be protected_and_package)
a.<!HIDDEN!>field<!>
a.<!INVISIBLE_REFERENCE!>field<!>
JavaClass.<!HIDDEN!>bar1<!>()
JavaClass.<!HIDDEN!>CONST1<!>
JavaClass.<!INVISIBLE_REFERENCE!>bar1<!>()
JavaClass.<!INVISIBLE_REFERENCE!>CONST1<!>
KotlinClass.<!UNRESOLVED_REFERENCE!>bar1<!>() // Currently it's unresolved, but it should be prohibited even in case it would be resolved
KotlinClass.<!UNRESOLVED_REFERENCE!>CONST1<!>
JavaClassSamePackage.<!HIDDEN!>bar1<!>()
JavaClassSamePackage.<!INVISIBLE_REFERENCE!>bar1<!>()
JavaClassSamePackage.bar2()
JavaClassSamePackage.<!HIDDEN!>CONST1<!>
JavaClassSamePackage.<!INVISIBLE_REFERENCE!>CONST1<!>
JavaClassSamePackage.CONST2
}
@@ -4,8 +4,8 @@ open class A {
fun bar(x: B) {
x.foo() // OK, foo declared in A
x.<!HIDDEN!>baz<!>() // Declared in B
x.<!HIDDEN!>foobaz<!>() // Declared in B
x.<!INVISIBLE_REFERENCE!>baz<!>() // Declared in B
x.<!INVISIBLE_REFERENCE!>foobaz<!>() // Declared in B
}
}
@@ -40,6 +40,6 @@ class B : A() {
}
fun baz(a: A) {
a.<!HIDDEN!>foo<!>
a.<!INVISIBLE_REFERENCE!>foo<!>
a.bar = a.bar + ""
}
@@ -27,5 +27,5 @@ class B : A() {
}
fun baz(a: A) {
a.<!HIDDEN!>foo<!> { }
a.<!INVISIBLE_REFERENCE!>foo<!> { }
}
@@ -40,8 +40,8 @@ class B {
}
fun test3(a: A) {
a.<!HIDDEN!>v<!> //todo .bMethod()
a.<!HIDDEN!>f<!>(0, 1) //todo .bMethod()
a.<!INVISIBLE_REFERENCE!>v<!> //todo .bMethod()
a.<!INVISIBLE_REFERENCE!>f<!>(0, 1) //todo .bMethod()
}
interface T
@@ -54,7 +54,7 @@ open class C : T {
}
fun test4(c: C) {
c.<!HIDDEN, HIDDEN!>i<!>++
c.<!INVISIBLE_REFERENCE, INVISIBLE_REFERENCE!>i<!>++
}
class D : C() {
@@ -78,7 +78,7 @@ class F : C() {
class G : T {
fun test8(c: C) {
doSmth(c.<!HIDDEN!>i<!>)
doSmth(c.<!INVISIBLE_REFERENCE!>i<!>)
}
}
@@ -91,5 +91,5 @@ import test_visibility.*
fun test() {
internal_fun()
<!HIDDEN!>private_fun<!>()
<!INVISIBLE_REFERENCE!>private_fun<!>()
}
@@ -25,15 +25,15 @@ import a.PO
fun test() {
val y = makeA()
y.bar()
<!HIDDEN!>foo<!>()
<!INVISIBLE_REFERENCE!>foo<!>()
val u : A = <!HIDDEN!>A<!>()
val u : A = <!INVISIBLE_REFERENCE!>A<!>()
val a : java.util.Arrays.ArrayList<Int>;
val po = <!HIDDEN!>PO<!>
val po = <!INVISIBLE_REFERENCE!>PO<!>
}
class B : <!EXPOSED_SUPER_CLASS, HIDDEN!>A<!>() {}
class B : <!EXPOSED_SUPER_CLASS, INVISIBLE_REFERENCE!>A<!>() {}
class Q {
class W {
@@ -26,17 +26,17 @@ package a
fun test() {
val y = makeA()
y.bar()
<!HIDDEN!>foo<!>()
<!INVISIBLE_REFERENCE!>foo<!>()
val u : A = <!HIDDEN!>A<!>()
val u : A = <!INVISIBLE_REFERENCE!>A<!>()
val z = <!HIDDEN!>x<!>
<!HIDDEN!>x<!> = 30
val z = <!INVISIBLE_REFERENCE!>x<!>
<!INVISIBLE_REFERENCE!>x<!> = 30
val po = <!HIDDEN!>PO<!>
val po = <!INVISIBLE_REFERENCE!>PO<!>
}
class B : <!EXPOSED_SUPER_CLASS, HIDDEN!>A<!>() {}
class B : <!EXPOSED_SUPER_CLASS, INVISIBLE_REFERENCE!>A<!>() {}
class Q {
class W {