Files
kotlin-fork/compiler/testData/codegen/box/labels/controlLabelClashesWithFuncitonName.kt
T
Mikhail Zarechenskiy 6a352bccb6 Resolve control label locally when label name clashes with fun name
#KT-5354 Fixed
 #KT-15085 Fixed
2017-04-17 16:21:02 +03:00

22 lines
329 B
Kotlin
Vendored

fun test1(): Boolean {
test1@ for(i in 1..2) {
continue@test1
return false
}
return true
}
fun test2(): Boolean {
test2@ while (true) {
break@test2
}
return true
}
fun box(): String {
if (!test1()) return "fail test1"
if (!test2()) return "fail test2"
return "OK"
}