Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/publicVals/customGetter.fir.kt
T
2021-01-29 16:55:26 +03:00

14 lines
325 B
Kotlin
Vendored

public class X {
private val x : String? = null
public val y: CharSequence?
get() = x?.subSequence(0, 1)
public fun fn(): Int {
if (y != null)
// With non-default getter smartcast is not possible
return y<!UNSAFE_CALL!>.<!>length
else
return 0
}
}