Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/propertyToNotNull.fir.kt
T
Dmitriy Novozhilov 796f8e6bce Revert "FIR checkers: report SMARTCAST_IMPOSSIBLE"
This reverts commit 84334b08
2021-06-03 09:48:50 +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 <!RETURN_TYPE_MISMATCH!>y<!>
return ""
}
}