Files
kotlin-fork/compiler/testData/diagnostics/tests/generics/nullability/functionalBound.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

14 lines
267 B
Kotlin
Vendored

fun <E : String?, T : ((CharSequence) -> Unit)?> foo(x: E, y: T) {
if (x != null) {
<!UNSAFE_IMPLICIT_INVOKE_CALL!>y<!>(x)
}
if (y != null) {
y(<!ARGUMENT_TYPE_MISMATCH!>x<!>)
}
if (x != null && y != null) {
y(x)
}
}