Files
kotlin-fork/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/objectExpression.fir.kt
T
Denis Zharkov c295f2dc25 FIR: Reimplement implicit types calculator
Make it works through a single component tracking computation status
instead of storing it in the nodes
2020-01-28 17:03:50 +03:00

37 lines
741 B
Kotlin
Vendored

// !WITH_NEW_INFERENCE
// !CHECK_TYPE
object Outer {
private var x
get() = object : CharSequence {
override val length: Int
get() = 0
override fun get(index: Int): Char {
<!INAPPLICABLE_CANDIDATE!>checkSubtype<!><CharSequence>(x)
return ' '
}
override fun subSequence(startIndex: Int, endIndex: Int) = ""
fun bar() {
}
}
set(q) {
checkSubtype<CharSequence>(x)
y = q
x = q
}
private var y = x
fun foo() {
x = y
checkSubtype<CharSequence>(x)
checkSubtype<CharSequence>(y)
x.bar()
y.bar()
}
}