41fd43b5e5
Bug:
fun loop(var times : Int) {
while(times > 0) {
val u : (value : Int) -> Unit = { // This arrow is confusing the lookahead
System.out?.println(it)
}
u(times--)
}
}
10 lines
337 B
Plaintext
10 lines
337 B
Plaintext
//KT-610 Distinguish errors 'unused variable' and 'variable is assigned but never accessed'
|
|
|
|
package kt610
|
|
|
|
fun foo() {
|
|
var <!UNUSED_VARIABLE!>j<!> = 9 //'unused variable' error
|
|
|
|
var <!ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE!>i<!> = 1 //should be an error 'variable i is assigned but never accessed'
|
|
i = <!UNUSED_VALUE!>2<!>
|
|
} |