Do not suggest !! on expression which is always null
Related to KT-14643
This commit is contained in:
committed by
Mikhail Glukhikh
parent
66bd9d63dd
commit
4f678fa85c
@@ -0,0 +1,11 @@
|
||||
// "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>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user