Replace inlineOption(ONLY_LOCAL_RETURN) with crossinline in testData
This commit is contained in:
+2
-2
@@ -24,7 +24,7 @@ fun test11(param: String): String {
|
||||
return result
|
||||
}
|
||||
|
||||
inline fun test2(inlineOptions(ONLY_LOCAL_RETURN) param: () -> String): String {
|
||||
inline fun test2(crossinline param: () -> String): String {
|
||||
var result = "fail1"
|
||||
noInlineFun("stub") { a ->
|
||||
concat(param()) {
|
||||
@@ -35,7 +35,7 @@ inline fun test2(inlineOptions(ONLY_LOCAL_RETURN) param: () -> String): String {
|
||||
return result
|
||||
}
|
||||
|
||||
inline fun test22(inlineOptions(ONLY_LOCAL_RETURN) param: () -> String): String {
|
||||
inline fun test22(crossinline param: () -> String): String {
|
||||
var result = "fail1"
|
||||
{{result = param()}()}()
|
||||
|
||||
|
||||
+1
-1
@@ -2,6 +2,6 @@ package test
|
||||
|
||||
import kotlin.InlineOption.*
|
||||
|
||||
inline fun <R> call(inlineOptions(ONLY_LOCAL_RETURN) f: () -> R) : R {
|
||||
inline fun <R> call(crossinline f: () -> R) : R {
|
||||
return {f()} ()
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ fun testSameCaptured() : String {
|
||||
return if (result == 12) "OK" else "fail ${result}"
|
||||
}
|
||||
|
||||
inline fun testSameCaptured(inlineOptions(ONLY_LOCAL_RETURN) lambdaWithResultCaptured: () -> Unit) : String {
|
||||
inline fun testSameCaptured(crossinline lambdaWithResultCaptured: () -> Unit) : String {
|
||||
var result = 1;
|
||||
result = doWork({result+=11; lambdaWithResultCaptured(); result})
|
||||
return if (result == 12) "OK" else "fail ${result}"
|
||||
|
||||
@@ -2,12 +2,12 @@ package test
|
||||
|
||||
import kotlin.InlineOption.*
|
||||
|
||||
inline fun <R> doWork(inlineOptions(ONLY_LOCAL_RETURN) job: ()-> R) : R {
|
||||
inline fun <R> doWork(crossinline job: ()-> R) : R {
|
||||
val k = 10;
|
||||
return notInline({k; job()})
|
||||
}
|
||||
|
||||
inline fun <R> doWork(inlineOptions(ONLY_LOCAL_RETURN) job: ()-> R, inlineOptions(ONLY_LOCAL_RETURN) job2: () -> R) : R {
|
||||
inline fun <R> doWork(crossinline job: ()-> R, crossinline job2: () -> R) : R {
|
||||
val k = 10;
|
||||
return notInline({k; job(); job2()})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user