Files
kotlin-fork/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.fir.kt
T
Tianyu Geng 6a03f31e50 FIR: add UnsafeCall resolution diagnostics
Previously unsafe call is reported as part of InapplicableWrongReceiver.
This makes it difficult for the downstream checkers to report different
diagnostics.
2021-04-19 15:11:13 +03:00

22 lines
537 B
Kotlin
Vendored

class A(val x: (String.() -> Unit)?)
fun test(a: A) {
if (a.x != null) {
"".(<!UNRESOLVED_REFERENCE!>a.x<!>)()
a.x("") // todo
(a.x)("")
}
"".(<!UNRESOLVED_REFERENCE!>a.x<!>)()
a.<!UNSAFE_IMPLICIT_INVOKE_CALL!>x<!>("")
<!UNSAFE_IMPLICIT_INVOKE_CALL!>(a.x)<!>("")
with("") {
a.x(<!NO_VALUE_FOR_PARAMETER!>)<!>
<!UNSAFE_IMPLICIT_INVOKE_CALL!>(a.x)<!>()
if (a.x != null) {
a.x(<!NO_VALUE_FOR_PARAMETER!>)<!> // todo
(a.x)()
}
}
}