[FIR] Capture array and indices for postfix/prefix increment/decrement

of array element (including overloaded indexed access operators, e.g.,
`a[b, c]++`).

This prevents double-evaluation of the array and indices expressions,
which may have side-effects.
This commit is contained in:
Mark Punzalan
2020-09-30 07:14:46 +00:00
committed by teamcityserver
parent eb631bc429
commit a2a4d94834
22 changed files with 441 additions and 160 deletions
@@ -14386,6 +14386,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/increment"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@TestMetadata("argumentWithSideEffects.kt")
public void testArgumentWithSideEffects() throws Exception {
runTest("compiler/testData/codegen/box/increment/argumentWithSideEffects.kt");
}
@TestMetadata("arrayElement.kt")
public void testArrayElement() throws Exception {
runTest("compiler/testData/codegen/box/increment/arrayElement.kt");