Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/propertyToNotNull.kt
T
2017-11-29 02:54:26 +03:00

14 lines
325 B
Kotlin
Vendored

// !WITH_NEW_INFERENCE
class Immutable(val x: String?) {
fun foo(): String {
if (x != null) return <!DEBUG_INFO_SMARTCAST!>x<!>
return ""
}
}
class Mutable(var y: String?) {
fun foo(): String {
if (y != null) return <!NI;TYPE_MISMATCH, SMARTCAST_IMPOSSIBLE!>y<!>
return ""
}
}