FIR: support adapted callable reference with vararg

This commit is contained in:
Jinseong Jeon
2020-07-31 23:34:51 -07:00
committed by Mikhail Glukhikh
parent 4332e95b8a
commit 0e54f98b79
24 changed files with 120 additions and 90 deletions
@@ -1,6 +1,4 @@
// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType
// IGNORE_BACKEND_FIR: JVM_IR
class Outer(val o: String) {
inner class Inner1(val i: Int, vararg v: String) {
@@ -1,5 +1,4 @@
// !LANGUAGE: +NewInference
// IGNORE_BACKEND_FIR: JVM_IR
fun foo(
f: (
@@ -1,5 +1,4 @@
// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType
// IGNORE_BACKEND_FIR: JVM_IR
fun call0(f: (String) -> String, x: String): String = f(x)
fun call1(f: (String, String) -> String, x: String, y: String): String = f(x, y)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// !LANGUAGE: +NewInference
fun sum(vararg args: Int): Int {
@@ -1,5 +1,4 @@
// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType
// IGNORE_BACKEND_FIR: JVM_IR
fun foo(x: Int, s: Int, vararg y: CharSequence = arrayOf("Aaa")): String =
if (y.size == s && y[0].length == x) "OK" else "Fail"
@@ -1,5 +1,4 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_REFLECT
import java.io.*
@@ -7,7 +7,7 @@ fun test(i: IntArray) {
myLet(::foo)
<!INAPPLICABLE_CANDIDATE!>myLet<!><Int>(<!UNRESOLVED_REFERENCE!>::foo<!>)
myLet<IntArray>(::foo)
<!INAPPLICABLE_CANDIDATE!>myLetExplicit1<!>(<!UNRESOLVED_REFERENCE!>::foo<!>)
myLetExplicit1(::foo)
myLetExplicit2(::foo)
}
@@ -36,7 +36,7 @@ object Test3 {
fun test() {
val result = foo(::bar)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>result<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>result<!>
}
}
}
@@ -12,7 +12,7 @@ fun allOfTheAbove(f: (A) -> Unit): Any = f
fun test() {
coercionToUnit(A::foo)
<!INAPPLICABLE_CANDIDATE!>varargToElement<!>(<!UNRESOLVED_REFERENCE!>A::foo<!>)
varargToElement(A::foo)
defaultAndVararg(A::foo)
allOfTheAbove(A::foo)
}
@@ -6,5 +6,5 @@ fun foo(i: Int) {}
val fn1: (Int) -> Unit = ::foo
val fn2: (IntArray) -> Unit = ::foo
val fn3: (Int, Int) -> Unit = <!UNRESOLVED_REFERENCE!>::foo<!>
val fn3: (Int, Int) -> Unit = ::foo
val fn4: (Array<String>) -> Unit = ::foo
@@ -1,21 +0,0 @@
// !LANGUAGE: +SuspendConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun unitCoercion(f: suspend () -> Unit) {}
fun foo(): Int = 0
fun defaults(f: suspend (Int) -> String) {}
fun bar(i: Int, l: Long = 42L): String = ""
fun varargs(f: suspend (Int, Int, Int) -> String) {}
fun baz(vararg ints: Int): String = ""
fun unitCoercionAndDefaults(f: suspend () -> Unit) {}
fun all(s: String = ""): Int = 0
fun test() {
unitCoercion(::foo)
defaults(::bar)
<!INAPPLICABLE_CANDIDATE!>varargs<!>(<!UNRESOLVED_REFERENCE!>::baz<!>)
unitCoercionAndDefaults(::all)
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +SuspendConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER
@@ -17,13 +17,13 @@ fun useMixedStringArgs3(fn: (String, Array<String>, String) -> Unit) = fn("foo",
fun useTwoStringArrays(fn: (Array<String>, Array<String>) -> Unit) = fn(arrayOf("foo", "bar"), arrayOf("baz", "boo"))
fun test() {
<!INAPPLICABLE_CANDIDATE!>useStrings<!>(<!UNRESOLVED_REFERENCE!>::stringVararg<!>)
useStrings(::stringVararg)
useStringArray(::stringVararg)
useIntArray(::numberVararg)
usePrimitiveIntArray(::intVararg)
<!INAPPLICABLE_CANDIDATE!>useIntArray<!>(<!UNRESOLVED_REFERENCE!>::intVararg<!>)
<!INAPPLICABLE_CANDIDATE!>useMixedStringArgs1<!>(<!UNRESOLVED_REFERENCE!>::stringVararg<!>)
<!INAPPLICABLE_CANDIDATE!>useMixedStringArgs2<!>(<!UNRESOLVED_REFERENCE!>::stringVararg<!>)
useMixedStringArgs2(::stringVararg)
<!INAPPLICABLE_CANDIDATE!>useMixedStringArgs3<!>(<!UNRESOLVED_REFERENCE!>::stringVararg<!>)
<!INAPPLICABLE_CANDIDATE!>useTwoStringArrays<!>(<!UNRESOLVED_REFERENCE!>::stringVararg<!>)
useTwoStringArrays(::stringVararg)
}
@@ -37,5 +37,5 @@ FILE fqName:<root> fileName:/adaptedWithCoercionToUnit.kt
FUN name:testV1 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testV1 (): kotlin.Unit declared in <root>'
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /useUnit1>#' type=kotlin.Unit
ERROR_CALL 'Unsupported callable reference: ::<Unresolved reference: fnv>#' type=IrErrorType
CALL 'public final fun useUnit1 (fn: kotlin.Function1<kotlin.Int, kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
fn: FUNCTION_REFERENCE 'public final fun fnv (vararg xs: kotlin.Int): kotlin.Int declared in <root>' type=kotlin.reflect.KFunction1<kotlin.Int, kotlin.Unit> origin=null reflectionTarget=<same>
@@ -69,16 +69,18 @@ FILE fqName:<root> fileName:/constructorWithAdaptedArguments.kt
FUN name:testConstructor visibility:public modality:FINAL <> () returnType:kotlin.Any
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testConstructor (): kotlin.Any declared in <root>'
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /use>#' type=kotlin.Any
ERROR_CALL 'Unsupported callable reference: ::<Unresolved reference: C>#' type=IrErrorType
CALL 'public final fun use (fn: kotlin.Function1<kotlin.Int, kotlin.Any>): kotlin.Any declared in <root>' type=kotlin.Any origin=null
fn: FUNCTION_REFERENCE 'public constructor <init> (vararg xs: kotlin.Int) [primary] declared in <root>.C' type=kotlin.reflect.KFunction1<kotlin.Int, <root>.C> origin=null reflectionTarget=<same>
FUN name:testInnerClassConstructor visibility:public modality:FINAL <> (outer:<root>.Outer) returnType:kotlin.Any
VALUE_PARAMETER name:outer index:0 type:<root>.Outer
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testInnerClassConstructor (outer: <root>.Outer): kotlin.Any declared in <root>'
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /use>#' type=kotlin.Any
ERROR_CALL 'Unsupported callable reference: R|<local>/outer|::<Unresolved reference: Inner>#' type=IrErrorType
CALL 'public final fun use (fn: kotlin.Function1<kotlin.Int, kotlin.Any>): kotlin.Any declared in <root>' type=kotlin.Any origin=null
fn: FUNCTION_REFERENCE 'public constructor <init> (vararg xs: kotlin.Int) [primary] declared in <root>.Outer.Inner' type=kotlin.reflect.KFunction1<kotlin.Int, <root>.Outer.Inner> origin=null reflectionTarget=<same>
$this: GET_VAR 'outer: <root>.Outer declared in <root>.testInnerClassConstructor' type=<root>.Outer origin=null
FUN name:testInnerClassConstructorCapturingOuter visibility:public modality:FINAL <> () returnType:kotlin.Any
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testInnerClassConstructorCapturingOuter (): kotlin.Any declared in <root>'
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /use>#' type=kotlin.Any
ERROR_CALL 'Unsupported callable reference: R|/Outer.Outer|()::<Unresolved reference: Inner>#' type=IrErrorType
CALL 'public final fun use (fn: kotlin.Function1<kotlin.Int, kotlin.Any>): kotlin.Any declared in <root>' type=kotlin.Any origin=null
fn: FUNCTION_REFERENCE 'public constructor <init> (vararg xs: kotlin.Int) [primary] declared in <root>.Outer.Inner' type=kotlin.reflect.KFunction1<kotlin.Int, <root>.Outer.Inner> origin=null reflectionTarget=<same>
$this: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Outer' type=<root>.Outer origin=null
@@ -82,8 +82,12 @@ FILE fqName:<root> fileName:/suspendConversion.kt
CALL 'public final fun foo2 (vararg xs: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
FUN name:testWithVarargMapped visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /useSuspendInt>#' type=kotlin.Unit
ERROR_CALL 'Unsupported callable reference: ::<Unresolved reference: foo2>#' type=IrErrorType
CALL 'public final fun useSuspendInt (fn: kotlin.coroutines.SuspendFunction1<kotlin.Int, kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
fn: FUN_EXPR type=kotlin.coroutines.SuspendFunction1<kotlin.Int, kotlin.Unit> origin=ADAPTED_FUNCTION_REFERENCE
FUN ADAPTER_FOR_CALLABLE_REFERENCE name:foo2 visibility:local modality:FINAL <> (p0:kotlin.Int) returnType:kotlin.Unit [suspend]
VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:p0 index:0 type:kotlin.Int
BLOCK_BODY
CALL 'public final fun foo2 (vararg xs: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
FUN name:testWithCoercionToUnit visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
CALL 'public final fun useSuspend (fn: kotlin.coroutines.SuspendFunction0<kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
@@ -59,14 +59,16 @@ FILE fqName:<root> fileName:/unboundMemberReferenceWithAdaptedArguments.kt
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:testUnbound visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /use1>#' type=kotlin.Unit
ERROR_CALL 'Unsupported callable reference: Q|A|::<Unresolved reference: foo>#' type=IrErrorType
CALL 'public final fun use1 (fn: kotlin.Function2<<root>.A, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
fn: FUNCTION_REFERENCE 'public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in <root>.A' type=kotlin.reflect.KFunction2<<root>.A, kotlin.Int, kotlin.Unit> origin=null reflectionTarget=<same>
FUN name:testBound visibility:public modality:FINAL <> (a:<root>.A) returnType:kotlin.Unit
VALUE_PARAMETER name:a index:0 type:<root>.A
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /use2>#' type=kotlin.Unit
ERROR_CALL 'Unsupported callable reference: R|<local>/a|::<Unresolved reference: foo>#' type=IrErrorType
CALL 'public final fun use2 (fn: kotlin.Function1<kotlin.Int, kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
fn: FUNCTION_REFERENCE 'public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in <root>.A' type=kotlin.reflect.KFunction1<kotlin.Int, kotlin.Unit> origin=null reflectionTarget=<same>
$this: GET_VAR 'a: <root>.A declared in <root>.testBound' type=<root>.A origin=null
FUN name:testObject visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /use2>#' type=kotlin.Unit
ERROR_CALL 'Unsupported callable reference: Q|Obj|::<Unresolved reference: foo>#' type=IrErrorType
CALL 'public final fun use2 (fn: kotlin.Function1<kotlin.Int, kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
fn: FUNCTION_REFERENCE 'public final fun foo (vararg xs: kotlin.Int): kotlin.Int declared in <root>.Obj' type=kotlin.reflect.KFunction1<kotlin.Int, kotlin.Unit> origin=null reflectionTarget=<same>
$this: GET_OBJECT 'CLASS OBJECT name:Obj modality:FINAL visibility:public superTypes:[<root>.A]' type=<root>.Obj
@@ -27,5 +27,6 @@ FILE fqName:<root> fileName:/withAdaptationForSam.kt
CONST Int type=kotlin.Int value=42
FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /useFoo>#' type=kotlin.Unit
ERROR_CALL 'Unsupported callable reference: ::<Unresolved reference: withVararg>#' type=IrErrorType
CALL 'public final fun useFoo (foo: <root>.IFoo): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
foo: TYPE_OP type=<root>.IFoo origin=SAM_CONVERSION typeOperand=<root>.IFoo
FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in <root>' type=kotlin.reflect.KFunction1<kotlin.Int, kotlin.Unit> origin=null reflectionTarget=<same>
@@ -71,8 +71,8 @@ FILE fqName:<root> fileName:/withAdaptedArguments.kt
FUN name:testVararg visibility:public modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testVararg (): kotlin.String declared in <root>'
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /use>#' type=kotlin.String
ERROR_CALL 'Unsupported callable reference: ::<Unresolved reference: fnWithVarargs>#' type=IrErrorType
CALL 'public final fun use (fn: kotlin.Function1<kotlin.Int, kotlin.String>): kotlin.String declared in <root>' type=kotlin.String origin=null
fn: FUNCTION_REFERENCE 'public final fun fnWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in <root>' type=kotlin.reflect.KFunction1<kotlin.Int, kotlin.String> origin=null reflectionTarget=<same>
FUN name:testCoercionToUnit visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testCoercionToUnit (): kotlin.Unit declared in <root>'
@@ -81,8 +81,9 @@ FILE fqName:<root> fileName:/withAdaptedArguments.kt
FUN name:testImportedObjectMember visibility:public modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testImportedObjectMember (): kotlin.String declared in <root>'
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /use>#' type=kotlin.String
ERROR_CALL 'Unsupported callable reference: ::<Unresolved reference: importedObjectMemberWithVarargs>#' type=IrErrorType
CALL 'public final fun use (fn: kotlin.Function1<kotlin.Int, kotlin.String>): kotlin.String declared in <root>' type=kotlin.String origin=null
fn: FUNCTION_REFERENCE 'public final fun importedObjectMemberWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in <root>.Host' type=kotlin.reflect.KFunction1<kotlin.Int, kotlin.String> origin=null reflectionTarget=<same>
$this: GET_OBJECT 'CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Host
FUN name:testDefault0 visibility:public modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testDefault0 (): kotlin.String declared in <root>'
@@ -20,33 +20,38 @@ FILE fqName:<root> fileName:/withArgumentAdaptationAndReceiver.kt
FUN name:testImplicitThis visibility:public modality:FINAL <> ($this:<root>.Host) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Host
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /use>#' type=kotlin.Unit
ERROR_CALL 'Unsupported callable reference: ::<Unresolved reference: withVararg>#' type=IrErrorType
CALL 'public final fun use (fn: kotlin.Function1<kotlin.Int, kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
fn: FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in <root>.Host' type=kotlin.reflect.KFunction1<kotlin.Int, kotlin.Unit> origin=null reflectionTarget=<same>
$this: GET_VAR '<this>: <root>.Host declared in <root>.Host.testImplicitThis' type=<root>.Host origin=null
FUN name:testBoundReceiverLocalVal visibility:public modality:FINAL <> ($this:<root>.Host) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Host
BLOCK_BODY
VAR name:h type:<root>.Host [val]
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Host' type=<root>.Host origin=null
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /use>#' type=kotlin.Unit
ERROR_CALL 'Unsupported callable reference: R|<local>/h|::<Unresolved reference: withVararg>#' type=IrErrorType
CALL 'public final fun use (fn: kotlin.Function1<kotlin.Int, kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
fn: FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in <root>.Host' type=kotlin.reflect.KFunction1<kotlin.Int, kotlin.Unit> origin=null reflectionTarget=<same>
$this: GET_VAR 'val h: <root>.Host [val] declared in <root>.Host.testBoundReceiverLocalVal' type=<root>.Host origin=null
FUN name:testBoundReceiverLocalVar visibility:public modality:FINAL <> ($this:<root>.Host) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Host
BLOCK_BODY
VAR name:h type:<root>.Host [var]
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Host' type=<root>.Host origin=null
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /use>#' type=kotlin.Unit
ERROR_CALL 'Unsupported callable reference: R|<local>/h|::<Unresolved reference: withVararg>#' type=IrErrorType
CALL 'public final fun use (fn: kotlin.Function1<kotlin.Int, kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
fn: FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in <root>.Host' type=kotlin.reflect.KFunction1<kotlin.Int, kotlin.Unit> origin=null reflectionTarget=<same>
$this: GET_VAR 'var h: <root>.Host [var] declared in <root>.Host.testBoundReceiverLocalVar' type=<root>.Host origin=null
FUN name:testBoundReceiverParameter visibility:public modality:FINAL <> ($this:<root>.Host, h:<root>.Host) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Host
VALUE_PARAMETER name:h index:0 type:<root>.Host
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /use>#' type=kotlin.Unit
ERROR_CALL 'Unsupported callable reference: R|<local>/h|::<Unresolved reference: withVararg>#' type=IrErrorType
CALL 'public final fun use (fn: kotlin.Function1<kotlin.Int, kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
fn: FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in <root>.Host' type=kotlin.reflect.KFunction1<kotlin.Int, kotlin.Unit> origin=null reflectionTarget=<same>
$this: GET_VAR 'h: <root>.Host declared in <root>.Host.testBoundReceiverParameter' type=<root>.Host origin=null
FUN name:testBoundReceiverExpression visibility:public modality:FINAL <> ($this:<root>.Host) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Host
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /use>#' type=kotlin.Unit
ERROR_CALL 'Unsupported callable reference: R|/Host.Host|()::<Unresolved reference: withVararg>#' type=IrErrorType
CALL 'public final fun use (fn: kotlin.Function1<kotlin.Int, kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
fn: FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in <root>.Host' type=kotlin.reflect.KFunction1<kotlin.Int, kotlin.Unit> origin=null reflectionTarget=<same>
$this: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Host' type=<root>.Host origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
@@ -60,8 +60,8 @@ FILE fqName:<root> fileName:/withVarargViewedAsArray.kt
BLOCK_BODY
FUN name:testPlainArgs visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /usePlainArgs>#' type=kotlin.Unit
ERROR_CALL 'Unsupported callable reference: ::<Unresolved reference: sum>#' type=IrErrorType
CALL 'public final fun usePlainArgs (fn: kotlin.Function2<kotlin.Int, kotlin.Int, kotlin.Int>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
fn: FUNCTION_REFERENCE 'public final fun sum (vararg args: kotlin.Int): kotlin.Int declared in <root>' type=kotlin.reflect.KFunction2<kotlin.Int, kotlin.Int, kotlin.Int> origin=null reflectionTarget=<same>
FUN name:testPrimitiveArrayAsVararg visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
CALL 'public final fun usePrimitiveArray (fn: kotlin.Function1<kotlin.IntArray, kotlin.Int>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
@@ -59,5 +59,6 @@ FILE fqName:<root> fileName:/samConversionInVarargs.kt
CONST String type=kotlin.String value=""
FUN name:testAdaptedCR visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
ERROR_CALL 'Unresolved reference: <Inapplicable(INAPPLICABLE): /useVararg>#' type=kotlin.Unit
ERROR_CALL 'Unsupported callable reference: ::<Unresolved reference: withVarargOfInt>#' type=IrErrorType
CALL 'public final fun useVararg (vararg foos: <root>.IFoo): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
foos: VARARG type=kotlin.Array<out <root>.IFoo> varargElementType=<root>.IFoo
FUNCTION_REFERENCE 'public final fun withVarargOfInt (vararg xs: kotlin.Int): kotlin.String declared in <root>' type=kotlin.reflect.KFunction1<kotlin.Int, kotlin.Unit> origin=null reflectionTarget=<same>