[FIR] Implement FirReturnAllowedChecker

Supported diagnostics:
- RETURN_NOT_ALLOWED
- RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY
This commit is contained in:
Dmitriy Novozhilov
2021-04-05 10:15:21 +03:00
committed by TeamCityServer
parent 254ff77977
commit 3cb17ac2f0
59 changed files with 263 additions and 343 deletions
@@ -7,5 +7,5 @@ fun autolabel(l: List<Int>) = l.map (fun (i: Int): Int {
})
fun unresolvedMapLabel(l: List<Int>) = l.map (l@ fun(i: Int): Int {
return@map 4
<!RETURN_NOT_ALLOWED!>return@map<!> 4
})
@@ -1,22 +0,0 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE
fun test() {
fun bar() {
val bas = fun() {
return@bar
}
}
val bar = fun() {
return@test
}
}
fun foo() {
val bal = bag@ fun () {
val bar = fun() {
return@bag
}
return@bag
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_VARIABLE
fun test() {