Files
kotlin-fork/compiler/testData/codegen/box/classes/kt1918.kt
T
Alexander Udalov 41a416da60 Move blackBoxFile() testData to box/ directory
Delete all test methods (and empty test classes), since they'll be
auto-generated
2013-01-28 18:20:17 +04:00

21 lines
324 B
Kotlin

class Bar {
}
trait 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())
}