Do not suggest !! on expression which is always null

Related to KT-14643
This commit is contained in:
Dmitry Neverov
2017-06-28 07:31:09 +03:00
committed by Mikhail Glukhikh
parent 66bd9d63dd
commit 4f678fa85c
3 changed files with 32 additions and 2 deletions
@@ -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>
}
}