blob: de11649a84e4519c9a4ba222a5ba1c83b39cd463 [file]
// SKIP_TXT
fun <T> T.myApply(block: T.() -> Unit): T = this
fun bar(): Int = 1
interface A : C
interface B : C
interface C {
fun baz()
}
fun Any.foo() = myApply {
when (this) {
is A -> ::bar
is B -> ::bar
else -> throw RuntimeException()
}
<!UNRESOLVED_REFERENCE!>baz<!>() // Smart cast should work
}