Files
kotlin-fork/compiler/testData/codegen/box/ir/kt25405.kt
T
2018-08-09 14:22:50 +03:00

30 lines
437 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
}