//KT-1027 Strange selection of unreachable code
This commit is contained in:
@@ -6,8 +6,8 @@ package kt1001
|
||||
fun foo(<!UNUSED_PARAMETER!>c<!>: Array<Int>) {
|
||||
return
|
||||
|
||||
for (<!UNREACHABLE_CODE!>i<!> in <!UNREACHABLE_CODE!>c<!>) {}
|
||||
for (<!UNREACHABLE_CODE!>i<!> in <!UNREACHABLE_CODE!>c<!>) {}
|
||||
<!UNREACHABLE_CODE!>for (i in c) {}<!>
|
||||
<!UNREACHABLE_CODE!>for (i in c) {}<!>
|
||||
}
|
||||
|
||||
//more tests
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
//KT-1027 Strange selection of unreachable code
|
||||
//+JDK
|
||||
|
||||
package kt1027
|
||||
|
||||
import java.util.List
|
||||
|
||||
fun foo(<!UNUSED_PARAMETER!>c<!>: List<Int>) {
|
||||
var <!UNUSED_VARIABLE!>i<!> = 2
|
||||
|
||||
return
|
||||
|
||||
<!UNREACHABLE_CODE!>for (j in c) { //strange selection of unreachable code
|
||||
i += 23
|
||||
}<!>
|
||||
}
|
||||
|
||||
fun t1() {
|
||||
return
|
||||
|
||||
<!UNREACHABLE_CODE!>while(true) {
|
||||
doSmth()
|
||||
}<!>
|
||||
}
|
||||
|
||||
fun t2() {
|
||||
return
|
||||
|
||||
<!UNREACHABLE_CODE!>do {
|
||||
doSmth()
|
||||
} while (true)<!>
|
||||
}
|
||||
|
||||
fun t3() {
|
||||
return
|
||||
|
||||
<!UNREACHABLE_CODE!>try {
|
||||
doSmth()
|
||||
}
|
||||
finally {
|
||||
doSmth()
|
||||
}<!>
|
||||
}
|
||||
|
||||
fun t4() {
|
||||
return
|
||||
|
||||
<!UNREACHABLE_CODE!>(43)<!>
|
||||
}
|
||||
|
||||
fun doSmth() {}
|
||||
Reference in New Issue
Block a user