dd682bd37d
Idea is to intersect similar smartcasts on similar properties coming from *different* instances (something like 'this.x == null && other.x == null' ). It checks that we distinguish subjects of such smartcasts properly. Currently behavior is undesired, see KT-27260
11 lines
242 B
Kotlin
Vendored
11 lines
242 B
Kotlin
Vendored
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
|
// See KT-27260
|
|
|
|
class A(val x: String?) {
|
|
fun foo(other: A) {
|
|
when {
|
|
x == null && other.x == null -> "1"
|
|
<!DEBUG_INFO_SMARTCAST!>x<!>.length > 0 -> "2"
|
|
}
|
|
}
|
|
} |