KT-14227 Intrinsify MutableMap.set

This fixes the most common (and rather annoying) bug in augmented
assignment desugaring with collection element receiver.

Fix is somewhat hackish: introduce an intrinsic for MutableMap.set,
thus bypassing discrepancies in 'get' and 'set' call generation.
Fixing it properly requires design decisions for corner cases where
ad hoc augmented assignment desugaring with collection element receiver
"accidentally" works, producing identical objects and vararg arrays for
arguments of 'get' and 'set'.
This commit is contained in:
Dmitry Petrov
2018-12-10 17:29:28 +03:00
parent 9a98a4525b
commit 08d1c47ac3
8 changed files with 73 additions and 0 deletions
@@ -16394,6 +16394,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/operatorConventions/kt14201_2.kt");
}
@TestMetadata("kt14227.kt")
public void testKt14227() throws Exception {
runTest("compiler/testData/codegen/box/operatorConventions/kt14227.kt");
}
@TestMetadata("kt20387.kt")
public void testKt20387() throws Exception {
runTest("compiler/testData/codegen/box/operatorConventions/kt20387.kt");