JS test: added inline tests
This commit is contained in:
committed by
Zalim Bashorov
parent
987708680f
commit
3f2d4b31be
@@ -0,0 +1,23 @@
|
||||
package foo
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: doNothingNoInline
|
||||
|
||||
inline fun <T> doNothing1(a: T): T {
|
||||
return a
|
||||
}
|
||||
|
||||
inline fun <T> doNothing2(a: T, inline f: (T) -> T): T {
|
||||
return f(a)
|
||||
}
|
||||
|
||||
fun doNothingNoInline(a: Int): Int {
|
||||
return doNothing2(a, {(x) -> doNothing1(x)})
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
assertEquals(1, doNothingNoInline(1))
|
||||
assertEquals(12, doNothingNoInline(12))
|
||||
assertEquals(12, doNothingNoInline(12))
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user