Resolve invisible references and mark them 'invisible' instead of mark them 'unresolved'

This commit is contained in:
Svetlana Isakova
2012-04-05 18:36:36 +04:00
parent aa568a3ceb
commit 7863b1398e
13 changed files with 139 additions and 84 deletions
@@ -11,6 +11,6 @@ class C() {
fun box(): String {
val c = C()
if (c.<!UNRESOLVED_REFERENCE!>f<!> != 610) return "fail"
if (c.<!INVISIBLE_MEMBER!>f<!> != 610) return "fail"
return "OK"
}
@@ -35,8 +35,8 @@ class B {
}
fun test3(a: A) {
a.<!UNRESOLVED_REFERENCE!>v<!> //todo .bMethod()
a.<!UNRESOLVED_REFERENCE!>f<!>(0, 1) //todo .bMethod()
a.<!INVISIBLE_MEMBER!>v<!> //todo .bMethod()
a.<!INVISIBLE_MEMBER!>f<!>(0, 1) //todo .bMethod()
}
trait T
@@ -49,7 +49,7 @@ open class C : T {
}
fun test4(c: C) {
c.<!UNRESOLVED_REFERENCE!>i<!>++
c.<!INVISIBLE_MEMBER!>i<!>++
}
class D : C() {
@@ -73,7 +73,7 @@ class F : C() {
class G : T {
fun test8(c: C) {
doSmth(c.<!UNRESOLVED_REFERENCE!>i<!>)
doSmth(c.<!INVISIBLE_MEMBER!>i<!>)
}
}
@@ -86,5 +86,5 @@ import test_visibility.*
fun test() {
internal_fun()
<!UNRESOLVED_REFERENCE!>private_fun<!>()
}
<!INVISIBLE_MEMBER!>private_fun<!>()
}
@@ -15,20 +15,23 @@ private object PO {}
//+JDK
package b
import a.*
import a.<!INVISIBLE_REFERENCE!>A<!>
import a.<!INVISIBLE_REFERENCE!>foo<!>
import a.makeA
import a.<!INVISIBLE_REFERENCE!>PO<!>
fun test() {
val y = makeA()
y.<!UNRESOLVED_REFERENCE!>bar<!>()
<!UNRESOLVED_REFERENCE!>foo<!>()
y.<!INVISIBLE_MEMBER!>bar<!>()
<!INVISIBLE_MEMBER!>foo<!>()
val <!UNUSED_VARIABLE!>u<!> : <!INVISIBLE_MEMBER!>A<!> = <!UNRESOLVED_REFERENCE!>A<!>()
val <!UNUSED_VARIABLE!>a<!> : java.util.Arrays.<!INVISIBLE_MEMBER!>ArrayList<!><Int>;
val <!UNUSED_VARIABLE!>u<!> : <!INVISIBLE_REFERENCE!>A<!> = <!INVISIBLE_MEMBER!>A<!>()
val <!UNUSED_VARIABLE!>a<!> : java.util.Arrays.<!INVISIBLE_REFERENCE!>ArrayList<!><Int>;
val <!UNUSED_VARIABLE!>po<!> = <!UNRESOLVED_REFERENCE!>PO<!>()
val <!UNUSED_VARIABLE!>po<!> = <!INVISIBLE_MEMBER!>PO<!>
}
class B : <!INVISIBLE_MEMBER!>A<!>() {}
class B : <!INVISIBLE_REFERENCE, INVISIBLE_MEMBER!>A<!>() {}
class Q {
class W {
@@ -41,4 +44,4 @@ class Q {
//check that 'toString' can be invoked without specifying return type
class NewClass : java.util.ArrayList<Integer>() {
public override fun toString() = "a"
}
}