Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/problems/safeCallInvoke.kt
T
Denis Zharkov 706ccb2cf9 FIR: Adjust testData for spec tests: invoke on nullable receiver
It's a design problem, see related issue

^KT-30415
2020-04-21 10:16:34 +03:00

14 lines
231 B
Kotlin
Vendored

class A {
operator fun invoke() {}
}
class B {
val bar: () -> Unit = {}
val foo: A = A()
}
fun main(b: B?) {
b?.bar() // allowed in FIR, prohibited in old FE
b?.foo() // allowed in FIR, prohibited in old FE
}