Files
kotlin-fork/compiler/testData/codegen/box/classes/kt1918.kt
T
Denis Zharkov 409e90e7de FIR: Fix codegen test data after safe-call refactoring
^KT-38444 In Progress
2020-06-03 10:43:37 +03:00

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())
}