Files
kotlin-fork/compiler/testData/diagnostics/tests/generics/nullability/smartCastRefinedClass.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
198 B
Kotlin
Vendored

fun <T : Any?> foo(x: T) {
if (x is String?) {
x<!UNSAFE_CALL!>.<!>length
if (x != null) {
x.length
}
}
if (x is String) {
x.length
}
}