Files
kotlin-fork/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/Elvis.kt
T
Nikolay Krasko ebd72df058 KT-3491 Wrong (or not obvious) warning
#KT-3491 Fixed
2013-04-10 13:14:49 +04:00

9 lines
165 B
Kotlin

fun bar(x: Int): Int = x + 1
fun foo() {
val x: Int? = null
bar(x ?: 0)
if (x != null) bar(<!USELESS_ELVIS!>x<!> ?: x)
bar(<!TYPE_MISMATCH!>x<!>)
}