Files
kotlin-fork/compiler/testData/codegen/box/callableReference/varargAndDefaults/inlineVarargInts.kt
T
Kristoffer Andersen 1074a0ef69 JVM_IR: Fix Inline CallableReferences with Varargs
- Added tests to demonstrate broken behaviour: the interaction of inline
  functions and callable references with varargs and defaults in various
  combinations.
- Refactored InlineCallableReferencesToLambdaPhase to look like and use
  some of the infrastructure from CallableReferenceLowering.
- Lifted some of this infrastructure out to be broadly reusable.
2019-10-31 08:15:22 +01:00

13 lines
239 B
Kotlin
Vendored

// !LANGUAGE: +NewInference
// WITH_RUNTIME
// IGNORE_BACKEND: JS, JS_IR
inline fun foo(x: (Int, Int) -> Int): Int =
x(120,3)
fun bar(vararg x: Int): Int =
x.sum()
fun box(): String =
if (foo(::bar) == 123) "OK" else "FAIL"