Files
kotlin-fork/idea/testData/quickfix/addExclExclCall/nullExpression.kt
T
2021-06-09 22:49:50 +03:00

15 lines
394 B
Kotlin
Vendored

// "Add non-null asserted (!!) call" "false"
// ACTION: Add 'toString()' call
// ACTION: Change type of 'x' to 'String?'
// ACTION: Remove braces from 'if' statement
// ERROR: Type mismatch: inferred type is String? but String was expected
fun foo(arg: String?) {
if (arg == null) {
val x: String = arg<caret>
}
}
// TODO: Need data flow info from null check
/* IGNORE_FIR */