K2 IC: fix class members lookups recording
in particular - statics #KTIJ-24830 fixed
This commit is contained in:
committed by
Space Team
parent
1989e8f094
commit
fe4e0e9c2e
+5
-1
@@ -17,8 +17,12 @@ import org.jetbrains.kotlin.fir.symbols.impl.*
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.name.SpecialNames
|
||||
import org.jetbrains.kotlin.utils.SmartList
|
||||
|
||||
abstract class FirClassDeclaredMemberScope(val classId: ClassId) : FirContainingNamesAwareScope()
|
||||
abstract class FirClassDeclaredMemberScope(val classId: ClassId) : FirContainingNamesAwareScope() {
|
||||
|
||||
override val scopeOwnerLookupNames: List<String> = SmartList(classId.asFqNameString())
|
||||
}
|
||||
|
||||
class FirClassDeclaredMemberScopeImpl(
|
||||
val useSiteSession: FirSession,
|
||||
|
||||
@@ -45,4 +45,7 @@ class FirStaticScope(private val delegateScope: FirContainingNamesAwareScope) :
|
||||
override fun getClassifierNames(): Set<Name> {
|
||||
return delegateScope.getClassifierNames()
|
||||
}
|
||||
|
||||
override val scopeOwnerLookupNames: List<String>
|
||||
get() = delegateScope.scopeOwnerLookupNames
|
||||
}
|
||||
|
||||
Generated
+5
@@ -49,6 +49,11 @@ public class JvmLookupTrackerTestGenerated extends AbstractJvmLookupTrackerTest
|
||||
runTest("jps/jps-plugin/testData/incremental/lookupTracker/jvm/java/");
|
||||
}
|
||||
|
||||
@TestMetadata("javaStatics")
|
||||
public void testJavaStatics() {
|
||||
runTest("jps/jps-plugin/testData/incremental/lookupTracker/jvm/javaStatics/");
|
||||
}
|
||||
|
||||
@TestMetadata("jvmNameChanged")
|
||||
public void testJvmNameChanged() {
|
||||
runTest("jps/jps-plugin/testData/incremental/lookupTracker/jvm/jvmNameChanged/");
|
||||
|
||||
Generated
+5
@@ -49,6 +49,11 @@ public class K1JvmLookupTrackerTestGenerated extends AbstractK1JvmLookupTrackerT
|
||||
runTest("jps/jps-plugin/testData/incremental/lookupTracker/jvm/java/");
|
||||
}
|
||||
|
||||
@TestMetadata("javaStatics")
|
||||
public void testJavaStatics() {
|
||||
runTest("jps/jps-plugin/testData/incremental/lookupTracker/jvm/javaStatics/");
|
||||
}
|
||||
|
||||
@TestMetadata("jvmNameChanged")
|
||||
public void testJvmNameChanged() {
|
||||
runTest("jps/jps-plugin/testData/incremental/lookupTracker/jvm/jvmNameChanged/");
|
||||
|
||||
+5
-5
@@ -29,11 +29,11 @@ import bar.*
|
||||
val iii = /*p:bar(bar) p:foo p:foo(I) p:foo(bar) p:foo.Obj(bar)*/Obj.bar()
|
||||
/*p:foo.I(foo)*/iii.foo()
|
||||
|
||||
/*p:bar p:foo*/E.X
|
||||
/*p:bar p:foo p:foo.E(a)*/E.X.a
|
||||
/*p:bar p:foo p:foo.E(foo)*/E.Y.foo()
|
||||
/*p:bar p:foo p:kotlin(Array)*/E.values()
|
||||
/*p:bar p:foo*/E.valueOf("")
|
||||
/*p:bar p:foo p:foo.E(X)*/E.X
|
||||
/*p:bar p:foo p:foo.E(X) p:foo.E(a)*/E.X.a
|
||||
/*p:bar p:foo p:foo.E(Y) p:foo.E(foo)*/E.Y.foo()
|
||||
/*p:bar p:foo p:foo.E(values) p:kotlin(Array)*/E.values()
|
||||
/*p:bar p:foo p:foo.E(valueOf)*/E.valueOf("")
|
||||
}
|
||||
|
||||
/*p:foo*/fun classifiers(
|
||||
|
||||
+7
-7
@@ -31,13 +31,13 @@ import bar.*
|
||||
val iii = /*p:bar(bar) p:foo p:foo(I) p:foo(bar) p:foo.Obj(bar)*/Obj.bar()
|
||||
/*p:foo.I(foo)*/iii.foo()
|
||||
|
||||
/*p:bar p:foo*/E.X
|
||||
/*p:bar p:foo p:foo.E(a)*/E.X.a
|
||||
/*p:bar p:foo p:foo.E(foo)*/E.Y.foo()
|
||||
/*p:bar p:foo p:kotlin(Array)*/E.values()
|
||||
/*p:bar p:foo*/E.valueOf("")
|
||||
/*p:bar p:bar(foo) p:foo p:foo(foo)*/E.foo
|
||||
/*p:bar p:bar(bar) p:foo p:foo(bar)*/E.bar()
|
||||
/*p:bar p:foo p:foo.E(X)*/E.X
|
||||
/*p:bar p:foo p:foo.E(X) p:foo.E(a)*/E.X.a
|
||||
/*p:bar p:foo p:foo.E(Y) p:foo.E(foo)*/E.Y.foo()
|
||||
/*p:bar p:foo p:foo.E(values) p:kotlin(Array)*/E.values()
|
||||
/*p:bar p:foo p:foo.E(valueOf)*/E.valueOf("")
|
||||
/*p:bar p:bar(foo) p:foo p:foo(foo) p:foo.E(foo)*/E.foo
|
||||
/*p:bar p:bar(bar) p:foo p:foo(bar) p:foo.E(bar)*/E.bar()
|
||||
}
|
||||
|
||||
/*p:foo*/fun classifiers(
|
||||
|
||||
@@ -6,8 +6,8 @@ package foo
|
||||
/*p:bar(foo) p:bar.C(foo) p:foo(foo)*/c.foo()
|
||||
/*p:bar(SAMInterface) p:bar.C(foo) p:bar/SAMInterface(<SAM-CONSTRUCTOR>)*/c.foo /*p:kotlin(Function1)*/{ }
|
||||
|
||||
/*p:bar p:bar(bar) p:foo p:foo(bar)*/C.bar()
|
||||
/*p:bar p:bar(SAMInterface) p:bar/SAMInterface(<SAM-CONSTRUCTOR>) p:foo*/C.bar /*p:kotlin(Function1)*/{}
|
||||
/*p:bar p:bar(bar) p:bar.C(bar) p:foo p:foo(bar)*/C.bar()
|
||||
/*p:bar p:bar(SAMInterface) p:bar.C(bar) p:bar/SAMInterface(<SAM-CONSTRUCTOR>) p:foo*/C.bar /*p:kotlin(Function1)*/{}
|
||||
|
||||
/*p:bar p:foo*/SAMInterface()
|
||||
/*p:bar*/SAMInterface /*p:kotlin(Function1)*/{}
|
||||
|
||||
+5
-5
@@ -29,11 +29,11 @@ import bar.*
|
||||
val iii = /*p:bar(bar) p:foo p:foo(I) p:foo(bar) p:foo.Obj(bar)*/Obj.bar()
|
||||
/*p:foo.I(foo)*/iii.foo()
|
||||
|
||||
/*p:bar p:foo*/E.X
|
||||
/*p:bar p:foo p:foo.E(a)*/E.X.a
|
||||
/*p:bar p:foo p:foo.E(foo)*/E.Y.foo()
|
||||
/*p:bar p:foo p:kotlin(Array)*/E.values()
|
||||
/*p:bar p:foo*/E.valueOf("")
|
||||
/*p:bar p:foo p:foo.E(X)*/E.X
|
||||
/*p:bar p:foo p:foo.E(X) p:foo.E(a)*/E.X.a
|
||||
/*p:bar p:foo p:foo.E(Y) p:foo.E(foo)*/E.Y.foo()
|
||||
/*p:bar p:foo p:foo.E(values) p:kotlin(Array)*/E.values()
|
||||
/*p:bar p:foo p:foo.E(valueOf)*/E.valueOf("")
|
||||
}
|
||||
|
||||
/*p:foo*/fun classifiers(
|
||||
|
||||
+7
-7
@@ -31,13 +31,13 @@ import bar.*
|
||||
val iii = /*p:bar(bar) p:foo p:foo(I) p:foo(bar) p:foo.Obj(bar)*/Obj.bar()
|
||||
/*p:foo.I(foo)*/iii.foo()
|
||||
|
||||
/*p:bar p:foo*/E.X
|
||||
/*p:bar p:foo p:foo.E(a)*/E.X.a
|
||||
/*p:bar p:foo p:foo.E(foo)*/E.Y.foo()
|
||||
/*p:bar p:foo p:kotlin(Array)*/E.values()
|
||||
/*p:bar p:foo*/E.valueOf("")
|
||||
/*p:bar p:bar(foo) p:foo p:foo(foo)*/E.foo
|
||||
/*p:bar p:bar(bar) p:foo p:foo(bar)*/E.bar()
|
||||
/*p:bar p:foo p:foo.E(X)*/E.X
|
||||
/*p:bar p:foo p:foo.E(X) p:foo.E(a)*/E.X.a
|
||||
/*p:bar p:foo p:foo.E(Y) p:foo.E(foo)*/E.Y.foo()
|
||||
/*p:bar p:foo p:foo.E(values) p:kotlin(Array)*/E.values()
|
||||
/*p:bar p:foo p:foo.E(valueOf)*/E.valueOf("")
|
||||
/*p:bar p:bar(foo) p:foo p:foo(foo) p:foo.E(foo)*/E.foo
|
||||
/*p:bar p:bar(bar) p:foo p:foo(bar) p:foo.E(bar)*/E.bar()
|
||||
}
|
||||
|
||||
/*p:foo*/fun classifiers(
|
||||
|
||||
@@ -11,27 +11,27 @@ import baz.*
|
||||
/*p:bar.C(func)*/c.func()
|
||||
/*p:bar(B) p:bar.C(B) p:bar.C.B(B)*/c.B()
|
||||
|
||||
/*p:bar p:baz p:foo*/C.sfield
|
||||
/*p:bar p:baz p:foo*/C.sfield = "new"
|
||||
/*p:bar p:baz p:foo*/C.sfunc()
|
||||
/*p:bar p:bar(S) p:baz p:foo*/C.S()
|
||||
/*p:bar p:bar.C(sfield) p:baz p:foo*/C.sfield
|
||||
/*p:bar p:bar.C(sfield) p:baz p:foo*/C.sfield = "new"
|
||||
/*p:bar p:bar.C(sfunc) p:baz p:foo*/C.sfunc()
|
||||
/*p:bar p:bar(S) p:bar.C(S) p:baz p:foo*/C.S()
|
||||
|
||||
// inherited from I
|
||||
/*p:bar.C(ifunc)*/c.ifunc()
|
||||
/*p:bar p:baz p:foo*/C.isfield
|
||||
/*p:bar p:bar.C(isfield) p:baz p:foo*/C.isfield
|
||||
// expected error: Unresolved reference: IS
|
||||
/*p:bar p:bar(IS) p:baz p:baz(IS) p:foo p:foo(IS)*/C.IS()
|
||||
/*p:bar p:bar(IS) p:bar.C(IS) p:baz p:baz(IS) p:foo p:foo(IS)*/C.IS()
|
||||
|
||||
|
||||
val i: /*p:bar p:baz p:foo*/I = c
|
||||
/*p:foo.I(ifunc)*/i.ifunc()
|
||||
|
||||
/*p:bar p:baz p:foo*/I.isfield
|
||||
/*p:bar p:baz p:foo p:foo(IS)*/I.IS()
|
||||
/*p:bar p:baz p:foo p:foo.I(isfield)*/I.isfield
|
||||
/*p:bar p:baz p:foo p:foo(IS) p:foo.I(IS)*/I.IS()
|
||||
|
||||
/*p:bar p:baz p:foo*/E.F
|
||||
/*p:bar p:baz p:baz.E(field) p:foo*/E.F.field
|
||||
/*p:bar p:baz p:baz.E(func) p:foo*/E.S.func()
|
||||
/*p:bar p:baz p:baz.E(F) p:foo*/E.F
|
||||
/*p:bar p:baz p:baz.E(F) p:baz.E(field) p:foo*/E.F.field
|
||||
/*p:bar p:baz p:baz.E(S) p:baz.E(func) p:foo*/E.S.func()
|
||||
}
|
||||
|
||||
fun classifiers(
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
public class Main {
|
||||
public static void staticMethod() {}
|
||||
public static String staticField = "";
|
||||
public void regularMethod() {}
|
||||
public String regularField = "";
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
==== INITIAL BUILD ====
|
||||
Compiling files:
|
||||
src/kotlinUsage.kt
|
||||
Exit code: OK
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
/*p:<root>*/fun kotlinUsage() {
|
||||
/*p:<root> p:java.lang p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.jvm p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Main./*p:Main*/staticMethod()
|
||||
val s = /*p:<root> p:java.lang p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.jvm p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Main./*p:Main*/staticField
|
||||
/*p:<root>*/Main()./*p:Main*/regularMethod()
|
||||
val r = /*p:<root>*/Main()./*p:Main*/regularField
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
/*p:<root>*/fun kotlinUsage() {
|
||||
/*p:<root> p:Main(staticMethod)*/Main.staticMethod()
|
||||
/*p:<root> p:Main(regularMethod)*/Main().regularMethod()
|
||||
val s = /*p:<root> p:Main(staticField)*/Main.staticField
|
||||
val r = /*p:<root> p:Main(regularField)*/Main().regularField
|
||||
}
|
||||
Reference in New Issue
Block a user