Files
kotlin-fork/compiler/testData/codegen/box/ir/kt25405.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

29 lines
436 B
Kotlin
Vendored

fun <T> tableView(init: Table<T>.() -> Unit) {
Table<T>().init()
}
var result = "fail"
class Table<T> {
inner class TableColumn(val name: String) {
}
fun column(name: String, init: TableColumn.() -> Unit) {
val column = TableColumn(name).init()
}
}
fun foo() {
tableView<String> {
column("OK") {
result = name
}
}
}
fun box(): String {
foo()
return result
}