Replace inlineOption(ONLY_LOCAL_RETURN) with crossinline in testData
This commit is contained in:
+1
-1
@@ -14,7 +14,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
-2
@@ -7,12 +7,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