[Test] Add test for Enum.entries shadowing when property is imported
This is similar to KT-64488 but without context receivers. Warning message "access ... from within the enum" is also incorrect here. ^KT-64488
This commit is contained in:
committed by
Space Team
parent
e83d2e31d4
commit
34d87465ac
+6
@@ -12825,6 +12825,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
||||
runTest("compiler/testData/diagnostics/tests/enum/entries/entriesPropertyAsExtensionClashPrioritized.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("entriesPropertyImport.kt")
|
||||
public void testEntriesPropertyImport() {
|
||||
runTest("compiler/testData/diagnostics/tests/enum/entries/entriesPropertyImport.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("entriesPropertyImportedClash.kt")
|
||||
public void testEntriesPropertyImportedClash() {
|
||||
|
||||
+6
@@ -12825,6 +12825,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
||||
runTest("compiler/testData/diagnostics/tests/enum/entries/entriesPropertyAsExtensionClashPrioritized.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("entriesPropertyImport.kt")
|
||||
public void testEntriesPropertyImport() {
|
||||
runTest("compiler/testData/diagnostics/tests/enum/entries/entriesPropertyImport.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("entriesPropertyImportedClash.kt")
|
||||
public void testEntriesPropertyImportedClash() {
|
||||
|
||||
+6
@@ -12819,6 +12819,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
||||
runTest("compiler/testData/diagnostics/tests/enum/entries/entriesPropertyAsExtensionClashPrioritized.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("entriesPropertyImport.kt")
|
||||
public void testEntriesPropertyImport() {
|
||||
runTest("compiler/testData/diagnostics/tests/enum/entries/entriesPropertyImport.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("entriesPropertyImportedClash.kt")
|
||||
public void testEntriesPropertyImportedClash() {
|
||||
|
||||
+6
@@ -12825,6 +12825,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
||||
runTest("compiler/testData/diagnostics/tests/enum/entries/entriesPropertyAsExtensionClashPrioritized.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("entriesPropertyImport.kt")
|
||||
public void testEntriesPropertyImport() {
|
||||
runTest("compiler/testData/diagnostics/tests/enum/entries/entriesPropertyImport.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("entriesPropertyImportedClash.kt")
|
||||
public void testEntriesPropertyImportedClash() {
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// !LANGUAGE: -EnumEntries -PrioritizedEnumEntries
|
||||
// WITH_STDLIB
|
||||
import MyEnum.entries
|
||||
|
||||
enum class MyEnum
|
||||
|
||||
val entries = "local str"
|
||||
|
||||
fun test() {
|
||||
<!DEPRECATED_ACCESS_TO_ENTRY_PROPERTY_FROM_ENUM!>entries<!>
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// !LANGUAGE: -EnumEntries -PrioritizedEnumEntries
|
||||
// WITH_STDLIB
|
||||
import MyEnum.entries
|
||||
|
||||
enum class MyEnum
|
||||
|
||||
val entries = "local str"
|
||||
|
||||
fun test() {
|
||||
entries
|
||||
}
|
||||
Generated
+6
@@ -12825,6 +12825,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/tests/enum/entries/entriesPropertyAsExtensionClashPrioritized.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("entriesPropertyImport.kt")
|
||||
public void testEntriesPropertyImport() {
|
||||
runTest("compiler/testData/diagnostics/tests/enum/entries/entriesPropertyImport.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("entriesPropertyImportedClash.kt")
|
||||
public void testEntriesPropertyImportedClash() {
|
||||
|
||||
Reference in New Issue
Block a user