Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/publicVals/customGetter.kt
T

14 lines
334 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 <!SMARTCAST_IMPOSSIBLE!>y<!>.length
else
return 0
}
}