Add test on data-flow
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
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
// !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"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user