diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConfiguration.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConfiguration.kt index 562cc7932a7..acb173bf739 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConfiguration.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConfiguration.kt @@ -70,12 +70,11 @@ class Fir2IrConfiguration private constructor( fun forKlibCompilation( compilerConfiguration: CompilerConfiguration, diagnosticReporter: DiagnosticReporter, - linkViaSignatures: Boolean = false, // FIXME(KT-64809): This parameter is only used in irText tests, we need to remove it. ): Fir2IrConfiguration = Fir2IrConfiguration( languageVersionSettings = compilerConfiguration.languageVersionSettings, diagnosticReporter = diagnosticReporter, - linkViaSignatures = linkViaSignatures, + linkViaSignatures = false, evaluatedConstTracker = compilerConfiguration.putIfAbsent( CommonConfigurationKeys.EVALUATED_CONST_TRACKER, EvaluatedConstTracker.create(), diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt index 7cbd56f9a04..997ca90a966 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt @@ -47,6 +47,7 @@ import org.jetbrains.kotlin.ir.types.* import org.jetbrains.kotlin.ir.util.dump import org.jetbrains.kotlin.ir.util.isPrimitiveArray import org.jetbrains.kotlin.ir.util.isUnsignedArray +import org.jetbrains.kotlin.ir.util.render import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.resolve.calls.NewCommonSuperTypeCalculator.commonSuperType import org.jetbrains.kotlin.types.Variance @@ -925,10 +926,15 @@ class CallAndReferenceGenerator( } } } else { - val name = if (this is IrCallImpl) symbol.signature.toString() else "???" + val calleeSymbol = (this as? IrCallImpl)?.symbol + + @OptIn(UnsafeDuringIrConstructionAPI::class) + val description = calleeSymbol?.signature?.render() + ?: calleeSymbol?.takeIf { it.isBound }?.owner?.render() + ?: "???" IrErrorCallExpressionImpl( startOffset, endOffset, type, - "Cannot bind $argumentsCount arguments to $name call with $valueArgumentsCount parameters" + "Cannot bind $argumentsCount arguments to '$description' call with $valueArgumentsCount parameters" ).apply { for (argument in call.arguments) { addArgument(visitor.convertToIrExpression(argument)) diff --git a/compiler/testData/ir/irText/expressions/badInlinedBreakContinue.fir.ir.txt b/compiler/testData/ir/irText/expressions/badInlinedBreakContinue.fir.ir.txt index 620bd21c3fa..7ceb2a76aef 100644 --- a/compiler/testData/ir/irText/expressions/badInlinedBreakContinue.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/badInlinedBreakContinue.fir.ir.txt @@ -42,7 +42,7 @@ FILE fqName: fileName:/badInlinedBreakContinue.kt CALL 'public final fun invoke (value: T of kotlin.invoke): R of kotlin.invoke declared in kotlin' type=IrErrorType(null) origin=null : IrErrorType(null) : IrErrorType(null) - $receiver: ERROR_CALL 'Cannot bind 1 arguments to kotlin/Function0.invoke|invoke(){}[0] call with 0 parameters' type=kotlin.Nothing + $receiver: ERROR_CALL 'Cannot bind 1 arguments to 'FUN IR_EXTERNAL_DECLARATION_STUB name:invoke visibility:public modality:ABSTRACT <> ($this:kotlin.Function0) returnType:R of kotlin.Function0 [operator]' call with 0 parameters' type=kotlin.Nothing FUN_EXPR type=kotlin.Function0 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Nothing BLOCK_BODY @@ -86,7 +86,7 @@ FILE fqName: fileName:/badInlinedBreakContinue.kt CALL 'public final fun invoke (value: T of kotlin.invoke): R of kotlin.invoke declared in kotlin' type=IrErrorType(null) origin=null : IrErrorType(null) : IrErrorType(null) - $receiver: ERROR_CALL 'Cannot bind 1 arguments to kotlin/Function0.invoke|invoke(){}[0] call with 0 parameters' type=kotlin.Nothing + $receiver: ERROR_CALL 'Cannot bind 1 arguments to 'FUN IR_EXTERNAL_DECLARATION_STUB name:invoke visibility:public modality:ABSTRACT <> ($this:kotlin.Function0) returnType:R of kotlin.Function0 [operator]' call with 0 parameters' type=kotlin.Nothing FUN_EXPR type=kotlin.Function0 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Nothing BLOCK_BODY @@ -134,7 +134,7 @@ FILE fqName: fileName:/badInlinedBreakContinue.kt CALL 'public final fun invoke (value: T of kotlin.invoke): R of kotlin.invoke declared in kotlin' type=IrErrorType(null) origin=null : IrErrorType(null) : IrErrorType(null) - $receiver: ERROR_CALL 'Cannot bind 1 arguments to kotlin/Function0.invoke|invoke(){}[0] call with 0 parameters' type=kotlin.Nothing + $receiver: ERROR_CALL 'Cannot bind 1 arguments to 'FUN IR_EXTERNAL_DECLARATION_STUB name:invoke visibility:public modality:ABSTRACT <> ($this:kotlin.Function0) returnType:R of kotlin.Function0 [operator]' call with 0 parameters' type=kotlin.Nothing FUN_EXPR type=kotlin.Function0 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Nothing BLOCK_BODY diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/AbstractFir2IrNonJvmResultsConverter.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/AbstractFir2IrNonJvmResultsConverter.kt index 38e37649716..d1a6f6ac286 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/AbstractFir2IrNonJvmResultsConverter.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/AbstractFir2IrNonJvmResultsConverter.kt @@ -85,8 +85,6 @@ abstract class AbstractFir2IrNonJvmResultsConverter( val fir2IrConfiguration = Fir2IrConfiguration.forKlibCompilation( compilerConfiguration, diagnosticReporter, - // FIXME(KT-64809): This is for irText tests. Remove this when we stop building signatures from FIR entirely. - linkViaSignatures = LanguageSettingsDirectives.LINK_VIA_SIGNATURES in module.directives, ) val fir2irResult = inputArtifact.toFirResult().convertToIrAndActualize( Fir2IrExtensions.Default,