Added checking for ONLY_LOCAL_RETURN in actual parameter of inline function
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import test.*
|
||||
import kotlin.InlineOption.*
|
||||
|
||||
fun testSameCaptured() : String {
|
||||
var result = 0;
|
||||
@@ -6,7 +7,7 @@ fun testSameCaptured() : String {
|
||||
return if (result == 12) "OK" else "fail ${result}"
|
||||
}
|
||||
|
||||
inline fun testSameCaptured(lambdaWithResultCaptured: () -> Unit) : String {
|
||||
inline fun testSameCaptured(inlineOptions(ONLY_LOCAL_RETURN) lambdaWithResultCaptured: () -> Unit) : String {
|
||||
var result = 1;
|
||||
result = doWork({result+=11; lambdaWithResultCaptured(); result})
|
||||
return if (result == 12) "OK" else "fail ${result}"
|
||||
|
||||
Reference in New Issue
Block a user