b79719d6f5
- 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"
14 lines
181 B
Kotlin
Vendored
14 lines
181 B
Kotlin
Vendored
// DONT_RUN_GENERATED_CODE: JS
|
|
|
|
tailrec fun foo(x: Int) {
|
|
return if (x > 0) {
|
|
(foo(x - 1))
|
|
}
|
|
else Unit
|
|
}
|
|
|
|
fun box(): String {
|
|
foo(1000000)
|
|
return "OK"
|
|
}
|