Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/properties.fir.kt
T
Denis Zharkov 47ecaa5b06 FIR: Fix scope intersection types
Otherwise overload resolution ambiguity is reported in the test
2020-01-30 17:12:50 +03:00

22 lines
283 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.foo = ""
a.foo = null
a.foo.checkType { _<String>() }
}
}