Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/publicVals/customGetter.kt
T
2015-10-14 20:39:35 +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
}
}