JVM IR: fix "null" as the first entry in MappedEnumWhenLowering
If "null" was the first entry in an optimizable "when" over enum, mapRuntimeEnumEntry was called before mapConstEnumEntry, and the $WhenMappings field was not created. Now both mapConstEnumEntry and mapRuntimeEnumEntry create this field on the first access
This commit is contained in:
+5
@@ -26192,6 +26192,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/when/enumOptimization/nonConstantEnum.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nullIsTheFirstEntry.kt")
|
||||
public void testNullIsTheFirstEntry() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/when/enumOptimization/nullIsTheFirstEntry.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nullability.kt")
|
||||
public void testNullability() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/when/enumOptimization/nullability.kt");
|
||||
|
||||
Reference in New Issue
Block a user