KT-2643 Support multi-declarations in Data-Flow analysis

#KT-2643 fixed
This commit is contained in:
Svetlana Isakova
2012-08-20 18:48:09 +04:00
parent f817eba7aa
commit 8860bab9f1
17 changed files with 126 additions and 24 deletions
@@ -0,0 +1,27 @@
//KT-2643 Support multi-declarations in Data-Flow analysis
package n
class C {
fun component1() = 1
fun component2() = 2
}
fun test1(c: C) {
val (<!UNUSED_VARIABLE!>a<!>, <!UNUSED_VARIABLE!>b<!>) = c
}
fun test2(c: C) {
val (a, <!UNUSED_VARIABLE!>b<!>) = c
a + 3
}
fun test3(c: C) {
var (<!ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE!>a<!>, <!UNUSED_VARIABLE!>b<!>) = c
a = <!UNUSED_VALUE!>3<!>
}
fun test4(c: C) {
var (<!VARIABLE_WITH_REDUNDANT_INITIALIZER!>a<!>, <!UNUSED_VARIABLE!>b<!>) = c
a = 3
a + 1
}