[Wasm] Fix unit issues

- Materialize unit when its value is actually needed.
- Special-case Unit_getInstance return type at codegen. It should be a
  proper Unit object instead of a "void"
This commit is contained in:
Svyatoslav Kuzmich
2021-05-24 18:06:26 +03:00
committed by TeamCityServer
parent 20ddaa9ebf
commit b79719d6f5
45 changed files with 289 additions and 141 deletions
@@ -156,6 +156,8 @@ class InlineClassLowering(val context: CommonBackendContext) {
+statement.transformStatement(object : IrElementTransformerVoid() {
override fun visitDelegatingConstructorCall(expression: IrDelegatingConstructorCall): IrExpression {
expression.transformChildrenVoid()
// Static function for delegating constructors return unboxed instance of inline class
expression.type = irClass.defaultType
return irBlock(expression) {
thisVar = createTmpVariable(
expression,