Report RETURN_NOT_ALLOWED and RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY only on the return with label (KT-13340)
#KT-13340 Fixed
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@ fun nonlocals(b : Boolean) {
|
||||
a@<!UNUSED_LAMBDA_EXPRESSION!>{
|
||||
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_NOT_ALLOWED!>return@a<!> 1 // The label must be resolved, but an error should be reported for a non-local return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user