[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
+20
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user