Do not add a new label to labeled loop
Relevant situation: break / continue in when #KT-16128 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
d9e1e82948
commit
6277476573
@@ -0,0 +1,14 @@
|
||||
// "Add '@loop' to continue" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo(chars: CharArray) {
|
||||
val length = chars.size
|
||||
var pos = 0
|
||||
loop@ while (pos < length) {
|
||||
val c = chars[pos]
|
||||
when (c) {
|
||||
'\n' -> continue@loop
|
||||
}
|
||||
pos++
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user