Init enum entries whenever we access companion object or accessing valueOf

Fixes https://youtrack.jetbrains.com/issue/KT-43987
Fixes https://youtrack.jetbrains.com/issue/KT-43989
This commit is contained in:
Shagen Ogandzhanian
2020-12-30 14:52:21 +01:00
parent 7fa04afda2
commit e7dc199ad7
14 changed files with 284 additions and 18 deletions
@@ -9567,6 +9567,21 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
runTest("compiler/testData/codegen/box/enum/inclassobj.kt");
}
@TestMetadata("initEntriesInCompanionObject.kt")
public void testInitEntriesInCompanionObject() throws Exception {
runTest("compiler/testData/codegen/box/enum/initEntriesInCompanionObject.kt");
}
@TestMetadata("initEntriesInValueOf.kt")
public void testInitEntriesInValueOf() throws Exception {
runTest("compiler/testData/codegen/box/enum/initEntriesInValueOf.kt");
}
@TestMetadata("initEnumAfterObjectAccess.kt")
public void testInitEnumAfterObjectAccess() throws Exception {
runTest("compiler/testData/codegen/box/enum/initEnumAfterObjectAccess.kt");
}
@TestMetadata("inner.kt")
public void testInner() throws Exception {
runTest("compiler/testData/codegen/box/enum/inner.kt");
@@ -9567,6 +9567,21 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/enum/inclassobj.kt");
}
@TestMetadata("initEntriesInCompanionObject.kt")
public void testInitEntriesInCompanionObject() throws Exception {
runTest("compiler/testData/codegen/box/enum/initEntriesInCompanionObject.kt");
}
@TestMetadata("initEntriesInValueOf.kt")
public void testInitEntriesInValueOf() throws Exception {
runTest("compiler/testData/codegen/box/enum/initEntriesInValueOf.kt");
}
@TestMetadata("initEnumAfterObjectAccess.kt")
public void testInitEnumAfterObjectAccess() throws Exception {
runTest("compiler/testData/codegen/box/enum/initEnumAfterObjectAccess.kt");
}
@TestMetadata("inner.kt")
public void testInner() throws Exception {
runTest("compiler/testData/codegen/box/enum/inner.kt");
@@ -9567,6 +9567,21 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/enum/inclassobj.kt");
}
@TestMetadata("initEntriesInCompanionObject.kt")
public void testInitEntriesInCompanionObject() throws Exception {
runTest("compiler/testData/codegen/box/enum/initEntriesInCompanionObject.kt");
}
@TestMetadata("initEntriesInValueOf.kt")
public void testInitEntriesInValueOf() throws Exception {
runTest("compiler/testData/codegen/box/enum/initEntriesInValueOf.kt");
}
@TestMetadata("initEnumAfterObjectAccess.kt")
public void testInitEnumAfterObjectAccess() throws Exception {
runTest("compiler/testData/codegen/box/enum/initEnumAfterObjectAccess.kt");
}
@TestMetadata("inner.kt")
public void testInner() throws Exception {
runTest("compiler/testData/codegen/box/enum/inner.kt");
@@ -4651,6 +4651,21 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
runTest("compiler/testData/codegen/box/enum/inclassobj.kt");
}
@TestMetadata("initEntriesInCompanionObject.kt")
public void testInitEntriesInCompanionObject() throws Exception {
runTest("compiler/testData/codegen/box/enum/initEntriesInCompanionObject.kt");
}
@TestMetadata("initEntriesInValueOf.kt")
public void testInitEntriesInValueOf() throws Exception {
runTest("compiler/testData/codegen/box/enum/initEntriesInValueOf.kt");
}
@TestMetadata("initEnumAfterObjectAccess.kt")
public void testInitEnumAfterObjectAccess() throws Exception {
runTest("compiler/testData/codegen/box/enum/initEnumAfterObjectAccess.kt");
}
@TestMetadata("inner.kt")
public void testInner() throws Exception {
runTest("compiler/testData/codegen/box/enum/inner.kt");