JVM: support enumEntries intrinsic for Kotlin enums

Implementation is very similar to the `enumValues` intrinsic.

Java enums and old (pre-1.9) Kotlin enums will be supported in a
subsequent commit.

 #KT-59710
This commit is contained in:
Alexander Udalov
2023-07-19 16:08:36 +02:00
committed by Space Team
parent c94c5a7d58
commit 874d1c514a
36 changed files with 652 additions and 4 deletions
@@ -2088,6 +2088,18 @@ public class FirJsCodegenInlineTestGenerated extends AbstractFirJsCodegenInlineT
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/enum"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
}
@Test
@TestMetadata("enumEntries.kt")
public void testEnumEntries() throws Exception {
runTest("compiler/testData/codegen/boxInline/enum/enumEntries.kt");
}
@Test
@TestMetadata("enumEntriesChainCapturedType.kt")
public void testEnumEntriesChainCapturedType() throws Exception {
runTest("compiler/testData/codegen/boxInline/enum/enumEntriesChainCapturedType.kt");
}
@Test
@TestMetadata("kt10569.kt")
public void testKt10569() throws Exception {
@@ -2088,6 +2088,18 @@ public class IrJsCodegenInlineTestGenerated extends AbstractIrJsCodegenInlineTes
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/enum"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
}
@Test
@TestMetadata("enumEntries.kt")
public void testEnumEntries() throws Exception {
runTest("compiler/testData/codegen/boxInline/enum/enumEntries.kt");
}
@Test
@TestMetadata("enumEntriesChainCapturedType.kt")
public void testEnumEntriesChainCapturedType() throws Exception {
runTest("compiler/testData/codegen/boxInline/enum/enumEntriesChainCapturedType.kt");
}
@Test
@TestMetadata("kt10569.kt")
public void testKt10569() throws Exception {
@@ -2088,6 +2088,18 @@ public class IrJsES6CodegenInlineTestGenerated extends AbstractIrJsES6CodegenInl
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/enum"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
}
@Test
@TestMetadata("enumEntries.kt")
public void testEnumEntries() throws Exception {
runTest("compiler/testData/codegen/boxInline/enum/enumEntries.kt");
}
@Test
@TestMetadata("enumEntriesChainCapturedType.kt")
public void testEnumEntriesChainCapturedType() throws Exception {
runTest("compiler/testData/codegen/boxInline/enum/enumEntriesChainCapturedType.kt");
}
@Test
@TestMetadata("kt10569.kt")
public void testKt10569() throws Exception {