AA: add tests about resolution to Java static method
This commit is contained in:
committed by
Ilya Kirillov
parent
13b9fed488
commit
881a6bed35
+6
@@ -286,6 +286,12 @@ public class FirLibrarySourceReferenceResolveTestGenerated extends AbstractRefer
|
|||||||
runTest("analysis/analysis-api/testData/referenceResolve/JavaReference.kt");
|
runTest("analysis/analysis-api/testData/referenceResolve/JavaReference.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("JavaStaticMethod.kt")
|
||||||
|
public void testJavaStaticMethod() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/referenceResolve/JavaStaticMethod.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("KotlinPropertyAssignment.kt")
|
@TestMetadata("KotlinPropertyAssignment.kt")
|
||||||
public void testKotlinPropertyAssignment() throws Exception {
|
public void testKotlinPropertyAssignment() throws Exception {
|
||||||
|
|||||||
+6
@@ -286,6 +286,12 @@ public class FirSourceReferenceResolveTestGenerated extends AbstractReferenceRes
|
|||||||
runTest("analysis/analysis-api/testData/referenceResolve/JavaReference.kt");
|
runTest("analysis/analysis-api/testData/referenceResolve/JavaReference.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("JavaStaticMethod.kt")
|
||||||
|
public void testJavaStaticMethod() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/referenceResolve/JavaStaticMethod.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("KotlinPropertyAssignment.kt")
|
@TestMetadata("KotlinPropertyAssignment.kt")
|
||||||
public void testKotlinPropertyAssignment() throws Exception {
|
public void testKotlinPropertyAssignment() throws Exception {
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
// FILE: pkg/Foo.java
|
||||||
|
|
||||||
|
package pkg;
|
||||||
|
|
||||||
|
public class Foo {
|
||||||
|
public static void bar() {
|
||||||
|
System.out.println("Foo.bar()");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: main.kt
|
||||||
|
import pkg.Foo
|
||||||
|
|
||||||
|
fun box() {
|
||||||
|
// NB: if we put bar<caret>(), LPAR, value arguments, function call, containing function and file will be visited in order.
|
||||||
|
// Among them, only function call can be converted to [KtReference], and the corresponding form is [KtInvokeFunctionReference],
|
||||||
|
// whose resolution picks implicit invoke() only, hence failed. That is expected for reference resolution with both FE1.0 and FIR.
|
||||||
|
// In reality, i.e., in IDE, users will click the part of function call "name", which results in simple name reference instead.
|
||||||
|
Foo.ba<caret>r()
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
Resolved to:
|
||||||
|
0: (in pkg.Foo) open fun bar()
|
||||||
Reference in New Issue
Block a user