From 1a29b9effff77c168c6eb30a37ec47742fdf352c Mon Sep 17 00:00:00 2001 From: Sergej Jaskiewicz Date: Tue, 11 Apr 2023 17:23:10 +0200 Subject: [PATCH] [FIR, IR] Fix name mangling for functions with context receivers - Mangled names of property accessors now include context receiver types of the corresponding property when computed from FIR. - Context receivers are now supported when computing mangled names from IR - IrBasedDescriptors now account for context receivers ^KT-57435 Fixed --- .../kotlin/fir/backend/FirMangleComputer.kt | 5 ++++ .../ir/descriptors/IrBasedDescriptors.kt | 30 ++++++++++++------- .../descriptor/DescriptorMangleComputer.kt | 6 +--- .../mangle/ir/IrMangleComputer.kt | 9 +++++- .../arrayAccessCompositeOperators.kt | 3 -- .../arrayAccessCompositeOperators.sig.kt.txt | 9 ++---- .../contextReceivers/arrayAccessOperators.kt | 3 -- .../arrayAccessOperators.sig.kt.txt | 6 ++-- .../declarations/contextReceivers/class.kt | 2 +- .../contextReceivers/class.sig.kt.txt | 3 +- .../compoundAssignmentOperators.kt | 3 -- .../compoundAssignmentOperators.sig.kt.txt | 24 +++++---------- .../contextReceivers/contextReceiverMethod.kt | 5 ---- .../contextReceiverMethod.sig.kt.txt | 14 +++++++-- .../contextReceivers/contextualInlineCall.kt | 3 -- .../contextualInlineCall.sig.kt.txt | 15 ++++------ .../contextualPrimaryConstructorWithParams.kt | 2 +- ...ualPrimaryConstructorWithParams.sig.kt.txt | 3 +- .../delegatedPropertiesOperators.kt | 3 -- .../delegatedPropertiesOperators.sig.kt.txt | 9 ++---- .../contextReceivers/fromKEEP/canvas.kt | 3 -- .../fromKEEP/canvas.sig.kt.txt | 6 ++-- .../contextReceivers/fromKEEP/compareTo.kt | 2 +- .../fromKEEP/compareTo.sig.kt.txt | 6 ++-- .../contextReceivers/fromKEEP/dp.kt | 4 --- .../contextReceivers/fromKEEP/dp.sig.kt.txt | 3 +- .../fromKEEP/functionalType.kt | 3 -- .../fromKEEP/functionalType.sig.kt.txt | 3 +- .../contextReceivers/fromKEEP/monoidSum.kt | 4 --- .../fromKEEP/monoidSum.sig.kt.txt | 3 +- .../declarations/contextReceivers/function.kt | 2 +- .../contextReceivers/function.sig.kt.txt | 3 +- .../contextReceivers/functionalType.kt | 4 --- .../functionalType.sig.kt.txt | 12 +++----- .../contextReceivers/genericOuterClass.kt | 2 +- .../genericOuterClass.sig.kt.txt | 6 ++-- .../contextReceivers/iteratorOperator.kt | 4 --- .../iteratorOperator.sig.kt.txt | 6 ++-- .../declarations/contextReceivers/kt52791.kt | 4 --- .../contextReceivers/kt52791.sig.kt.txt | 13 +++++--- .../declarations/contextReceivers/lazy.kt | 2 +- .../contextReceivers/lazy.sig.kt.txt | 9 ++---- .../contextReceivers/overloadPriority.kt | 2 +- .../overloadPriority.sig.kt.txt | 3 +- .../contextReceivers/overloading.kt | 2 +- .../contextReceivers/overloading.sig.kt.txt | 6 ++-- .../contextReceivers/plusMatrix.kt | 4 --- .../contextReceivers/plusMatrix.sig.kt.txt | 3 +- .../declarations/contextReceivers/property.kt | 4 +-- .../contextReceivers/property.sig.kt.txt | 6 ++-- .../contextReceivers/thisWithCustomLabel.kt | 2 +- .../thisWithCustomLabel.sig.kt.txt | 6 ++-- .../typeParameterAsContextReceiver.kt | 2 +- .../typeParameterAsContextReceiver.sig.kt.txt | 3 +- .../contextReceivers/unaryOperators.kt | 3 -- .../unaryOperators.sig.kt.txt | 12 +++----- 56 files changed, 120 insertions(+), 199 deletions(-) diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FirMangleComputer.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FirMangleComputer.kt index d270a978786..728588d4957 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FirMangleComputer.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FirMangleComputer.kt @@ -112,6 +112,11 @@ open class FirMangleComputer( builder.appendSignature(MangleConstant.STATIC_MEMBER_MARK) } + val contextReceivers = when (this) { + is FirPropertyAccessor -> propertySymbol.fir.contextReceivers + else -> this.contextReceivers + } + contextReceivers.forEach { builder.appendSignature(MangleConstant.CONTEXT_RECEIVER_PREFIX) mangleType(builder, it.typeRef.coneType, moduleData.session) diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/descriptors/IrBasedDescriptors.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/descriptors/IrBasedDescriptors.kt index 2cef17e1755..736c48b96a8 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/descriptors/IrBasedDescriptors.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/descriptors/IrBasedDescriptors.kt @@ -396,10 +396,27 @@ open class IrBasedVariableDescriptorWithAccessor(owner: IrLocalDelegatedProperty fun IrLocalDelegatedProperty.toIrBasedDescriptor() = IrBasedVariableDescriptorWithAccessor(this) +abstract class IrBasedFunctionDescriptor(owner: Function) : IrBasedCallableDescriptor(owner) { + + override fun getExtensionReceiverParameter() = owner.extensionReceiverParameter?.toIrBasedDescriptor() as? ReceiverParameterDescriptor + + override fun getContextReceiverParameters() = owner.valueParameters + .asSequence() + .take(owner.contextReceiverParametersCount) + .map(::IrBasedReceiverParameterDescriptor) + .toMutableList() + + override fun getValueParameters() = owner.valueParameters + .asSequence() + .drop(owner.contextReceiverParametersCount) + .map(::IrBasedValueParameterDescriptor) + .toMutableList() +} + // We make all IR-based function descriptors instances of DescriptorWithContainerSource, and use .parentClassId to // check whether declaration is deserialized. See IrInlineCodegen.descriptorIsDeserialized open class IrBasedSimpleFunctionDescriptor(owner: IrSimpleFunction) : SimpleFunctionDescriptor, DescriptorWithContainerSource, - IrBasedCallableDescriptor(owner) { + IrBasedFunctionDescriptor(owner) { override fun getOverriddenDescriptors(): List = owner.overriddenSymbols.memoryOptimizedMap { it.owner.toIrBasedDescriptor() } @@ -412,12 +429,7 @@ open class IrBasedSimpleFunctionDescriptor(owner: IrSimpleFunction) : SimpleFunc (containingDeclaration as ClassDescriptor).thisAsReceiverParameter } - override fun getExtensionReceiverParameter() = owner.extensionReceiverParameter?.toIrBasedDescriptor() as? ReceiverParameterDescriptor override fun getTypeParameters() = owner.typeParameters.memoryOptimizedMap { it.toIrBasedDescriptor() } - override fun getValueParameters() = owner.valueParameters - .asSequence() - .mapNotNull { it.toIrBasedDescriptor() as? ValueParameterDescriptor } - .toMutableList() override fun isExternal() = owner.isExternal override fun isSuspend() = owner.isSuspend @@ -482,7 +494,7 @@ fun IrSimpleFunction.toIrBasedDescriptor() = } open class IrBasedClassConstructorDescriptor(owner: IrConstructor) : ClassConstructorDescriptor, - IrBasedCallableDescriptor(owner) { + IrBasedFunctionDescriptor(owner) { override fun getContainingDeclaration() = (owner.parent as IrClass).toIrBasedDescriptor() override fun getDispatchReceiverParameter() = owner.dispatchReceiverParameter?.run { @@ -492,10 +504,6 @@ open class IrBasedClassConstructorDescriptor(owner: IrConstructor) : ClassConstr override fun getTypeParameters() = (owner.constructedClass.typeParameters + owner.typeParameters).memoryOptimizedMap { it.toIrBasedDescriptor() } - override fun getValueParameters() = owner.valueParameters.asSequence() - .mapNotNull { it.toIrBasedDescriptor() as? ValueParameterDescriptor } - .toMutableList() - override fun getOriginal() = this override fun substitute(substitutor: TypeSubstitutor): ClassConstructorDescriptor { diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/mangle/descriptor/DescriptorMangleComputer.kt b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/mangle/descriptor/DescriptorMangleComputer.kt index a7e1d5b1dfb..e865aef7735 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/mangle/descriptor/DescriptorMangleComputer.kt +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/mangle/descriptor/DescriptorMangleComputer.kt @@ -78,7 +78,7 @@ open class DescriptorMangleComputer(builder: StringBuilder, mode: MangleMode) : contextReceiverParameters.forEach { builder.appendSignature(MangleConstant.CONTEXT_RECEIVER_PREFIX) - mangleContextReceiverParameter(builder, it) + mangleType(builder, it.type, null) } extensionReceiverParameter?.let { @@ -105,10 +105,6 @@ open class DescriptorMangleComputer(builder: StringBuilder, mode: MangleMode) : } } - private fun mangleContextReceiverParameter(vpBuilder: StringBuilder, param: ReceiverParameterDescriptor) { - mangleType(vpBuilder, param.type, null) - } - private fun mangleExtensionReceiverParameter(vpBuilder: StringBuilder, param: ReceiverParameterDescriptor) { mangleType(vpBuilder, param.type, null) } diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/mangle/ir/IrMangleComputer.kt b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/mangle/ir/IrMangleComputer.kt index 084b97a1065..d13cc84db4b 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/mangle/ir/IrMangleComputer.kt +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/mangle/ir/IrMangleComputer.kt @@ -87,6 +87,13 @@ open class IrMangleComputer( builder.appendSignature(it) } + valueParameters.take(contextReceiverParametersCount).forEach { + if (!it.isHidden) { + builder.appendSignature(MangleConstant.CONTEXT_RECEIVER_PREFIX) + mangleType(builder, it.type, null) + } + } + extensionReceiverParameter?.let { if (!it.isHidden) { builder.appendSignature(MangleConstant.EXTENSION_RECEIVER_PREFIX) @@ -94,7 +101,7 @@ open class IrMangleComputer( } } - valueParameters.collectForMangler(builder, MangleConstant.VALUE_PARAMETERS) { + valueParameters.drop(contextReceiverParametersCount).collectForMangler(builder, MangleConstant.VALUE_PARAMETERS) { if (!it.isHidden) { appendSignature(specialValueParamPrefix(it)) mangleValueParameter(this, it, null) diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.kt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.kt index aea5e1fe3e6..3a08a0fd29c 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.kt @@ -1,9 +1,6 @@ // !LANGUAGE: +ContextReceivers // IGNORE_BACKEND: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57435 - data class MyContainer(var i: Int) var operationScore = 0 diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.sig.kt.txt index b4e9e409634..dd176789f9d 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.sig.kt.txt @@ -65,20 +65,17 @@ data class MyContainer { fun box(): String // CHECK JVM_IR: -// Mangled name computed from Ir: #get@MyContainer(kotlin.Int;kotlin.Int){}kotlin.Int -// Mangled name computed from Descriptor: #get!kotlin.Int@MyContainer(kotlin.Int){}kotlin.Int +// Mangled name: #get!kotlin.Int@MyContainer(kotlin.Int){}kotlin.Int // Public signature: /get|-3979760669169671321[0] operator fun MyContainer.get($context_receiver_0: Int, index: Int): Int // CHECK JVM_IR: -// Mangled name computed from Ir: #inc@MyContainer(kotlin.Int){}MyContainer -// Mangled name computed from Descriptor: #inc!kotlin.Int@MyContainer(){}MyContainer +// Mangled name: #inc!kotlin.Int@MyContainer(){}MyContainer // Public signature: /inc|-8228731243470619532[0] operator fun MyContainer.inc($context_receiver_0: Int): MyContainer // CHECK: -// Mangled name computed from Ir: #plusAssign@MyContainer(kotlin.Int;MyContainer){} -// Mangled name computed from Descriptor: #plusAssign!kotlin.Int@MyContainer(MyContainer){} +// Mangled name: #plusAssign!kotlin.Int@MyContainer(MyContainer){} // Public signature: /plusAssign|677104996565540010[0] operator fun MyContainer.plusAssign($context_receiver_0: Int, other: MyContainer): Unit diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.kt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.kt index a885fcbd38f..8cb4bcc6d70 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.kt @@ -1,9 +1,6 @@ // !LANGUAGE: +ContextReceivers // IGNORE_BACKEND: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57435 - data class MyContainer(var s: String) context(Int) diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.sig.kt.txt index 7e45e47e8ef..d97cf467d5e 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.sig.kt.txt @@ -52,14 +52,12 @@ data class MyContainer { fun box(): String // CHECK JVM_IR: -// Mangled name computed from Ir: #get@MyContainer(kotlin.Int;kotlin.Int){}kotlin.String? -// Mangled name computed from Descriptor: #get!kotlin.Int@MyContainer(kotlin.Int){}kotlin.String? +// Mangled name: #get!kotlin.Int@MyContainer(kotlin.Int){}kotlin.String? // Public signature: /get|-262764729710480185[0] operator fun MyContainer.get($context_receiver_0: Int, index: Int): String? // CHECK: -// Mangled name computed from Ir: #set@MyContainer(kotlin.Int;kotlin.Int;kotlin.String){} -// Mangled name computed from Descriptor: #set!kotlin.Int@MyContainer(kotlin.Int;kotlin.String){} +// Mangled name: #set!kotlin.Int@MyContainer(kotlin.Int;kotlin.String){} // Public signature: /set|1694887052182048775[0] operator fun MyContainer.set($context_receiver_0: Int, index: Int, value: String): Unit diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/class.kt b/compiler/testData/ir/irText/declarations/contextReceivers/class.kt index 01aa6c8d3e4..6dd2aeb6bda 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/class.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/class.kt @@ -5,7 +5,7 @@ // IGNORE_BACKEND: JS_IR_ES6 // MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57428, KT-57435 +// ^ KT-57428 class Outer { val x: Int = 1 diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/class.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/class.sig.kt.txt index dab081b8a61..9724154d081 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/class.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/class.sig.kt.txt @@ -3,8 +3,7 @@ // Public signature: /Inner|null[0] class Inner { // CHECK: - // Mangled name computed from Ir: Inner#(Outer;kotlin.Any){} - // Mangled name computed from Descriptor: Inner#!Outer(kotlin.Any){} + // Mangled name: Inner#!Outer(kotlin.Any){} // Public signature: /Inner.|7428094623108856579[0] constructor($context_receiver_0: Outer, arg: Any) /* primary */ // CHECK: diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.kt b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.kt index 2df5c376ae0..69bc7f5ea16 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.kt @@ -1,9 +1,6 @@ // !LANGUAGE: +ContextReceivers // IGNORE_BACKEND: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57435 - data class Result(var i: Int) var operationScore = 0 diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.sig.kt.txt index 1b83e5f474b..80e896365f6 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.sig.kt.txt @@ -65,50 +65,42 @@ data class Result { fun box(): String // CHECK JVM_IR: -// Mangled name computed from Ir: #div@Result(kotlin.Int;Result){}Result -// Mangled name computed from Descriptor: #div!kotlin.Int@Result(Result){}Result +// Mangled name: #div!kotlin.Int@Result(Result){}Result // Public signature: /div|4720798164978030724[0] operator fun Result.div($context_receiver_0: Int, other: Result): Result // CHECK: -// Mangled name computed from Ir: #divAssign@Result(kotlin.Int;Result){} -// Mangled name computed from Descriptor: #divAssign!kotlin.Int@Result(Result){} +// Mangled name: #divAssign!kotlin.Int@Result(Result){} // Public signature: /divAssign|2355297718303587055[0] operator fun Result.divAssign($context_receiver_0: Int, other: Result): Unit // CHECK JVM_IR: -// Mangled name computed from Ir: #minus@Result(kotlin.Int;Result){}Result -// Mangled name computed from Descriptor: #minus!kotlin.Int@Result(Result){}Result +// Mangled name: #minus!kotlin.Int@Result(Result){}Result // Public signature: /minus|3968749932240310139[0] operator fun Result.minus($context_receiver_0: Int, other: Result): Result // CHECK: -// Mangled name computed from Ir: #minusAssign@Result(kotlin.Int;Result){} -// Mangled name computed from Descriptor: #minusAssign!kotlin.Int@Result(Result){} +// Mangled name: #minusAssign!kotlin.Int@Result(Result){} // Public signature: /minusAssign|5475976237961546392[0] operator fun Result.minusAssign($context_receiver_0: Int, other: Result): Unit // CHECK JVM_IR: -// Mangled name computed from Ir: #plus@Result(kotlin.Int;Result){}Result -// Mangled name computed from Descriptor: #plus!kotlin.Int@Result(Result){}Result +// Mangled name: #plus!kotlin.Int@Result(Result){}Result // Public signature: /plus|4903222358721452198[0] operator fun Result.plus($context_receiver_0: Int, other: Result): Result // CHECK: -// Mangled name computed from Ir: #plusAssign@Result(kotlin.Int;Result){} -// Mangled name computed from Descriptor: #plusAssign!kotlin.Int@Result(Result){} +// Mangled name: #plusAssign!kotlin.Int@Result(Result){} // Public signature: /plusAssign|-1237264614376392652[0] operator fun Result.plusAssign($context_receiver_0: Int, other: Result): Unit // CHECK JVM_IR: -// Mangled name computed from Ir: #times@Result(kotlin.Int;Result){}Result -// Mangled name computed from Descriptor: #times!kotlin.Int@Result(Result){}Result +// Mangled name: #times!kotlin.Int@Result(Result){}Result // Public signature: /times|3621876074874527655[0] operator fun Result.times($context_receiver_0: Int, other: Result): Result // CHECK: -// Mangled name computed from Ir: #timesAssign@Result(kotlin.Int;Result){} -// Mangled name computed from Descriptor: #timesAssign!kotlin.Int@Result(Result){} +// Mangled name: #timesAssign!kotlin.Int@Result(Result){} // Public signature: /timesAssign|1025810528106719294[0] operator fun Result.timesAssign($context_receiver_0: Int, other: Result): Unit diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.kt b/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.kt index cb120ede724..196e2a447f4 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.kt @@ -1,10 +1,5 @@ // FIR_IDENTICAL // !LANGUAGE: +ContextReceivers -// IGNORE_BACKEND_K1: JS_IR -// IGNORE_BACKEND_K1: JS_IR_ES6 - -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57435 class Context { fun foo() = 1 diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.sig.kt.txt index 5e5c809313b..55f73eacf88 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.sig.kt.txt @@ -10,6 +10,9 @@ class Context { // CHECK JVM_IR: // Mangled name: Context#foo(){}kotlin.Int // Public signature: /Context.foo|-1256155405684507276[0] + // CHECK JS_IR: + // Mangled name: Context#foo(){} + // Public signature: /Context.foo|-1041209573719867811[0] fun foo(): Int } @@ -19,13 +22,15 @@ class Context { // Public signature: /Test|null[0] class Test { // CHECK: - // Mangled name computed from Ir: Test#(Context){} - // Mangled name computed from Descriptor: Test#!Context(){} + // Mangled name: Test#!Context(){} // Public signature: /Test.|4848133296495274545[0] constructor($context_receiver_0: Context) /* primary */ - // CHECK: + // CHECK JVM_IR: // Mangled name computed from Ir: Test.contextReceiverField0 // Mangled name computed from Descriptor: Test{}contextReceiverField0#jf + // CHECK JS_IR NATIVE: + // Mangled name computed from Ir: Test.contextReceiverField0 + // Mangled name computed from Descriptor: Test{}contextReceiverField0 private /* final field */ val contextReceiverField0: Context // CHECK: @@ -36,6 +41,9 @@ class Test { // CHECK JVM_IR: // Mangled name: Test#foo(){}kotlin.Int // Public signature: /Test.foo|-1256155405684507276[0] + // CHECK JS_IR: + // Mangled name: Test#foo(){} + // Public signature: /Test.foo|-1041209573719867811[0] fun foo(): Int } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.kt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.kt index d6710d39a2a..cb182d7dae6 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.kt @@ -1,9 +1,6 @@ // !LANGUAGE: +ContextReceivers // IGNORE_BACKEND: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57435 - class Context { fun c() = 1 } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.sig.kt.txt index c7c950742b1..e06d6e159a5 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.sig.kt.txt @@ -40,32 +40,27 @@ class Context { fun box(): String // CHECK JVM_IR: -// Mangled name computed from Ir: #testInline(Context){}kotlin.Int -// Mangled name computed from Descriptor: #testInline!Context(){}kotlin.Int +// Mangled name: #testInline!Context(){}kotlin.Int // Public signature: /testInline|2700554304824268037[0] inline fun testInline($context_receiver_0: Context): Int // CHECK JVM_IR: -// Mangled name computed from Ir: #testInlineWithArg(Context;kotlin.Int){}kotlin.Int -// Mangled name computed from Descriptor: #testInlineWithArg!Context(kotlin.Int){}kotlin.Int +// Mangled name: #testInlineWithArg!Context(kotlin.Int){}kotlin.Int // Public signature: /testInlineWithArg|9204994988875814257[0] inline fun testInlineWithArg($context_receiver_0: Context, i: Int): Int // CHECK JVM_IR: -// Mangled name computed from Ir: #testInlineWithExtensionAndArg@kotlin.Int(Context;kotlin.Int){}kotlin.Int -// Mangled name computed from Descriptor: #testInlineWithExtensionAndArg!Context@kotlin.Int(kotlin.Int){}kotlin.Int +// Mangled name: #testInlineWithExtensionAndArg!Context@kotlin.Int(kotlin.Int){}kotlin.Int // Public signature: /testInlineWithExtensionAndArg|-7753885706218316674[0] inline fun Int.testInlineWithExtensionAndArg($context_receiver_0: Context, i: Int): Int // CHECK JVM_IR: -// Mangled name computed from Ir: #testInlineWithExtensionAndMultipleArgs@kotlin.Int(Context;kotlin.Int;kotlin.Int){}kotlin.Int -// Mangled name computed from Descriptor: #testInlineWithExtensionAndMultipleArgs!Context@kotlin.Int(kotlin.Int;kotlin.Int){}kotlin.Int +// Mangled name: #testInlineWithExtensionAndMultipleArgs!Context@kotlin.Int(kotlin.Int;kotlin.Int){}kotlin.Int // Public signature: /testInlineWithExtensionAndMultipleArgs|6839067967550411636[0] inline fun Int.testInlineWithExtensionAndMultipleArgs($context_receiver_0: Context, i1: Int, i2: Int): Int // CHECK JVM_IR: -// Mangled name computed from Ir: #testInlineWithExtensionAndMultipleContextsAndArgs@kotlin.Int(Context;A;kotlin.Int;kotlin.Int){}kotlin.Int -// Mangled name computed from Descriptor: #testInlineWithExtensionAndMultipleContextsAndArgs!Context!A@kotlin.Int(kotlin.Int;kotlin.Int){}kotlin.Int +// Mangled name: #testInlineWithExtensionAndMultipleContextsAndArgs!Context!A@kotlin.Int(kotlin.Int;kotlin.Int){}kotlin.Int // Public signature: /testInlineWithExtensionAndMultipleContextsAndArgs|4315160499148454711[0] inline fun Int.testInlineWithExtensionAndMultipleContextsAndArgs($context_receiver_0: Context, $context_receiver_1: A, i1: Int, i2: Int): Int diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.kt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.kt index 0428ef443d7..41e9eae596b 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.kt @@ -5,7 +5,7 @@ // IGNORE_BACKEND: JS_IR_ES6 // MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57428, KT-57435 +// ^ KT-57428 class O(val o: String) diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.sig.kt.txt index c0fe0216b85..06cc84256d2 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.sig.kt.txt @@ -44,8 +44,7 @@ class OK { get // CHECK: - // Mangled name computed from Ir: OK#(O;kotlin.String){} - // Mangled name computed from Descriptor: OK#!O(kotlin.String){} + // Mangled name: OK#!O(kotlin.String){} // Public signature: /OK.|-804847331171011326[0] constructor($context_receiver_0: O, k: String) /* primary */ // CHECK: diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.kt b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.kt index b4856a0584e..969048933a5 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.kt @@ -2,9 +2,6 @@ // IGNORE_BACKEND: JS_IR // WITH_STDLIB -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57435 - import kotlin.reflect.KProperty var operationScore = 0 diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.sig.kt.txt index b108faaf487..c24f86d4603 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.sig.kt.txt @@ -34,14 +34,12 @@ class Delegate { constructor() /* primary */ // CHECK JVM_IR: - // Mangled name computed from Ir: Delegate#getValue(kotlin.Int;kotlin.Any?;kotlin.reflect.KProperty<*>){}kotlin.String - // Mangled name computed from Descriptor: Delegate#getValue!kotlin.Int(kotlin.Any?;kotlin.reflect.KProperty<*>){}kotlin.String + // Mangled name: Delegate#getValue!kotlin.Int(kotlin.Any?;kotlin.reflect.KProperty<*>){}kotlin.String // Public signature: /Delegate.getValue|-7764345795816801347[0] operator fun getValue($context_receiver_0: Int, thisRef: Any?, property: KProperty<*>): String // CHECK: - // Mangled name computed from Ir: Delegate#setValue(kotlin.Int;kotlin.Any?;kotlin.reflect.KProperty<*>;kotlin.String){} - // Mangled name computed from Descriptor: Delegate#setValue!kotlin.Int(kotlin.Any?;kotlin.reflect.KProperty<*>;kotlin.String){} + // Mangled name: Delegate#setValue!kotlin.Int(kotlin.Any?;kotlin.reflect.KProperty<*>;kotlin.String){} // Public signature: /Delegate.setValue|9105212648373628088[0] operator fun setValue($context_receiver_0: Int, thisRef: Any?, property: KProperty<*>, value: String): Unit @@ -65,8 +63,7 @@ class Result { set(: String): Unit // CHECK: - // Mangled name computed from Ir: Result#(kotlin.Int){} - // Mangled name computed from Descriptor: Result#!kotlin.Int(){} + // Mangled name: Result#!kotlin.Int(){} // Public signature: /Result.|-1392650824251324893[0] constructor($context_receiver_0: Int) /* primary */ // CHECK: diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.kt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.kt index a902927ee46..c0e6f437b58 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.kt @@ -2,9 +2,6 @@ // !LANGUAGE: +ContextReceivers // IGNORE_BACKEND: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57435 - interface Canvas { val suffix: String } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.sig.kt.txt index bbf86fb66cd..00959b72de4 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.sig.kt.txt @@ -8,8 +8,7 @@ class Circle : Shape { constructor() /* primary */ // CHECK JVM_IR: - // Mangled name computed from Ir: Circle#draw(Canvas){}kotlin.String - // Mangled name computed from Descriptor: Circle#draw!Canvas(){}kotlin.String + // Mangled name: Circle#draw!Canvas(){}kotlin.String // Public signature: /Circle.draw|-6733499063990640842[0] override fun draw($context_receiver_0: Canvas): String @@ -37,8 +36,7 @@ interface Canvas { interface Shape { // CHECK JVM_IR: - // Mangled name computed from Ir: Shape#draw(Canvas){}kotlin.String - // Mangled name computed from Descriptor: Shape#draw!Canvas(){}kotlin.String + // Mangled name: Shape#draw!Canvas(){}kotlin.String // Public signature: /Shape.draw|-6733499063990640842[0] abstract fun draw($context_receiver_0: Canvas): String diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.kt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.kt index 85dd7e78f05..dec4d37d3cd 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.kt @@ -2,7 +2,7 @@ // IGNORE_BACKEND: JS_IR // MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57429, KT-57435 +// ^ KT-57429 data class Pair(val first: A, val second: B) diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.sig.kt.txt index 08bf0d54af7..51b14427e88 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.sig.kt.txt @@ -62,8 +62,7 @@ data class Pair { fun box(): String // CHECK JVM_IR: -// Mangled name computed from Ir: #compareTo@0:0(java.util.Comparator<0:0>;0:0){0§}kotlin.Int -// Mangled name computed from Descriptor: #compareTo!java.util.Comparator<0:0>@0:0(0:0){0§}kotlin.Int +// Mangled name: #compareTo!java.util.Comparator<0:0>@0:0(0:0){0§}kotlin.Int // Public signature: /compareTo|-4091974102091923679[0] infix operator fun T.compareTo($context_receiver_0: Comparator, other: T): Int @@ -72,8 +71,7 @@ infix operator fun T.compareTo($context_receiver_0: Comparator, ot // Public signature: /min|6885845668930107919[0] val Pair.min: T // CHECK JVM_IR: - // Mangled name computed from Ir: #@Pair<0:0,0:0>(java.util.Comparator<0:0>){0§}0:0 - // Mangled name computed from Descriptor: #!java.util.Comparator<0:0>@Pair<0:0,0:0>(){0§}0:0 + // Mangled name: #!java.util.Comparator<0:0>@Pair<0:0,0:0>(){0§}0:0 // Public signature: /min.|6404877126791863503[0] get($context_receiver_0: Comparator): T diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.kt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.kt index cda26abd62c..f0bf951d389 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.kt @@ -1,10 +1,6 @@ // !LANGUAGE: +ContextReceivers // IGNORE_BACKEND: JS_IR // WITH_STDLIB - -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57435 - class View { val coefficient = 42 } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.sig.kt.txt index 59c8c58dca5..4c1a67858d8 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.sig.kt.txt @@ -28,8 +28,7 @@ fun box(): String // Public signature: /dp|-4245635280375224248[0] val Int.dp: Int // CHECK JVM_IR: - // Mangled name computed from Ir: #@kotlin.Int(View){}kotlin.Int - // Mangled name computed from Descriptor: #!View@kotlin.Int(){}kotlin.Int + // Mangled name: #!View@kotlin.Int(){}kotlin.Int // Public signature: /dp.|933397372434095199[0] get($context_receiver_0: View): Int diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.kt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.kt index ae7b919df53..da2d4d44472 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.kt @@ -1,9 +1,6 @@ // !LANGUAGE: +ContextReceivers // IGNORE_BACKEND: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57435 - class Param class O { val o = "O" diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.sig.kt.txt index f266c1502dd..f43d1fbde2e 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.sig.kt.txt @@ -55,8 +55,7 @@ class Param { fun box(): String // CHECK JVM_IR: -// Mangled name computed from Ir: #f@K(O;kotlin.Function3){0§}0:0 -// Mangled name computed from Descriptor: #f!O@K(kotlin.Function3){0§}0:0 +// Mangled name: #f!O@K(kotlin.Function3){0§}0:0 // Public signature: /f|-7653040485655702379[0] fun K.f($context_receiver_0: O, g: @ExtensionFunctionType Function3): T diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.kt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.kt index 7ef18b0a228..e0b5a889179 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.kt @@ -1,10 +1,6 @@ // !LANGUAGE: +ContextReceivers // IGNORE_BACKEND: JS_IR // WITH_STDLIB - -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57435 - interface Semigroup { infix fun T.combine(other: T): T } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.sig.kt.txt index 5f7a1f9a721..4d47a1b8f9e 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.sig.kt.txt @@ -86,8 +86,7 @@ object StringMonoid : Monoid { fun box(): String // CHECK JVM_IR: -// Mangled name computed from Ir: #sum@kotlin.collections.List<0:0>(Monoid<0:0>){0§}0:0 -// Mangled name computed from Descriptor: #sum!Monoid<0:0>@kotlin.collections.List<0:0>(){0§}0:0 +// Mangled name: #sum!Monoid<0:0>@kotlin.collections.List<0:0>(){0§}0:0 // Public signature: /sum|7635142307973834922[0] fun List.sum($context_receiver_0: Monoid): T diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/function.kt b/compiler/testData/ir/irText/declarations/contextReceivers/function.kt index e6868006d65..67585c87b4b 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/function.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/function.kt @@ -5,7 +5,7 @@ // IGNORE_BACKEND: JS_IR_ES6 // MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57428, KT-57435 +// ^ KT-57428 class C { val c = 42 diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/function.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/function.sig.kt.txt index 21a4f311976..0589b79aeaf 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/function.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/function.sig.kt.txt @@ -28,8 +28,7 @@ fun bar(c: C): Unit local fun C.(): Unit // CHECK: -// Mangled name computed from Ir: #foo(C){} -// Mangled name computed from Descriptor: #foo!C(){} +// Mangled name: #foo!C(){} // Public signature: /foo|-1491377105373055541[0] fun foo($context_receiver_0: C): Unit diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.kt b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.kt index 23eff898c5b..b27c2d2818b 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.kt @@ -1,10 +1,6 @@ // !LANGUAGE: +ContextReceivers // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 - -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57435 - class Param class C { val c = 42 diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.sig.kt.txt index 7467c80bb7a..2df3d27c44a 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.sig.kt.txt @@ -50,26 +50,22 @@ class R { } // CHECK: -// Mangled name computed from Ir: #f1@R(C;kotlin.Function3){} -// Mangled name computed from Descriptor: #f1!C@R(kotlin.Function3){} +// Mangled name: #f1!C@R(kotlin.Function3){} // Public signature: /f1|-6159499595952586733[0] fun R.f1($context_receiver_0: C, g: @ExtensionFunctionType Function3): Unit // CHECK: -// Mangled name computed from Ir: #f2(C;kotlin.Function2){} -// Mangled name computed from Descriptor: #f2!C(kotlin.Function2){} +// Mangled name: #f2!C(kotlin.Function2){} // Public signature: /f2|916795325728250836[0] fun f2($context_receiver_0: C, g: Function2): Unit // CHECK: -// Mangled name computed from Ir: #f3@R(C;kotlin.Function2){} -// Mangled name computed from Descriptor: #f3!C@R(kotlin.Function2){} +// Mangled name: #f3!C@R(kotlin.Function2){} // Public signature: /f3|-4964362597990757320[0] fun R.f3($context_receiver_0: C, g: @ExtensionFunctionType Function2): Unit // CHECK: -// Mangled name computed from Ir: #f4(C;kotlin.Function1){} -// Mangled name computed from Descriptor: #f4!C(kotlin.Function1){} +// Mangled name: #f4!C(kotlin.Function1){} // Public signature: /f4|-1495265522536685659[0] fun f4($context_receiver_0: C, g: Function1): Unit diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.kt b/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.kt index 5eaad6e5c47..86c976f0538 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.kt @@ -5,7 +5,7 @@ // IGNORE_BACKEND_K1: JS_IR_ES6 // MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57429, KT-57435 +// ^ KT-57429 context(T) class A diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.sig.kt.txt index cc18d2b724d..38461a3a27e 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.sig.kt.txt @@ -3,8 +3,7 @@ // Public signature: /A|null[0] class A { // CHECK: - // Mangled name computed from Ir: A#(1:0){} - // Mangled name computed from Descriptor: A#!1:0(){} + // Mangled name: A#!1:0(){} // Public signature: /A.|5547349096232763669[0] constructor($context_receiver_0: T) /* primary */ // CHECK: @@ -19,8 +18,7 @@ class A { // Public signature: /B|null[0] class B

{ // CHECK: - // Mangled name computed from Ir: B#(kotlin.collections.Collection<1:0>){} - // Mangled name computed from Descriptor: B#!kotlin.collections.Collection<1:0>(){} + // Mangled name: B#!kotlin.collections.Collection<1:0>(){} // Public signature: /B.|-5453957848603821578[0] constructor($context_receiver_0: Collection

) /* primary */ // CHECK: diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.kt b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.kt index 71e8471c0b6..2fdbc167cf6 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.kt @@ -1,10 +1,6 @@ // !LANGUAGE: +ContextReceivers // IGNORE_BACKEND: JS_IR // WITH_STDLIB - -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57435 - data class Counter(var i: Int = 0) data class CounterConfig(val max: Int = 10) diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.sig.kt.txt index 2d56d35b36d..9c14df83a8c 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.sig.kt.txt @@ -104,8 +104,7 @@ class CounterIterator : Iterator { private get // CHECK: - // Mangled name computed from Ir: CounterIterator#(CounterConfig;Counter){} - // Mangled name computed from Descriptor: CounterIterator#!CounterConfig(Counter){} + // Mangled name: CounterIterator#!CounterConfig(Counter){} // Public signature: /CounterIterator.|4731448293962665986[0] constructor($context_receiver_0: CounterConfig, counter: Counter) /* primary */ // CHECK: @@ -131,8 +130,7 @@ class CounterIterator : Iterator { fun box(): String // CHECK JVM_IR: -// Mangled name computed from Ir: #iterator@Counter(CounterConfig){}CounterIterator -// Mangled name computed from Descriptor: #iterator!CounterConfig@Counter(){}CounterIterator +// Mangled name: #iterator!CounterConfig@Counter(){}CounterIterator // Public signature: /iterator|3723033021471264185[0] operator fun Counter.iterator($context_receiver_0: CounterConfig): CounterIterator diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/kt52791.kt b/compiler/testData/ir/irText/declarations/contextReceivers/kt52791.kt index c8429231bc3..3a022129df4 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/kt52791.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/kt52791.kt @@ -1,9 +1,5 @@ // !LANGUAGE: +ContextReceivers // FIR_IDENTICAL -// IGNORE_BACKEND_K1: JS_IR - -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57435 context(Unit, Int) class MyClass diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/kt52791.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/kt52791.sig.kt.txt index a78c5217e0f..7e92582adab 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/kt52791.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/kt52791.sig.kt.txt @@ -3,17 +3,22 @@ // Public signature: /MyClass|null[0] class MyClass { // CHECK: - // Mangled name computed from Ir: MyClass#(kotlin.Unit;kotlin.Int){} - // Mangled name computed from Descriptor: MyClass#!kotlin.Unit!kotlin.Int(){} + // Mangled name: MyClass#!kotlin.Unit!kotlin.Int(){} // Public signature: /MyClass.|1062323742830185042[0] constructor($context_receiver_0: Unit, $context_receiver_1: Int) /* primary */ - // CHECK: + // CHECK JVM_IR: // Mangled name computed from Ir: MyClass.contextReceiverField0 // Mangled name computed from Descriptor: MyClass{}contextReceiverField0#jf + // CHECK JS_IR NATIVE: + // Mangled name computed from Ir: MyClass.contextReceiverField0 + // Mangled name computed from Descriptor: MyClass{}contextReceiverField0 private /* final field */ val contextReceiverField0: Unit - // CHECK: + // CHECK JVM_IR: // Mangled name computed from Ir: MyClass.contextReceiverField1 // Mangled name computed from Descriptor: MyClass{}contextReceiverField1#jf + // CHECK JS_IR NATIVE: + // Mangled name computed from Ir: MyClass.contextReceiverField1 + // Mangled name computed from Descriptor: MyClass{}contextReceiverField1 private /* final field */ val contextReceiverField1: Int } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/lazy.kt b/compiler/testData/ir/irText/declarations/contextReceivers/lazy.kt index 9a45bdbc9eb..2ee7531c3a0 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/lazy.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/lazy.kt @@ -5,7 +5,7 @@ // IGNORE_BACKEND: JS_IR_ES6 // MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57428, KT-57435 +// ^ KT-57428 interface Lazy diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/lazy.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/lazy.sig.kt.txt index 932172b2cc1..f88127500a3 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/lazy.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/lazy.sig.kt.txt @@ -45,20 +45,17 @@ fun f(lazy1: Lazy, lazy2: Lazy, lazyT: Lazy, la local fun Lazy>.(): Unit // CHECK: -// Mangled name computed from Ir: #test1(Lazy;Lazy){} -// Mangled name computed from Descriptor: #test1!Lazy!Lazy(){} +// Mangled name: #test1!Lazy!Lazy(){} // Public signature: /test1|5140438532469983470[0] fun test1($context_receiver_0: Lazy, $context_receiver_1: Lazy): Unit // CHECK: -// Mangled name computed from Ir: #test2@Lazy(Lazy<0:0>){0§} -// Mangled name computed from Descriptor: #test2!Lazy<0:0>@Lazy(){0§} +// Mangled name: #test2!Lazy<0:0>@Lazy(){0§} // Public signature: /test2|-2502875315769862011[0] fun Lazy.test2($context_receiver_0: Lazy): Unit // CHECK: -// Mangled name computed from Ir: #test3@Lazy(Lazy>){0§} -// Mangled name computed from Descriptor: #test3!Lazy>@Lazy(){0§} +// Mangled name: #test3!Lazy>@Lazy(){0§} // Public signature: /test3|-745136432920564509[0] fun Lazy.test3($context_receiver_0: Lazy>): Unit diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/overloadPriority.kt b/compiler/testData/ir/irText/declarations/contextReceivers/overloadPriority.kt index 70f34274255..4e2211ddaec 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/overloadPriority.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/overloadPriority.kt @@ -5,7 +5,7 @@ // IGNORE_BACKEND: JS_IR_ES6 // MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57428, KT-57435 +// ^ KT-57428 class Context diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/overloadPriority.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/overloadPriority.sig.kt.txt index 324fc633a30..f725d50fe14 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/overloadPriority.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/overloadPriority.sig.kt.txt @@ -10,8 +10,7 @@ class Context { } // CHECK JVM_IR: -// Mangled name computed from Ir: #f(Context){}kotlin.String -// Mangled name computed from Descriptor: #f!Context(){}kotlin.String +// Mangled name: #f!Context(){}kotlin.String // Public signature: /f|-5175802051654911360[0] fun f($context_receiver_0: Context): String diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/overloading.kt b/compiler/testData/ir/irText/declarations/contextReceivers/overloading.kt index 4b39bd79235..54a4c02d50d 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/overloading.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/overloading.kt @@ -5,7 +5,7 @@ // IGNORE_BACKEND: JS_IR_ES6 // MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57428, KT-57435 +// ^ KT-57428 context(Int, String) fun foo(): Int { diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/overloading.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/overloading.sig.kt.txt index e08332d5dab..2d6988b3b66 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/overloading.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/overloading.sig.kt.txt @@ -1,12 +1,10 @@ // CHECK JVM_IR: -// Mangled name computed from Ir: #foo(kotlin.Int){}kotlin.Int -// Mangled name computed from Descriptor: #foo!kotlin.Int(){}kotlin.Int +// Mangled name: #foo!kotlin.Int(){}kotlin.Int // Public signature: /foo|-298514072419997277[0] fun foo($context_receiver_0: Int): Int // CHECK JVM_IR: -// Mangled name computed from Ir: #foo(kotlin.Int;kotlin.String){}kotlin.Int -// Mangled name computed from Descriptor: #foo!kotlin.Int!kotlin.String(){}kotlin.Int +// Mangled name: #foo!kotlin.Int!kotlin.String(){}kotlin.Int // Public signature: /foo|7076979931255393427[0] fun foo($context_receiver_0: Int, $context_receiver_1: String): Int diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.kt b/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.kt index d5a7dd0e21f..1cefbb8b0c4 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.kt @@ -3,10 +3,6 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 - -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57435 - interface NumberOperations { fun Number.plus(other: Number): Number } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.sig.kt.txt index 978306f3dfc..d898e0973dd 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.sig.kt.txt @@ -22,8 +22,7 @@ interface NumberOperations { } // CHECK JVM_IR: -// Mangled name computed from Ir: #plus@Matrix(NumberOperations;Matrix){}Matrix -// Mangled name computed from Descriptor: #plus!NumberOperations@Matrix(Matrix){}Matrix +// Mangled name: #plus!NumberOperations@Matrix(Matrix){}Matrix // Public signature: /plus|1303343764214809933[0] fun Matrix.plus($context_receiver_0: NumberOperations, other: Matrix): Matrix diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/property.kt b/compiler/testData/ir/irText/declarations/contextReceivers/property.kt index ed8a895d12c..19ee12a665e 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/property.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/property.kt @@ -1,8 +1,8 @@ // FIR_IDENTICAL // !LANGUAGE: +ContextReceivers -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57435 +// MUTE_SIGNATURE_COMPARISON_K2: JS_IR +// ^ KT-57818 interface A { fun a(): Int diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/property.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/property.sig.kt.txt index 25ebe474253..1d81dbe7a39 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/property.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/property.sig.kt.txt @@ -33,12 +33,10 @@ interface B { // Public signature: /c|-4416962153448040627[0] val c: Int // CHECK JVM_IR: - // Mangled name computed from Ir: #(A;B){}kotlin.Int - // Mangled name computed from Descriptor: #!A!B(){}kotlin.Int + // Mangled name: #!A!B(){}kotlin.Int // Public signature: /c.|-2082007887378586898[0] // CHECK JS_IR NATIVE: - // Mangled name computed from Ir: #(A;B){} - // Mangled name computed from Descriptor: #!A!B(){} + // Mangled name: #!A!B(){} // Public signature: /c.|2760865531401172403[0] get($context_receiver_0: A, $context_receiver_1: B): Int diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.kt b/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.kt index 32fb8ce5e67..f99d215016d 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.kt @@ -4,7 +4,7 @@ // IGNORE_BACKEND_K1: JS_IR_ES6 // MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57429, KT-57435 +// ^ KT-57429 class A(val a: T) class B(val b: Any) diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.sig.kt.txt index b863a598207..4792aab4c0d 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.sig.kt.txt @@ -59,8 +59,7 @@ class C { } // CHECK: -// Mangled name computed from Ir: #f(A;A;B){} -// Mangled name computed from Descriptor: #f!A!A!B(){} +// Mangled name: #f!A!A!B(){} // Public signature: /f|-2471136927765483161[0] fun f($context_receiver_0: A, $context_receiver_1: A, $context_receiver_2: B): Unit @@ -69,8 +68,7 @@ fun f($context_receiver_0: A, $context_receiver_1: A, $context_rece // Public signature: /p|-5429013048289439414[0] val C.p: Int // CHECK JVM_IR: - // Mangled name computed from Ir: #@C(A;A;B){}kotlin.Int - // Mangled name computed from Descriptor: #!A!A!B@C(){}kotlin.Int + // Mangled name: #!A!A!B@C(){}kotlin.Int // Public signature: /p.|-7725362510645392909[0] get($context_receiver_0: A, $context_receiver_1: A, $context_receiver_2: B): Int diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.kt b/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.kt index a682a255524..676a6e3db20 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.kt @@ -5,7 +5,7 @@ // IGNORE_BACKEND: JS_IR_ES6 // MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57428, KT-57435 +// ^ KT-57428 context(T) fun useContext(block: (T) -> Unit) { } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.sig.kt.txt index f083e27faef..6c92cdf47c5 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.sig.kt.txt @@ -10,8 +10,7 @@ fun test(): Unit local fun (i: Int): Unit // CHECK: -// Mangled name computed from Ir: #useContext(0:0;kotlin.Function1<0:0,kotlin.Unit>){0§} -// Mangled name computed from Descriptor: #useContext!0:0(kotlin.Function1<0:0,kotlin.Unit>){0§} +// Mangled name: #useContext!0:0(kotlin.Function1<0:0,kotlin.Unit>){0§} // Public signature: /useContext|4354708628570086942[0] fun useContext($context_receiver_0: T, block: Function1): Unit diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.kt b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.kt index 91469fac021..b065aabe11e 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.kt @@ -1,9 +1,6 @@ // !LANGUAGE: +ContextReceivers // IGNORE_BACKEND: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57435 - data class Result(val i: Int) var operationScore = 0 diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.sig.kt.txt index 1ac667ab12b..bbde809924d 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.sig.kt.txt @@ -61,26 +61,22 @@ data class Result { fun box(): String // CHECK JVM_IR: -// Mangled name computed from Ir: #dec@Result(kotlin.Int){}Result -// Mangled name computed from Descriptor: #dec!kotlin.Int@Result(){}Result +// Mangled name: #dec!kotlin.Int@Result(){}Result // Public signature: /dec|6054584114651390969[0] operator fun Result.dec($context_receiver_0: Int): Result // CHECK JVM_IR: -// Mangled name computed from Ir: #inc@Result(kotlin.Int){}Result -// Mangled name computed from Descriptor: #inc!kotlin.Int@Result(){}Result +// Mangled name: #inc!kotlin.Int@Result(){}Result // Public signature: /inc|-6349683016158919485[0] operator fun Result.inc($context_receiver_0: Int): Result // CHECK JVM_IR: -// Mangled name computed from Ir: #unaryMinus@Result(kotlin.Int){}Result -// Mangled name computed from Descriptor: #unaryMinus!kotlin.Int@Result(){}Result +// Mangled name: #unaryMinus!kotlin.Int@Result(){}Result // Public signature: /unaryMinus|-8891797954767898088[0] operator fun Result.unaryMinus($context_receiver_0: Int): Result // CHECK JVM_IR: -// Mangled name computed from Ir: #unaryPlus@Result(kotlin.Int){}Result -// Mangled name computed from Descriptor: #unaryPlus!kotlin.Int@Result(){}Result +// Mangled name: #unaryPlus!kotlin.Int@Result(){}Result // Public signature: /unaryPlus|6329022242309077522[0] operator fun Result.unaryPlus($context_receiver_0: Int): Result