KT-19154: Fix auto-import to check receiver for members properly

#KT-19154 fixed
This commit is contained in:
Simon Ogorodnik
2017-07-21 19:38:54 +03:00
parent f313001b2d
commit 094125c970
10 changed files with 141 additions and 26 deletions
+13
View File
@@ -0,0 +1,13 @@
import BExtSpace.aaa
// "Import" "true"
// WITH_RUNTIME
// ERROR: Unresolved reference: aaa
fun test() {
AAA().apply {
sub {
aaa<caret>()
}
}
}
@@ -0,0 +1,25 @@
@DslMarker
annotation class DSL
@DSL
class AAA {
fun sub(l: BBB.() -> Unit) {
l(BBB())
}
}
@DSL
class BBB
object AExtSpace {
fun AAA.aaa() {
}
}
object BExtSpace {
fun BBB.aaa() {
}
}
@@ -0,0 +1,11 @@
// "Import" "true"
// WITH_RUNTIME
// ERROR: Unresolved reference: aaa
fun test() {
AAA().apply {
sub {
aaa<caret>()
}
}
}
@@ -0,0 +1,11 @@
// "Import" "true"
// ERROR: Unresolved reference: foobar
package p2
import p1.Some.foobar
class A {
fun some() {
foobar<caret>()
}
}
@@ -0,0 +1,5 @@
package p1
object Some {
fun foobar() {}
}
@@ -0,0 +1,9 @@
// "Import" "true"
// ERROR: Unresolved reference: foobar
package p2
class A {
fun some() {
foobar<caret>()
}
}