[WASM] Lower Unit to Void in order to mark statements with no result

This commit is contained in:
Igor Laevsky
2021-09-10 17:15:09 +03:00
committed by teamcityserver
parent 9685695769
commit 15668e2266
7 changed files with 189 additions and 7 deletions
@@ -67,3 +67,12 @@ internal fun <T, R> boxIntrinsic(x: T): R =
@ExcludedFromCodegen
internal fun <T, R> unboxIntrinsic(x: T): R =
implementedAsIntrinsic
// Represents absence of a value. Should never be used as a real object. See UnitToVoidLowering.kt for more info.
@ExcludedFromCodegen
internal class Void private constructor()
// This is the only way to introduce Void type.
@WasmOp(WasmOp.DROP)
internal fun consumeAnyIntoVoid(a: Any?): Void =
implementedAsIntrinsic