[FIR] Reproduce #KT-58939
This commit is contained in:
committed by
Space Team
parent
cf2ef443f4
commit
bc602b3827
+6
@@ -4941,6 +4941,12 @@ public class DiagnosticCompilerTestFirTestdataTestGenerated extends AbstractDiag
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolve/unqualifiedEnum/correctJava.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolve/unqualifiedEnum/correctJava.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("enumWithTheSameNameAsEntry.kt")
|
||||||
|
public void testEnumWithTheSameNameAsEntry() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolve/unqualifiedEnum/enumWithTheSameNameAsEntry.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("incorrectJava.kt")
|
@TestMetadata("incorrectJava.kt")
|
||||||
public void testIncorrectJava() throws Exception {
|
public void testIncorrectJava() throws Exception {
|
||||||
|
|||||||
+6
@@ -4941,6 +4941,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFirTestDataTestGenerated
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolve/unqualifiedEnum/correctJava.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolve/unqualifiedEnum/correctJava.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("enumWithTheSameNameAsEntry.kt")
|
||||||
|
public void testEnumWithTheSameNameAsEntry() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolve/unqualifiedEnum/enumWithTheSameNameAsEntry.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("incorrectJava.kt")
|
@TestMetadata("incorrectJava.kt")
|
||||||
public void testIncorrectJava() throws Exception {
|
public void testIncorrectJava() throws Exception {
|
||||||
|
|||||||
+5
@@ -4400,6 +4400,11 @@ public class LazyBodyIsNotTouchedTestGenerated extends AbstractLazyBodyIsNotTouc
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolve/unqualifiedEnum/correctJava.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolve/unqualifiedEnum/correctJava.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("enumWithTheSameNameAsEntry.kt")
|
||||||
|
public void testEnumWithTheSameNameAsEntry() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolve/unqualifiedEnum/enumWithTheSameNameAsEntry.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("incorrectJava.kt")
|
@TestMetadata("incorrectJava.kt")
|
||||||
public void testIncorrectJava() throws Exception {
|
public void testIncorrectJava() throws Exception {
|
||||||
runTest("compiler/fir/analysis-tests/testData/resolve/unqualifiedEnum/incorrectJava.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolve/unqualifiedEnum/incorrectJava.kt");
|
||||||
|
|||||||
Vendored
+29
@@ -0,0 +1,29 @@
|
|||||||
|
FILE: enumWithTheSameNameAsEntry.kt
|
||||||
|
public final enum class A : R|kotlin/Enum<A>| {
|
||||||
|
private constructor(): R|A| {
|
||||||
|
super<R|kotlin/Enum<A>|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
public final static enum entry A: R|A|
|
||||||
|
public final static enum entry B: R|A|
|
||||||
|
public final static fun values(): R|kotlin/Array<A>| {
|
||||||
|
}
|
||||||
|
|
||||||
|
public final static fun valueOf(value: R|kotlin/String|): R|A| {
|
||||||
|
}
|
||||||
|
|
||||||
|
public final static val entries: R|kotlin/enums/EnumEntries<A>|
|
||||||
|
public get(): R|kotlin/enums/EnumEntries<A>|
|
||||||
|
|
||||||
|
}
|
||||||
|
public final fun test(a: R|A|): R|kotlin/Unit| {
|
||||||
|
^test when (R|<local>/a|) {
|
||||||
|
==($subj$, R|/A.A|.<Unresolved name: A>#) -> {
|
||||||
|
String(A)
|
||||||
|
}
|
||||||
|
==($subj$, R|/A.A|.<Unresolved name: B>#) -> {
|
||||||
|
String(B)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
// LANGUAGE: +ContextSensitiveEnumResolutionInWhen
|
||||||
|
// KT-58939
|
||||||
|
|
||||||
|
enum class A {
|
||||||
|
A,
|
||||||
|
B,
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test(a: A) = <!NO_ELSE_IN_WHEN!>when<!> (a) {
|
||||||
|
A.<!UNRESOLVED_REFERENCE!>A<!> -> "A"
|
||||||
|
A.<!UNRESOLVED_REFERENCE!>B<!> -> "B"
|
||||||
|
}
|
||||||
+6
@@ -4941,6 +4941,12 @@ public class FirLightTreeDiagnosticsTestGenerated extends AbstractFirLightTreeDi
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolve/unqualifiedEnum/correctJava.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolve/unqualifiedEnum/correctJava.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("enumWithTheSameNameAsEntry.kt")
|
||||||
|
public void testEnumWithTheSameNameAsEntry() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolve/unqualifiedEnum/enumWithTheSameNameAsEntry.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("incorrectJava.kt")
|
@TestMetadata("incorrectJava.kt")
|
||||||
public void testIncorrectJava() throws Exception {
|
public void testIncorrectJava() throws Exception {
|
||||||
|
|||||||
+6
@@ -4941,6 +4941,12 @@ public class FirPsiDiagnosticTestGenerated extends AbstractFirPsiDiagnosticTest
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolve/unqualifiedEnum/correctJava.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolve/unqualifiedEnum/correctJava.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("enumWithTheSameNameAsEntry.kt")
|
||||||
|
public void testEnumWithTheSameNameAsEntry() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolve/unqualifiedEnum/enumWithTheSameNameAsEntry.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("incorrectJava.kt")
|
@TestMetadata("incorrectJava.kt")
|
||||||
public void testIncorrectJava() throws Exception {
|
public void testIncorrectJava() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user