[FIR] Implement FirReturnAllowedChecker
Supported diagnostics: - RETURN_NOT_ALLOWED - RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY
This commit is contained in:
committed by
TeamCityServer
parent
254ff77977
commit
3cb17ac2f0
+3
-3
@@ -31,7 +31,7 @@ fun testAnnotatedLambdaLabel() =
|
||||
|
||||
fun testLambdaMultipleLabels1() =
|
||||
lambda1@ lambda2@ {
|
||||
return@lambda1
|
||||
<!RETURN_NOT_ALLOWED!>return@lambda1<!>
|
||||
}
|
||||
|
||||
fun testLambdaMultipleLabels2() =
|
||||
@@ -46,7 +46,7 @@ fun testAnonymousFunctionLabel() =
|
||||
|
||||
fun testLoopLabelInReturn(xs: List<Int>) {
|
||||
L@ for (x in xs) {
|
||||
if (x > 0) return@L
|
||||
if (x > 0) <!RETURN_NOT_ALLOWED!>return@L<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,4 +59,4 @@ fun testHighOrderFunctionCallLabelInReturn() {
|
||||
L@ run {
|
||||
return@L
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user