PSI2IR: SAM conversion in varargs

This commit is contained in:
Dmitry Petrov
2020-01-29 16:15:01 +03:00
parent 186a456e01
commit 53f66e9509
9 changed files with 200 additions and 19 deletions
@@ -0,0 +1,21 @@
// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
fun interface IFoo {
fun foo(i: Int)
}
fun useVararg(vararg foos: IFoo) {}
fun testLambda() {
useVararg({})
}
fun testSeveralLambdas() {
useVararg({}, {}, {})
}
fun withVarargOfInt(vararg xs: Int) = ""
fun testAdaptedCR() {
useVararg(::withVarargOfInt)
}