KJS IR: Fix KT-45738 - Consider recursive checkForPrimitiveOrPattern
Recursive results from checkForPrimitiveOrPattern were ignored. If it found a case/condition that could not be optimized the resulting "false" was not propagated. This would lead to a "optimized" when without all conditions. - see KT-45738 - The return is now lifted out of the when to make it more obvious what is going on. - New test for mixed multiple conditions in when
This commit is contained in:
+5
@@ -33494,6 +33494,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/when/switchOptimizationMultipleConditions.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("switchOptimizationMultipleMixedConditions.kt")
|
||||
public void testSwitchOptimizationMultipleMixedConditions() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/when/switchOptimizationMultipleMixedConditions.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("switchOptimizationSingleStatementCase.kt")
|
||||
public void testSwitchOptimizationSingleStatementCase() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/when/switchOptimizationSingleStatementCase.kt");
|
||||
|
||||
Reference in New Issue
Block a user