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

24 lines
431 B
Kotlin
Vendored

/*
* Copy of JVM-backend test
* Found at: compiler/testData/codegen/boxInline/simple/severalUsage.1.kt
*/
package foo
public inline fun <R> runTest(f: () -> R): R {
return f()
}
public inline fun <R> minByTest(f: (Int) -> R): R {
var minValue = f(1)
val v = f(1)
return v
}
fun box(): String {
val result = runTest{minByTest<Int> { it }}
if (result != 1) return "test1: ${result}"
return "OK"
}