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
@@ -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
//----------------------------------------------------------------------------------