Files
kotlin-fork/compiler/testData/diagnostics/tests/generics/nullability/smartCastRefinedClass.kt
T
2015-08-28 18:50:25 +03:00

14 lines
287 B
Kotlin
Vendored

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