Files
kotlin-fork/idea/testData/quickfix/addExclExclCall/nullExpression.kt
T
Dmitry Neverov 4f678fa85c Do not suggest !! on expression which is always null
Related to KT-14643
2017-07-03 15:14:11 +03:00

11 lines
330 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>
}
}