Files
kotlin-fork/compiler/testData/codegen/box/dataClasses/unitComponent.kt
T
Svyatoslav Kuzmich b79719d6f5 [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"
2021-09-08 19:56:26 +03:00

7 lines
143 B
Kotlin
Vendored

data class A(val x: Unit)
fun box(): String {
val a = A(Unit)
return if (a.component1() is Unit) "OK" else "Fail ${a.component1()}"
}