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"
21 lines
328 B
Kotlin
Vendored
21 lines
328 B
Kotlin
Vendored
class Bar {
|
|
}
|
|
|
|
interface Foo {
|
|
fun xyzzy(x: Any?): String
|
|
}
|
|
|
|
fun buildFoo(bar: Bar.() -> Unit): Foo {
|
|
return object : Foo {
|
|
override fun xyzzy(x: Any?): String {
|
|
(x as? Bar)?.bar()
|
|
return "OK"
|
|
}
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
val foo = buildFoo({})
|
|
return foo.xyzzy(Bar())
|
|
}
|