Files
kotlin-fork/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/objectExpression.fir.kt
T
Denis.Zharkov 2ecba6ac39 Remove WITH_NEW_INFERENCE directive from all tests
This directive anyway does not make test run twice with OI, and with NI
It only once run the test with specific settings (// LANGUAGE)
and ignores irrelevant (OI or NI tags)
2021-05-25 13:28:26 +03:00

36 lines
718 B
Kotlin
Vendored

// !CHECK_TYPE
object Outer {
private var x
get() = object : CharSequence {
override val length: Int
get() = 0
override fun get(index: Int): Char {
checkSubtype<CharSequence>(<!ARGUMENT_TYPE_MISMATCH!>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()
}
}