[Wasm] Fix transforming setField in an inline class constructor body

IrSetField was transformed to its value to preserve side effects
This transformation produced invalid IR in cases where
IrSetField used in Unit-returning expression context.

This commit fixes it by producing Unit-typed expression

^KT-59084 Fixed
This commit is contained in:
Svyatoslav Kuzmich
2023-08-15 14:18:55 +02:00
committed by Space Team
parent 6fba6a2e3c
commit 833c8b2cd4
4 changed files with 40 additions and 1 deletions
@@ -121,6 +121,12 @@ public class FirWasmCodegenWasmJsInteropTestGenerated extends AbstractFirWasmCod
runTest("compiler/testData/codegen/boxWasmJsInterop/kt59082.kt");
}
@Test
@TestMetadata("kt59084.kt")
public void testKt59084() throws Exception {
runTest("compiler/testData/codegen/boxWasmJsInterop/kt59084.kt");
}
@Test
@TestMetadata("lambdaAdapterNameClash.kt")
public void testLambdaAdapterNameClash() throws Exception {
@@ -121,6 +121,12 @@ public class K1WasmCodegenWasmJsInteropTestGenerated extends AbstractK1WasmCodeg
runTest("compiler/testData/codegen/boxWasmJsInterop/kt59082.kt");
}
@Test
@TestMetadata("kt59084.kt")
public void testKt59084() throws Exception {
runTest("compiler/testData/codegen/boxWasmJsInterop/kt59084.kt");
}
@Test
@TestMetadata("lambdaAdapterNameClash.kt")
public void testLambdaAdapterNameClash() throws Exception {