Test framework for inline
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
fun test1(): Int {
|
||||
return calc( {(l : Int) -> 2*l}, {(l : Int) -> 4*l})
|
||||
}
|
||||
|
||||
|
||||
fun box(): String {
|
||||
if (test1() != 110) return "test1: ${test1()}"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
inline fun calc(s: (Int) -> Int, noinline p: (Int) -> Int) : Int {
|
||||
val z = p
|
||||
return s(11) + z(11) + p(11)
|
||||
}
|
||||
Reference in New Issue
Block a user