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.
This commit is contained in:
Kristoffer Andersen
2019-10-24 15:53:43 +02:00
committed by Mikhael Bogdanov
parent 5360a7a3fe
commit 1074a0ef69
14 changed files with 311 additions and 233 deletions
@@ -0,0 +1,9 @@
// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType
// IGNORE_BACKEND: JS, JS_IR
fun foo(vararg l: Long, s: String = "OK"): String =
if (l.size == 0) s else "Fail"
inline fun bar(f: () -> String): String = f()
fun box(): String = bar(::foo)