[LL FIR, Java] fix resolve contract violation from java symbol provider from supertypes
To create a smart psi type pointer, IJ Platform uses resolve We cannot use resolve from JavaSymbolProvider, as it may lead to resolve contract violation ^KT-59240 Fixed
This commit is contained in:
committed by
Space Team
parent
67d933185a
commit
6992a707dc
+10
@@ -30,6 +30,16 @@ public class LazyBodyIsNotTouchedTestGenerated extends AbstractLazyBodyIsNotTouc
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/accessJavaFromKotlinViaImport.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("accessJavaFromKotlinViaStaticImport.kt")
|
||||
public void testAccessJavaFromKotlinViaStaticImport() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/accessJavaFromKotlinViaStaticImport.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("accessJavaFromKotlinViaStaticImport2.kt")
|
||||
public void testAccessJavaFromKotlinViaStaticImport2() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/accessJavaFromKotlinViaStaticImport2.kt");
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInResolve() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
FILE: useSite.kt
|
||||
public final fun foo(): R|kotlin/Int| {
|
||||
^foo Int(4)
|
||||
}
|
||||
FILE: KotlinInterface.kt
|
||||
public abstract interface KotlinInterface : R|kotlin/Any| {
|
||||
public abstract var selectedOptions: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int|
|
||||
public set(value: R|kotlin/Int|): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
// FILE: useSite.kt
|
||||
|
||||
import InspectionProfileImpl.INIT_INSPECTIONS
|
||||
|
||||
fun foo(): Int = 4
|
||||
|
||||
// FILE: InspectionProfileImpl.java
|
||||
import static Configuration.StaticConfigurationClass
|
||||
|
||||
public class InspectionProfileImpl extends StaticConfigurationClass {
|
||||
public static boolean INIT_INSPECTIONS;
|
||||
}
|
||||
|
||||
// FILE: Configuration.java
|
||||
public class Configuration implements KotlinInterface {
|
||||
public static class StaticConfigurationClass {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: KotlinInterface.kt
|
||||
interface KotlinInterface {
|
||||
var selectedOptions: Int
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
FILE: useSite.kt
|
||||
public final fun foo(): R|kotlin/Int| {
|
||||
^foo Int(4)
|
||||
}
|
||||
FILE: KotlinInterface.kt
|
||||
public abstract interface KotlinInterface : R|kotlin/Any| {
|
||||
public abstract var selectedOptions: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int|
|
||||
public set(value: R|kotlin/Int|): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
// FILE: useSite.kt
|
||||
|
||||
import InspectionProfileImpl.INIT_INSPECTIONS
|
||||
|
||||
fun foo(): Int = 4
|
||||
|
||||
// FILE: InspectionProfileImpl.java
|
||||
import static Configuration.StaticConfigurationClass
|
||||
|
||||
public class InspectionProfileImpl extends InspectionProfile<StaticConfigurationClass> {
|
||||
public static boolean INIT_INSPECTIONS;
|
||||
}
|
||||
|
||||
// FILE: InspectionProfile.java
|
||||
public class InspectionProfile <T> {
|
||||
}
|
||||
|
||||
// FILE: Configuration.java
|
||||
public class Configuration implements KotlinInterface {
|
||||
public static class StaticConfigurationClass {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: KotlinInterface.kt
|
||||
interface KotlinInterface {
|
||||
var selectedOptions: Int
|
||||
}
|
||||
+12
@@ -27,6 +27,18 @@ public class FirLightTreeDiagnosticsTestGenerated extends AbstractFirLightTreeDi
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/accessJavaFromKotlinViaImport.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("accessJavaFromKotlinViaStaticImport.kt")
|
||||
public void testAccessJavaFromKotlinViaStaticImport() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/accessJavaFromKotlinViaStaticImport.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("accessJavaFromKotlinViaStaticImport2.kt")
|
||||
public void testAccessJavaFromKotlinViaStaticImport2() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/accessJavaFromKotlinViaStaticImport2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAllFilesPresentInResolve() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
|
||||
+12
@@ -27,6 +27,18 @@ public class FirPsiDiagnosticTestGenerated extends AbstractFirPsiDiagnosticTest
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/accessJavaFromKotlinViaImport.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("accessJavaFromKotlinViaStaticImport.kt")
|
||||
public void testAccessJavaFromKotlinViaStaticImport() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/accessJavaFromKotlinViaStaticImport.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("accessJavaFromKotlinViaStaticImport2.kt")
|
||||
public void testAccessJavaFromKotlinViaStaticImport2() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/accessJavaFromKotlinViaStaticImport2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAllFilesPresentInResolve() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
|
||||
Reference in New Issue
Block a user