Added checking for ONLY_LOCAL_RETURN in actual parameter of inline function

This commit is contained in:
Michael Bogdanov
2014-07-08 10:17:06 +04:00
parent 24e20b2dcf
commit 6ddeb85c00
7 changed files with 142 additions and 16 deletions
@@ -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}"