Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/publicVals/customGetter.kt
T
Mikhail Glukhikh 1544755838 Test refactoring
2015-04-14 19:11:26 +03:00

14 lines
328 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
}
}