Test framework for inline
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import zzz.*
|
||||
|
||||
fun box(): String {
|
||||
|
||||
val p = { calc { 11 }} ()
|
||||
|
||||
val z = { calc { 12 }}()
|
||||
|
||||
if (p == z) return "fail"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package zzz
|
||||
|
||||
inline fun calc(lambda: () -> Int): Int {
|
||||
return doCalc { lambda() }
|
||||
}
|
||||
|
||||
fun doCalc(lambda2: () -> Int): Int {
|
||||
return lambda2()
|
||||
}
|
||||
Reference in New Issue
Block a user