Added tests on labels
#KT-1703 Fixed #KT-361 Fixed #KT-3920 Fixed #KT-3988 Fixed #KT-4247 Fixed #KT-4586 Fixed #KT-4603 Fixed #KT-591 Fixed
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
fun nonlocals(b : Boolean) {
|
||||
@a{(): Int ->
|
||||
fun foo() {
|
||||
if (b) {
|
||||
<!RETURN_NOT_ALLOWED!>return@a 1<!> // The label must be resolved, but an error should be reported for a non-local return
|
||||
}
|
||||
}
|
||||
|
||||
return@a 5
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user