Files
kotlin-fork/compiler/testData/codegen/boxInline/callableReference/adaptedReferences/inlineVararg.kt
T
2021-10-02 06:14:35 +00:00

21 lines
381 B
Kotlin
Vendored

// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: IGNORED_IN_JS
// !LANGUAGE: +NewInference
// FILE: 1.kt
package test
inline fun foo(f: (Int, Int) -> Int): Int =
f(42, 117)
inline fun bar (vararg xs: Int): Int {
var sum = 0
for (x in xs) sum += x
return sum
}
// FILE: 2.kt
import test.*
fun box(): String = if (foo(::bar) == 159) "OK" else "fail"