Replace inlineOption(ONLY_LOCAL_RETURN) with crossinline in testData

This commit is contained in:
Denis Zharkov
2015-09-15 10:11:19 +03:00
parent bae3320d52
commit 9adde77c47
43 changed files with 60 additions and 60 deletions
@@ -16,7 +16,7 @@ abstract class A<R> {
abstract fun getParam() : R
}
inline fun <R> doWork(inlineOptions(ONLY_LOCAL_RETURN) jobO: ()-> R, inlineOptions(ONLY_LOCAL_RETURN) jobK: ()-> R, param: R) : A<R> {
inline fun <R> doWork(crossinline jobO: ()-> R, crossinline jobK: ()-> R, param: R) : A<R> {
val s = object : A<R>() {
override fun getO(): R {
@@ -33,7 +33,7 @@ inline fun <R> doWork(inlineOptions(ONLY_LOCAL_RETURN) jobO: ()-> R, inlineOptio
return s;
}
inline fun <R> doWorkInConstructor(inlineOptions(ONLY_LOCAL_RETURN) jobO: ()-> R, inlineOptions(ONLY_LOCAL_RETURN) jobK: ()-> R, param: R) : A<R> {
inline fun <R> doWorkInConstructor(crossinline jobO: ()-> R, crossinline jobK: ()-> R, param: R) : A<R> {
val s = object : A<R>() {
val p = param;
@@ -13,7 +13,7 @@ abstract class A<R>(val param : R) {
abstract fun getK() : R
}
inline fun <R> doWork(inlineOptions(ONLY_LOCAL_RETURN) jobO: ()-> R, inlineOptions(ONLY_LOCAL_RETURN) jobK: ()-> R, param: R) : A<R> {
inline fun <R> doWork(crossinline jobO: ()-> R, crossinline jobK: ()-> R, param: R) : A<R> {
val s = object : A<R>(param) {
override fun getO(): R {
@@ -26,7 +26,7 @@ inline fun <R> doWork(inlineOptions(ONLY_LOCAL_RETURN) jobO: ()-> R, inlineOptio
return s;
}
inline fun <R> doWorkInConstructor(inlineOptions(ONLY_LOCAL_RETURN) jobO: ()-> R, inlineOptions(ONLY_LOCAL_RETURN) jobK: ()-> R, inlineOptions(ONLY_LOCAL_RETURN) param: () -> R) : A<R> {
inline fun <R> doWorkInConstructor(crossinline jobO: ()-> R, crossinline jobK: ()-> R, crossinline param: () -> R) : A<R> {
val s = object : A<R>(param()) {
val o1 = jobO()
@@ -47,7 +47,7 @@ inline fun testAllInline(f: () -> String) : String {
return result.toString()!!
}
inline fun testHtmlNoInline(inlineOptions(ONLY_LOCAL_RETURN) f: () -> String) : String {
inline fun testHtmlNoInline(crossinline f: () -> String) : String {
val args = array("1", "2", "3")
val result =
htmlNoInline() {
@@ -87,7 +87,7 @@ inline fun testHtmlNoInline(inlineOptions(ONLY_LOCAL_RETURN) f: () -> String) :
return result.toString()!!
}
inline fun testBodyNoInline(inlineOptions(ONLY_LOCAL_RETURN) f: () -> String) : String {
inline fun testBodyNoInline(crossinline f: () -> String) : String {
val args = array("1", "2", "3")
val result =
html {
@@ -127,7 +127,7 @@ inline fun testBodyNoInline(inlineOptions(ONLY_LOCAL_RETURN) f: () -> String) :
return result.toString()!!
}
inline fun testBodyHtmlNoInline(inlineOptions(ONLY_LOCAL_RETURN) f: () -> String) : String {
inline fun testBodyHtmlNoInline(crossinline f: () -> String) : String {
val args = array("1", "2", "3")
val result =
htmlNoInline {
@@ -7,7 +7,7 @@ package test
import kotlin.InlineOption.*
inline fun <R> doWork(inlineOptions(ONLY_LOCAL_RETURN) job: ()-> R) : R {
inline fun <R> doWork(crossinline job: ()-> R) : R {
return notInline({job()})
}
@@ -7,7 +7,7 @@ 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()})
}
@@ -30,7 +30,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()) {
@@ -41,7 +41,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()}()}()
@@ -7,6 +7,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()} ()
}
@@ -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}"
@@ -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()})
}
@@ -33,4 +33,4 @@ public fun Input.copyTo(output: Output, size: Int): Int {
return output.doOutput(this.data())
}
public inline fun with2<T>(receiver : T, inlineOptions(ONLY_LOCAL_RETURN) body : T.() -> Unit) : Unit = {receiver.body()}()
public inline fun with2<T>(receiver : T, crossinline body : T.() -> Unit) : Unit = {receiver.body()}()