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,35 @@
/*
* Copy of JVM-backend test
* Found at: compiler/testData/codegen/boxInline/anonymousObject/anonymousObjectOnCallSite.1.kt
*/
package foo
import test.*
fun box() : String {
val o = "O"
val p = "GOOD"
val result = doWork {
val k = "K"
val s = object : A<String>() {
val param = p;
override fun getO(): String {
return o;
}
override fun getK(): String {
return k;
}
}
s.getO() + s.getK() + s.param
}
if (result != "OKGOOD") return "fail $result"
return "OK"
}
@@ -0,0 +1,17 @@
/*
* Copy of JVM-backend test
* Found at: compiler/testData/codegen/boxInline/anonymousObject/anonymousObjectOnCallSite.2.kt
*/
package test
abstract class A<R> {
abstract fun getO() : R
abstract fun getK() : R
}
inline fun <R> doWork(job: ()-> R) : R {
return job()
}