Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/propertyToNotNull.fir.kt
T
2021-06-10 16:01:13 +03:00

13 lines
257 B
Kotlin
Vendored

class Immutable(val x: String?) {
fun foo(): String {
if (x != null) return x
return ""
}
}
class Mutable(var y: String?) {
fun foo(): String {
if (y != null) return <!SMARTCAST_IMPOSSIBLE!>y<!>
return ""
}
}