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

16 lines
404 B
Kotlin
Vendored

public class X {
public var x : String? = null
private var y: String? = "abc"
public fun fn(): Int {
if (x != null)
// Smartcast is not possible for variable properties
return x<!UNSAFE_CALL!>.<!>length
else if (y != null)
// Even if they are private
return y<!UNSAFE_CALL!>.<!>length
else
return 0
}
}