Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/propertiesConflict.fir.kt
T

21 lines
304 B
Kotlin
Vendored

// !CHECK_TYPE
interface A {
val foo: Any?
}
interface C: A {
override val foo: String
}
interface B: A {
override var foo: String?
}
fun test(a: A) {
if (a is B && a is C) {
a.<!AMBIGUITY!>foo<!> = ""
a.<!AMBIGUITY!>foo<!> = null
a.<!AMBIGUITY!>foo<!>
}
}