Files
kotlin-fork/js/js.translator/testData/inline/cases/rootConstructor.kt
T
2014-10-03 14:23:47 +04:00

24 lines
418 B
Kotlin

/*
* Copy of JVM-backend test
* Found at: compiler/testData/codegen/boxInline/simple/rootConstructor.1.kt
*/
package foo
import kotlin.InlineOption.*
inline fun <R> doWork(inlineOptions(ONLY_LOCAL_RETURN) job: ()-> R) : R {
return notInline({job()})
}
fun <R> notInline(job: ()-> R) : R {
return job()
}
val s = doWork({11})
fun box(): String {
if (s != 11) return "test1: ${s}"
return "OK"
}