diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt index 6a1ef369b36..94e35d12994 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt @@ -295,7 +295,10 @@ private fun FirSession.createKFunctionType( else -> expectedParameterNumberWithReceiver } for ((index, valueParameter) in function.valueParameters.withIndex()) { - if (expectedParameterNumber == null || index < expectedParameterNumber || valueParameter.defaultValue == null) { + if (expectedParameterNumber == null || + index < expectedParameterNumber || + (valueParameter.defaultValue == null && !valueParameter.isVararg) + ) { parameterTypes += valueParameter.returnTypeRef.coneType } } diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/bothWithCoercionToUnit.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/bothWithCoercionToUnit.kt index fbb88415904..e5055ef0295 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/bothWithCoercionToUnit.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/bothWithCoercionToUnit.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType -// IGNORE_BACKEND_FIR: JVM_IR fun foo(s: String = "kotlin", vararg t: String): Boolean { if (s != "kotlin") throw AssertionError(s) diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/boundReferences.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/boundReferences.kt index e8fa1549a92..38689d0fb0e 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/boundReferences.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/boundReferences.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME import kotlin.test.assertEquals diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/defaultAfterVararg.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/defaultAfterVararg.kt index acf59a33b9f..22ef6bfe71f 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/defaultAfterVararg.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/defaultAfterVararg.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType -// IGNORE_BACKEND_FIR: JVM_IR fun foo(vararg a: String, result: String = "OK"): String = if (a.size == 0) result else "Fail" diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/emptyVarargAndDefault.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/emptyVarargAndDefault.kt index 9fcb33afc52..ef0e4d91f74 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/emptyVarargAndDefault.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/emptyVarargAndDefault.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType -// IGNORE_BACKEND_FIR: JVM_IR fun foo(x: String = "O", vararg y: String): String = if (y.size == 0) x + "K" else "Fail" diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineBound.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineBound.kt index 5be3db21c74..2a2db3f9ea0 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineBound.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineBound.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR inline fun foo(x: () -> Unit): String { x() diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineVarargAndDefault.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineVarargAndDefault.kt index e53c0238a15..65265b62c1a 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineVarargAndDefault.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/inlineVarargAndDefault.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType -// IGNORE_BACKEND_FIR: JVM_IR fun foo(vararg l: Long, s: String = "OK"): String = if (l.size == 0) s else "Fail" diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/manyDefaultsAndVararg.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/manyDefaultsAndVararg.kt index 4858662b33d..3c3d4a40b0e 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/manyDefaultsAndVararg.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/manyDefaultsAndVararg.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME import kotlin.test.assertEquals diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/simpleEmptyVararg.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/simpleEmptyVararg.kt index e61ff31dd06..4855dbc9202 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/simpleEmptyVararg.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/simpleEmptyVararg.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +NewInference -// IGNORE_BACKEND_FIR: JVM_IR fun foo(x: String, vararg y: String): String = if (y.size == 0) x + "K" else "Fail" diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/unboundReferences.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/unboundReferences.kt index b655c39e66a..35dd9d53e3f 100644 --- a/compiler/testData/codegen/box/callableReference/adaptedReferences/unboundReferences.kt +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/unboundReferences.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME import kotlin.test.assertEquals diff --git a/compiler/testData/codegen/box/callableReference/equality/varargWithDefaults.kt b/compiler/testData/codegen/box/callableReference/equality/varargWithDefaults.kt index f3fca8af34e..ae075f1f650 100644 --- a/compiler/testData/codegen/box/callableReference/equality/varargWithDefaults.kt +++ b/compiler/testData/codegen/box/callableReference/equality/varargWithDefaults.kt @@ -1,6 +1,5 @@ // IGNORE_BACKEND: JS, JS_IR, NATIVE // IGNORE_BACKEND: JS_IR_ES6 -// IGNORE_BACKEND_FIR: JVM_IR // FILE: test.kt fun checkEqual(x: Any, y: Any) { diff --git a/compiler/testData/codegen/box/callableReference/kt37604.kt b/compiler/testData/codegen/box/callableReference/kt37604.kt index ae7275bb81a..83f13e70955 100644 --- a/compiler/testData/codegen/box/callableReference/kt37604.kt +++ b/compiler/testData/codegen/box/callableReference/kt37604.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun useUnit(fn: () -> Unit) { fn.invoke() diff --git a/compiler/testData/codegen/box/funInterface/equality/functionReferencesBound.kt b/compiler/testData/codegen/box/funInterface/equality/functionReferencesBound.kt index ba461b05aac..54a7cf31fe8 100644 --- a/compiler/testData/codegen/box/funInterface/equality/functionReferencesBound.kt +++ b/compiler/testData/codegen/box/funInterface/equality/functionReferencesBound.kt @@ -1,5 +1,4 @@ // IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, NATIVE -// IGNORE_BACKEND_FIR: JVM_IR // FILE: test.kt fun checkEqual(x: Any, y: Any) { diff --git a/compiler/testData/codegen/box/funInterface/equality/functionReferencesUnbound.kt b/compiler/testData/codegen/box/funInterface/equality/functionReferencesUnbound.kt index 97b99451fbc..dc77d684d05 100644 --- a/compiler/testData/codegen/box/funInterface/equality/functionReferencesUnbound.kt +++ b/compiler/testData/codegen/box/funInterface/equality/functionReferencesUnbound.kt @@ -1,5 +1,4 @@ // IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, NATIVE -// IGNORE_BACKEND_FIR: JVM_IR // FILE: test.kt fun checkEqual(x: Any, y: Any) { diff --git a/compiler/testData/codegen/box/funInterface/equality/localFunctionReferences.kt b/compiler/testData/codegen/box/funInterface/equality/localFunctionReferences.kt index eb4a2527d1d..97fd88781f8 100644 --- a/compiler/testData/codegen/box/funInterface/equality/localFunctionReferences.kt +++ b/compiler/testData/codegen/box/funInterface/equality/localFunctionReferences.kt @@ -1,5 +1,4 @@ // IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, NATIVE -// IGNORE_BACKEND_FIR: JVM_IR fun checkEqual(x: Any, y: Any) { if (x != y || y != x) throw AssertionError("$x and $y should be equal") diff --git a/compiler/testData/codegen/box/sam/equality/functionReferencesBound.kt b/compiler/testData/codegen/box/sam/equality/functionReferencesBound.kt index 279ba8d1e22..5d79ac97185 100644 --- a/compiler/testData/codegen/box/sam/equality/functionReferencesBound.kt +++ b/compiler/testData/codegen/box/sam/equality/functionReferencesBound.kt @@ -1,5 +1,4 @@ // TARGET_BACKEND: JVM -// IGNORE_BACKEND_FIR: JVM_IR // FILE: test.kt fun checkNotEqual(x: Any, y: Any) { diff --git a/compiler/testData/codegen/box/sam/equality/functionReferencesUnbound.kt b/compiler/testData/codegen/box/sam/equality/functionReferencesUnbound.kt index e5bddf590f9..99a23660144 100644 --- a/compiler/testData/codegen/box/sam/equality/functionReferencesUnbound.kt +++ b/compiler/testData/codegen/box/sam/equality/functionReferencesUnbound.kt @@ -1,5 +1,4 @@ // TARGET_BACKEND: JVM -// IGNORE_BACKEND_FIR: JVM_IR // FILE: test.kt fun checkNotEqual(x: Any, y: Any) { diff --git a/compiler/testData/codegen/box/sam/equality/localFunctionReferences.kt b/compiler/testData/codegen/box/sam/equality/localFunctionReferences.kt index 6dcc52b9f7d..78cc674e8b7 100644 --- a/compiler/testData/codegen/box/sam/equality/localFunctionReferences.kt +++ b/compiler/testData/codegen/box/sam/equality/localFunctionReferences.kt @@ -1,5 +1,4 @@ // TARGET_BACKEND: JVM -// IGNORE_BACKEND_FIR: JVM_IR fun checkNotEqual(x: Any, y: Any) { if (x == y || y == x) throw AssertionError("$x and $y should NOT be equal") diff --git a/compiler/testData/diagnostics/tests/callableReference/referenceAdaptationHasDependencyOnApi14.fir.kt b/compiler/testData/diagnostics/tests/callableReference/referenceAdaptationHasDependencyOnApi14.fir.kt index 30c0351fb91..6b813f4e609 100644 --- a/compiler/testData/diagnostics/tests/callableReference/referenceAdaptationHasDependencyOnApi14.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/referenceAdaptationHasDependencyOnApi14.fir.kt @@ -13,6 +13,6 @@ fun allOfTheAbove(f: (A) -> Unit): Any = f fun test() { coercionToUnit(A::foo) varargToElement(A::foo) - defaultAndVararg(A::foo) - allOfTheAbove(A::foo) + defaultAndVararg(A::foo) + allOfTheAbove(A::foo) } \ No newline at end of file diff --git a/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.fir.txt index 544e408c4a8..25d639ce264 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.fir.txt @@ -43,13 +43,13 @@ FILE fqName: fileName:/adaptedExtensionFunctions.kt BLOCK_BODY FUN name:testExtensionVararg visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun extensionVararg (i: kotlin.Int, vararg s: kotlin.String): kotlin.Unit declared in ' type=kotlin.reflect.KFunction3<.C, kotlin.Int, kotlin.Array, kotlin.Unit> origin=null reflectionTarget= + CALL 'public final fun use (f: kotlin.Function2<.C, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + f: FUNCTION_REFERENCE 'public final fun extensionVararg (i: kotlin.Int, vararg s: kotlin.String): kotlin.Unit declared in ' type=kotlin.reflect.KFunction2<.C, kotlin.Int, kotlin.Unit> origin=null reflectionTarget= FUN name:testExtensionDefault visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun use (f: kotlin.Function2<.C, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null f: FUNCTION_REFERENCE 'public final fun extensionDefault (i: kotlin.Int, s: kotlin.String): kotlin.Unit declared in ' type=kotlin.reflect.KFunction2<.C, kotlin.Int, kotlin.Unit> origin=null reflectionTarget= FUN name:testExtensionBoth visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun extensionBoth (i: kotlin.Int, s: kotlin.String, vararg t: kotlin.String): kotlin.Unit declared in ' type=kotlin.reflect.KFunction4<.C, kotlin.Int, kotlin.String, kotlin.Array, kotlin.Unit> origin=null reflectionTarget= + CALL 'public final fun use (f: kotlin.Function2<.C, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + f: FUNCTION_REFERENCE 'public final fun extensionBoth (i: kotlin.Int, s: kotlin.String, vararg t: kotlin.String): kotlin.Unit declared in ' type=kotlin.reflect.KFunction2<.C, kotlin.Int, kotlin.Unit> origin=null reflectionTarget= diff --git a/compiler/testData/ir/irText/expressions/callableReferences/adaptedWithCoercionToUnit.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/adaptedWithCoercionToUnit.fir.txt index b30b70682cc..a13c6d537c2 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/adaptedWithCoercionToUnit.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/adaptedWithCoercionToUnit.fir.txt @@ -29,11 +29,11 @@ FILE fqName: fileName:/adaptedWithCoercionToUnit.kt RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.Unit declared in ' CALL 'public final fun useUnit1 (fn: kotlin.Function1): kotlin.Unit declared in ' type=kotlin.Unit origin=null fn: FUNCTION_REFERENCE 'public final fun fn1 (x: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= - FUN name:testV0 visibility:public modality:FINAL <> () returnType:IrErrorType + FUN name:testV0 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testV0 (): IrErrorType declared in ' - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun fnv (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + RETURN type=kotlin.Nothing from='public final fun testV0 (): kotlin.Unit declared in ' + CALL 'public final fun useUnit0 (fn: kotlin.Function0): kotlin.Unit declared in ' type=kotlin.Unit origin=null + fn: FUNCTION_REFERENCE 'public final fun fnv (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction0 origin=null reflectionTarget= FUN name:testV1 visibility:public modality:FINAL <> () returnType:IrErrorType BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testV1 (): IrErrorType declared in ' diff --git a/compiler/testData/ir/irText/expressions/callableReferences/boundInlineAdaptedReference.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/boundInlineAdaptedReference.fir.txt index 497ce2c4985..a5fef3bec64 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/boundInlineAdaptedReference.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/boundInlineAdaptedReference.fir.txt @@ -13,6 +13,6 @@ FILE fqName:test fileName:/boundInlineAdaptedReference.kt GET_VAR 's: kotlin.String declared in test.id' type=kotlin.String origin=null FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun id (s: kotlin.String, vararg xs: kotlin.Int): kotlin.String declared in test' type=kotlin.reflect.KFunction2 origin=null reflectionTarget= + CALL 'public final fun foo (x: kotlin.Function0): kotlin.Unit [inline] declared in test' type=kotlin.Unit origin=null + x: FUNCTION_REFERENCE 'public final fun id (s: kotlin.String, vararg xs: kotlin.Int): kotlin.String declared in test' type=kotlin.reflect.KFunction0 origin=null reflectionTarget= $receiver: CONST String type=kotlin.String value="Fail" diff --git a/compiler/testData/ir/irText/expressions/callableReferences/funWithDefaultParametersAsKCallableStar.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/funWithDefaultParametersAsKCallableStar.fir.txt index a5531dd449b..900c3b98109 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/funWithDefaultParametersAsKCallableStar.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/funWithDefaultParametersAsKCallableStar.fir.txt @@ -66,7 +66,7 @@ FILE fqName: fileName:/funWithDefaultParametersAsKCallableStar.kt FUN name:testVarargsStar visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun useKCallableStar (fn: kotlin.reflect.KCallable<*>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - fn: FUNCTION_REFERENCE 'public final fun varargs (vararg xs: kotlin.String): kotlin.Int declared in ' type=kotlin.reflect.KFunction1, kotlin.Int> origin=null reflectionTarget= + fn: FUNCTION_REFERENCE 'public final fun varargs (vararg xs: kotlin.String): kotlin.Int declared in ' type=kotlin.reflect.KFunction0 origin=null reflectionTarget= FUN name:testCtorStar visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun useKCallableStar (fn: kotlin.reflect.KCallable<*>): kotlin.Unit declared in ' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.fir.txt index 6cf94d8293e..6628be0fa48 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.fir.txt @@ -89,8 +89,8 @@ FILE fqName: fileName:/withAdaptedArguments.kt RETURN type=kotlin.Nothing from='public final fun testDefault0 (): kotlin.String declared in ' CALL 'public final fun use0 (fn: kotlin.Function0): kotlin.String declared in ' type=kotlin.String origin=null fn: FUNCTION_REFERENCE 'public final fun fnWithDefaults (a: kotlin.Int, b: kotlin.Int): kotlin.String declared in ' type=kotlin.reflect.KFunction0 origin=null reflectionTarget= - FUN name:testVararg0 visibility:public modality:FINAL <> () returnType:IrErrorType + FUN name:testVararg0 visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testVararg0 (): IrErrorType declared in ' - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun fnWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + RETURN type=kotlin.Nothing from='public final fun testVararg0 (): kotlin.String declared in ' + CALL 'public final fun use0 (fn: kotlin.Function0): kotlin.String declared in ' type=kotlin.String origin=null + fn: FUNCTION_REFERENCE 'public final fun fnWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in ' type=kotlin.reflect.KFunction0 origin=null reflectionTarget= diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.fir.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.fir.txt index 4db54cb0622..fdf8029e62b 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.fir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.fir.txt @@ -31,11 +31,11 @@ FILE fqName: fileName:/samConversionOnCallableReference.kt RETURN type=kotlin.Nothing from='public final fun testSamConstructor (): .KRunnable declared in ' TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable FUNCTION_REFERENCE 'public final fun foo0 (): kotlin.Unit declared in ' type=kotlin.reflect.KFunction0 origin=null reflectionTarget= - FUN name:testSamCosntructorOnAdapted visibility:public modality:FINAL <> () returnType:IrErrorType + FUN name:testSamCosntructorOnAdapted visibility:public modality:FINAL <> () returnType:.KRunnable BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testSamCosntructorOnAdapted (): IrErrorType declared in ' - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun foo1 (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + RETURN type=kotlin.Nothing from='public final fun testSamCosntructorOnAdapted (): .KRunnable declared in ' + TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable + FUNCTION_REFERENCE 'public final fun foo1 (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction0 origin=null reflectionTarget= FUN name:testSamConversion visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun use (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -43,5 +43,6 @@ FILE fqName: fileName:/samConversionOnCallableReference.kt FUNCTION_REFERENCE 'public final fun foo0 (): kotlin.Unit declared in ' type=kotlin.reflect.KFunction0 origin=null reflectionTarget= FUN name:testSamConversionOnAdapted visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun foo1 (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + CALL 'public final fun use (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null + r: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable + FUNCTION_REFERENCE 'public final fun foo1 (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction0 origin=null reflectionTarget=