Importing root scope without members.

This commit is contained in:
Evgeny Gerashchenko
2014-01-15 21:05:37 +04:00
parent 78e7cbb7fb
commit ae4c68830d
61 changed files with 316 additions and 89 deletions
@@ -4,8 +4,6 @@ public enum A {
}
// FILE: test.kt
package test
fun main() {
A.valueOf("ENTRY"): A
}
@@ -5,8 +5,6 @@ public enum A {
}
// FILE: test.kt
package vvv
fun main() {
A.values(): Array<A>
}
@@ -10,8 +10,6 @@ public enum A {
}
// FILE: test.kt
package test
fun main() {
A.ENTRY.s(): String?
}
@@ -10,8 +10,6 @@ public enum A {
// FILE: test.kt
package vvv
fun main() {
val c = A.ENTRY
c.s()
@@ -8,8 +8,6 @@ public enum A {
// FILE: test.kt
package vvv
fun main() {
val c: A = A.ENTRY
val <!UNUSED_VARIABLE!>c2<!>: String? = c.ENTRY
@@ -12,8 +12,6 @@ public enum A {
// FILE: test.kt
package vvv
fun main() {
val c = A.ENTRY
c.s
@@ -1,12 +1,12 @@
// FILE: checkAmbiguityBetweenRootAndPackage.kt
package test
val t = <!OVERLOAD_RESOLUTION_AMBIGUITY!>testFun<!>()
// FILE: checkAmbiguityBetweenRootAndPackageRoot.kt
// FILE: root.kt
fun testFun() = 12
// FILE: checkAmbiguityBetweenRootAndPackageTest.kt
// FILE: otherPackage.kt
package test
fun testFun() = 12
fun testFun() = 12
// FILE: using.kt
import test.*
val t = <!OVERLOAD_RESOLUTION_AMBIGUITY!>testFun<!>()
@@ -0,0 +1,12 @@
// FILE: root.kt
fun testFun() = 12
// FILE: otherPackage.kt
package test
fun testFun() = 12
// FILE: using.kt
package test
val t = testFun()
@@ -0,0 +1,25 @@
// FILE: rootPackage.kt
class Klass {
}
fun function() = ""
val property = ""
// FILE: anotherFromRootPackage.kt
fun foo() {
Klass()
function() + property
}
// FILE: anotherFromRootPackage.kt
package pkg
import <!UNRESOLVED_REFERENCE!>Klass<!>
import <!UNRESOLVED_REFERENCE!>function<!>
import <!UNRESOLVED_REFERENCE!>property<!>
fun foo() {
<!UNRESOLVED_REFERENCE!>Klass<!>()
<!UNRESOLVED_REFERENCE!>function<!>() <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>+<!> <!UNRESOLVED_REFERENCE!>property<!>
}
@@ -0,0 +1,28 @@
// FILE: rootPackage.kt
class ~k~Klass {
}
fun ~f~function() = ""
val ~p~property = ""
// FILE: anotherFromRootPackage.kt
fun foo() {
`k`Klass()
`f`function()
`p`property
}
// FILE: otherPackage.kt
package test
import `!`Klass
import `!`function
import `!`property
fun foo() {
`!`Klass()
`!`function()
`!`property
}
@@ -0,0 +1,29 @@
// FILE: base.kt
class java {
class lang {
class ~Fake~Fake()
}
}
// FILE: root1.kt
import java.lang.* // will import Fake
fun foo() {
`Fake`Fake()
}
// FILE: root2.kt
fun foo() {
`!`Fake() // not imported within "java.lang.*" default import
java.lang.`Fake`Fake() // we all are in same (root) package, so it works
}
// FILE: nonRoot.kt
package nonRoot
import java.lang.* // will not import Fake
fun foo() {
`!`Fake()
java.lang.`!`Fake() // qualification doesn't help, because we are in other package
}
@@ -4,7 +4,7 @@ package test
import testing.*
val a1: `fromRoot`TestClass? = null
val a1: `fromOtherPackage`TestClass? = null
//FILE:fromRoot.kt
//----------------------------------------------------------------------------------