Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/kt10483.fir.kt
T

18 lines
214 B
Kotlin
Vendored

interface A
class B : A {
operator fun invoke() = this
}
class C : A
operator fun C.invoke(): B = B()
fun foo(arg: A): B? {
if (arg is B) return arg()
if (arg is C) return arg()
return null
}