Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithBranch.kt
T

13 lines
214 B
Kotlin
Vendored

// FIR_IDENTICAL
fun String?.foo(): String {
return this ?: ""
}
class MyClass {
fun bar(): String {
var s: String? = null
if (4 < 2)
s = "42"
return s.foo()
}
}