JS test: added inline tests

This commit is contained in:
Alexey Tsvetkov
2014-09-29 16:00:18 +04:00
committed by Zalim Bashorov
parent 987708680f
commit 3f2d4b31be
112 changed files with 4442 additions and 0 deletions
@@ -0,0 +1,17 @@
/*
* Copy of JVM-backend test
* Found at: compiler/testData/codegen/boxInline/complex/closureChain.1.kt
*/
package foo
fun test1(): Int {
val inlineX = Inline()
return inlineX.foo({(z: Int) -> "" + z}, 25, {String.() -> this.length})
}
fun box(): String {
if (test1() != 2) return "test1: ${test1()}"
return "OK"
}
@@ -0,0 +1,14 @@
/*
* Copy of JVM-backend test
* Found at: compiler/testData/codegen/boxInline/complex/closureChain.2.kt
*/
package foo
class Inline() {
inline fun foo(closure1 : (l: Int) -> String, param: Int, closure2: String.() -> Int) : Int {
return closure1(param).closure2()
}
}