FIR IDE: handle reference to package and outer classes
For a qualified name like `foo.bar.Outer.Inner`, FIR represents it as one atomic FIR element. Hence, to properly resolve these names to the corresponding package and class, we need some additional work.
This commit is contained in:
committed by
Ilya Kirillov
parent
a537074e1e
commit
84f8d4d315
@@ -1,3 +1,4 @@
|
||||
// FIR_COMPARISON
|
||||
// PSI_ELEMENT: org.jetbrains.kotlin.psi.KtObjectDeclaration
|
||||
// OPTIONS: usages
|
||||
class Foo {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_COMPARISON
|
||||
// PSI_ELEMENT: org.jetbrains.kotlin.psi.KtObjectDeclaration
|
||||
// OPTIONS: usages
|
||||
class Foo {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_COMPARISON
|
||||
// PSI_ELEMENT: org.jetbrains.kotlin.psi.KtObjectDeclaration
|
||||
// OPTIONS: usages
|
||||
fun foo(): Any {
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
Value read 6 return Bar
|
||||
Value read 7 return Bar
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_COMPARISON
|
||||
// PSI_ELEMENT: org.jetbrains.kotlin.psi.KtObjectDeclaration
|
||||
// OPTIONS: usages
|
||||
fun foo(): Any {
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
Value read 7 return Bar
|
||||
Value read 8 return Bar
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// IGNORE_FIR
|
||||
|
||||
package test
|
||||
|
||||
class Conflict
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// IGNORE_FIR
|
||||
package test
|
||||
|
||||
object Conflict
|
||||
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
package foo.bar.baz
|
||||
|
||||
class AA {
|
||||
class BB {
|
||||
companion object
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val b = f<caret>oo.bar.baz.AA.BB
|
||||
}
|
||||
|
||||
// REF: foo
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// IGNORE_FIR
|
||||
package foo.bar.baz
|
||||
|
||||
class AA {
|
||||
class BB {
|
||||
companion object
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val b = foo.bar.baz.AA.B<caret>B
|
||||
}
|
||||
|
||||
// REF: companion object of (in foo.bar.baz.AA).BB
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
package foo.bar.baz
|
||||
|
||||
class AA {
|
||||
class BB {
|
||||
companion object
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val b = foo.bar.baz.A<caret>A.BB
|
||||
}
|
||||
|
||||
// REF: (foo.bar.baz).AA
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
package foo.bar.baz
|
||||
|
||||
class AA {
|
||||
class BB {
|
||||
companion object
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val b = foo.bar.b<caret>az.AA.BB
|
||||
}
|
||||
|
||||
// REF: baz
|
||||
@@ -0,0 +1,11 @@
|
||||
package foo.bar.baz
|
||||
|
||||
class AA {
|
||||
fun foo() {}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
A<caret>A::foo
|
||||
}
|
||||
|
||||
// REF: (foo.bar.baz).AA
|
||||
@@ -0,0 +1,14 @@
|
||||
// IGNORE_FE10
|
||||
package foo.bar.baz
|
||||
|
||||
class AA {
|
||||
companion object {
|
||||
fun foo() {}
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
A<caret>A::foo // FE1.0 won't resolve this
|
||||
}
|
||||
|
||||
// REF: companion object of (foo.bar.baz).AA
|
||||
@@ -0,0 +1,14 @@
|
||||
// IGNORE_FE10
|
||||
package foo.bar.baz
|
||||
|
||||
class AA {
|
||||
companion object
|
||||
}
|
||||
|
||||
fun AA.Companion.foo() {}
|
||||
|
||||
fun test() {
|
||||
A<caret>A::foo // FE1.0 won't resolve this
|
||||
}
|
||||
|
||||
// REF: companion object of (foo.bar.baz).AA
|
||||
Reference in New Issue
Block a user