[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
@@ -1,4 +1,4 @@
|
||||
fun <T> simpleRun(f: (T) -> Unit): Unit = f(return)
|
||||
fun <T> simpleRun(f: (T) -> Unit): Unit = f(<!RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY!>return<!>)
|
||||
|
||||
fun <T, R> List<T>.simpleMap(f: (T) -> R): R {
|
||||
|
||||
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
FILE: labeledReturnFromNotLabeledUnnamedFunction.kt
|
||||
public final fun notInline(block: R|(kotlin/Boolean) -> kotlin/Unit|): R|kotlin/String| {
|
||||
^notInline String()
|
||||
}
|
||||
public final fun test(): R|kotlin/String| {
|
||||
^test R|/notInline|(fun <anonymous>(b: R|kotlin/Boolean|): R|kotlin/Unit| <inline=NoInline> {
|
||||
^@notInline Unit
|
||||
}
|
||||
)
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fun notInline(block: (Boolean) -> Unit): String {
|
||||
return ""
|
||||
}
|
||||
|
||||
fun test(): String {
|
||||
return notInline(fun(b: Boolean) {
|
||||
return@notInline
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user