[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
@@ -0,0 +1,20 @@
// FIR_IDENTICAL
fun testArray(b: Boolean) {
Array(5) { i ->
if (b) return
i
}
throw AssertionError()
}
fun testMyArray(b: Boolean) {
MyArray(5) { i ->
if (b) <!RETURN_NOT_ALLOWED!>return<!>
i
}
throw AssertionError()
}
class MyArray<T> {
constructor(size: Int, init: (Int) -> T)
}