From 02180e86855c7b16150408de5950868099746e58 Mon Sep 17 00:00:00 2001 From: Sergej Jaskiewicz Date: Thu, 13 Apr 2023 11:35:30 +0200 Subject: [PATCH] Factor out duplicated mangling logic for functions into the base class ^KT-57777 Fixed ^KT-57818 Fixed --- .../kotlin/fir/backend/FirMangleComputer.kt | 117 ++++++++---------- .../kotlin/fir/signaturer/FirManglerUtil.kt | 32 +++-- .../mangle/BaseKotlinMangleComputer.kt | 101 ++++++++++++++- .../descriptor/DescriptorMangleComputer.kt | 102 +++++++-------- .../mangle/ir/IrMangleComputer.kt | 113 +++++++---------- .../testData/ir/irText/classes/classes.kt | 3 - compiler/testData/ir/irText/classes/enum.kt | 2 +- .../ir/irText/classes/enumClassModality.kt | 2 +- .../testData/ir/irText/classes/enumEntries.kt | 3 - .../irText/classes/enumWithMultipleCtors.kt | 2 +- .../irText/classes/enumWithSecondaryCtor.kt | 2 +- .../annotations/classesWithAnnotations.kt | 3 - .../constExpressionsInAnnotationArguments.kt | 4 - ...legatedPropertyAccessorsWithAnnotations.kt | 4 - .../annotations/enumsInAnnotationArguments.kt | 3 - .../annotations/fieldsWithAnnotations.kt | 4 - .../annotations/propertiesWithAnnotations.kt | 4 - .../propertyAccessorsWithAnnotations.kt | 4 - .../propertySetterParameterWithAnnotations.kt | 4 - .../receiverParameterWithAnnotations.kt | 4 - .../catchParameterInTopLevelProperty.kt | 4 - .../declarations/constValInitializers.kt | 4 - .../declarations/contextReceivers/property.kt | 3 - .../irText/declarations/deprecatedProperty.kt | 4 - .../declarations/extensionProperties.kt | 4 - .../declarations/genericDelegatedProperty.kt | 3 - .../multiplatform/expectedEnumClass2.kt | 3 - .../expectedEnumClass2.sig.kt.txt | 90 +++++++++++++- .../parameters/defaultPropertyAccessors.kt | 2 +- .../irText/declarations/parameters/lambdas.kt | 4 - .../parameters/propertyAccessors.kt | 3 - .../parameters/typeParameterBeforeBound.kt | 3 - .../provideDelegate/differentReceivers.kt | 4 - .../declarations/provideDelegate/topLevel.kt | 4 - .../ir/irText/expressions/arrayAccess.kt | 4 - .../expressions/augmentedAssignment1.kt | 4 - .../expressions/augmentedAssignment2.kt | 4 - .../expressions/boundCallableReferences.kt | 4 - .../genericLocalClassConstructorReference.kt | 2 +- .../callableReferences/genericMember.kt | 4 - .../callableReferences/importedFromObject.kt | 2 +- .../callableReferences/typeArguments.kt | 4 - .../irText/expressions/castToTypeParameter.kt | 3 - .../ir/irText/expressions/contructorCall.kt | 4 - .../testData/ir/irText/expressions/elvis.kt | 4 - .../irText/expressions/enumEntryAsReceiver.kt | 2 +- .../expressions/exhaustiveWhenElseBranch.kt | 3 - .../extensionPropertyGetterCall.kt | 4 - .../testData/ir/irText/expressions/field.kt | 4 - .../expressions/funInterface/partialSam.kt | 4 - .../irText/expressions/genericPropertyCall.kt | 3 - .../irText/expressions/genericPropertyRef.kt | 4 +- .../implicitCastToTypeParameter.kt | 3 - .../testData/ir/irText/expressions/kt28006.kt | 4 - .../testData/ir/irText/expressions/kt36956.kt | 2 +- .../expressions/membersImportedFromObject.kt | 4 - .../ir/irText/expressions/objectAsCallable.kt | 3 - .../ir/irText/expressions/references.kt | 4 - .../irText/expressions/reflectionLiterals.kt | 4 - .../safeCallWithIncrementDecrement.kt | 2 +- .../signedToUnsignedConversions.kt | 3 - .../ir/irText/expressions/stringTemplates.kt | 4 - .../temporaryInEnumEntryInitializer.kt | 3 - .../typeAliasConstructorReference.kt | 4 - .../expressions/typeParameterClassLiteral.kt | 3 - .../expressions/unsignedIntegerLiterals.kt | 3 - .../testData/ir/irText/expressions/values.kt | 3 - .../testData/ir/irText/expressions/vararg.kt | 4 - .../variableAsFunctionCallWithGenerics.kt | 3 - .../irText/expressions/whenSmartCastToEnum.kt | 3 - .../firProblems/thisInEnumConstructor.kt | 3 - .../testData/ir/irText/js/external/kt38765.kt | 3 - .../testData/ir/irText/lambdas/justLambda.kt | 4 - .../ir/irText/singletons/enumEntry.kt | 2 +- compiler/testData/ir/irText/stubs/simple.kt | 4 - .../types/genericDelegatedDeepProperty.kt | 2 +- .../types/genericPropertyReferenceType.kt | 2 +- 77 files changed, 366 insertions(+), 424 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 a8110852c54..08e7f6a800d 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 @@ -26,6 +26,7 @@ import org.jetbrains.kotlin.fir.symbols.impl.FirTypeAliasSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol import org.jetbrains.kotlin.fir.types.* import org.jetbrains.kotlin.fir.visitors.FirVisitorVoid +import org.jetbrains.kotlin.name.SpecialNames /** * A base mangle computer that generates a mangled name for a Kotlin declaration represented by [FirDeclaration]. @@ -76,71 +77,35 @@ open class FirMangleComputer( accept(visitor, null) } - private fun FirFunction.mangleFunction(isCtor: Boolean, isStatic: Boolean, container: FirDeclaration) { + override fun FirDeclaration.asTypeParameterContainer(): FirMemberDeclaration? = + this as? FirMemberDeclaration - isRealExpect = isRealExpect || (this as? FirMemberDeclaration)?.isExpect == true + override fun getContextReceiverTypes(function: FirFunction): List = + when (function) { + is FirPropertyAccessor -> function.propertySymbol.fir.contextReceivers + else -> function.contextReceivers + }.map { it.typeRef.coneType } - if (container is FirMemberDeclaration) { - typeParameterContainers.add(container) - } - visitParent() + override fun getExtensionReceiverParameterType(function: FirFunction): ConeKotlinType? = + function.receiverParameter?.typeRef?.coneType + ?: (function as? FirPropertyAccessor)?.propertySymbol?.fir?.receiverParameter?.typeRef?.coneType - builder.appendName(MangleConstant.FUNCTION_NAME_PREFIX) + override fun getValueParameters(function: FirFunction): List = + function.valueParameters - platformSpecificFunctionName()?.let { - builder.append(it) - return - } + override fun getReturnType(function: FirFunction): ConeKotlinType = function.returnTypeRef.coneType - val name = this.irName - builder.append(name.asString()) + override fun getTypeParametersWithIndices( + function: FirFunction, + container: FirDeclaration, + ): Iterable> = + (container as? FirTypeParametersOwner) + ?.typeParameters + .orEmpty() + .map { it.symbol.toLookupTag() } + .withIndex() - platformSpecificSuffix()?.let { - builder.append(MangleConstant.PLATFORM_FUNCTION_MARKER) - builder.append(it) - } - - mangleSignature(isCtor, isStatic, container) - } - - private fun FirFunction.mangleSignature(isCtor: Boolean, isStatic: Boolean, container: FirDeclaration) { - if (!mode.signature) { - return - } - - if (isStatic) { - 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) - } - - val receiverType = receiverParameter?.typeRef ?: (this as? FirPropertyAccessor)?.propertySymbol?.fir?.receiverParameter?.typeRef - receiverType?.let { - builder.appendSignature(MangleConstant.EXTENSION_RECEIVER_PREFIX) - mangleType(builder, it.coneType, moduleData.session) - } - - valueParameters.collectForMangler(builder, MangleConstant.VALUE_PARAMETERS) { - appendSignature(specialValueParamPrefix(it)) - mangleValueParameter(this, it, moduleData.session) - } - (container as? FirTypeParametersOwner)?.typeParameters?.withIndex()?.toList().orEmpty() - .collectForMangler(builder, MangleConstant.TYPE_PARAMETERS) { (index, typeParameter) -> - mangleTypeParameter(this, typeParameter.symbol.toLookupTag(), index, moduleData.session) - } - - if (!isCtor && !returnTypeRef.isUnit && addReturnType()) { - mangleType(builder, returnTypeRef.coneType, moduleData.session) - } - } + override fun isUnit(type: ConeKotlinType) = type.isUnit @OptIn(SymbolInternals::class) override fun getEffectiveParent(typeParameter: ConeTypeParameterLookupTag): FirMemberDeclaration = typeParameter.symbol.fir.run { @@ -153,7 +118,8 @@ open class FirMangleComputer( override fun isVararg(valueParameter: FirValueParameter) = valueParameter.isVararg - override fun getValueParameterType(valueParameter: FirValueParameter) = valueParameter.returnTypeRef.coneType + override fun getValueParameterType(valueParameter: FirValueParameter): ConeKotlinType = + valueParameter.returnTypeRef.coneType override fun getIndexOfTypeParameter(typeParameter: ConeTypeParameterLookupTag, container: FirMemberDeclaration) = container.typeParameters.indexOf(typeParameter.symbol.fir) @@ -233,7 +199,6 @@ open class FirMangleComputer( override fun visitElement(element: FirElement) = error("unexpected element ${element.render()}") override fun visitRegularClass(regularClass: FirRegularClass) { - isRealExpect = isRealExpect or regularClass.isExpect typeParameterContainers.add(regularClass) regularClass.mangleSimpleDeclaration(regularClass.name.asString()) } @@ -243,7 +208,6 @@ open class FirMangleComputer( } override fun visitVariable(variable: FirVariable) { - isRealExpect = isRealExpect or variable.isExpect typeParameterContainers.add(variable) variable.visitParent() @@ -281,20 +245,37 @@ open class FirMangleComputer( typeAlias.mangleSimpleDeclaration(typeAlias.name.asString()) override fun visitSimpleFunction(simpleFunction: FirSimpleFunction) { - isRealExpect = isRealExpect || simpleFunction.isExpect - val isStatic = simpleFunction.isStatic - simpleFunction.mangleFunction(false, isStatic, simpleFunction) + simpleFunction.mangleFunction( + name = simpleFunction.name, + isConstructor = false, + isStatic = simpleFunction.isStatic, + container = simpleFunction, + session = simpleFunction.moduleData.session + ) } - override fun visitConstructor(constructor: FirConstructor) = - constructor.mangleFunction(isCtor = true, isStatic = false, constructor) + override fun visitConstructor(constructor: FirConstructor) { + constructor.mangleFunction( + name = SpecialNames.INIT, + isConstructor = true, + isStatic = false, + container = constructor, + session = constructor.moduleData.session + ) + } override fun visitPropertyAccessor(propertyAccessor: FirPropertyAccessor) { if (propertyAccessor is FirSyntheticPropertyAccessor) { // No need to distinguish between the accessor and its delegate. visitSimpleFunction(propertyAccessor.delegate) } else { - propertyAccessor.mangleFunction(isCtor = false, propertyAccessor.isStatic, propertyAccessor.propertySymbol.fir) + propertyAccessor.mangleFunction( + name = propertyAccessor.irName, + isConstructor = false, + isStatic = propertyAccessor.isStatic, + container = propertyAccessor.propertySymbol.fir, + session = propertyAccessor.moduleData.session + ) } } } diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/signaturer/FirManglerUtil.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/signaturer/FirManglerUtil.kt index 710a3c27cb7..f5bf3f0db43 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/signaturer/FirManglerUtil.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/signaturer/FirManglerUtil.kt @@ -9,19 +9,31 @@ import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.name.SpecialNames +/** + * The name that an IR node generated from this [FirCallableDeclaration] will have, e.g. `` for constructors, + * `` and `` for property accessors, name as is for variables and simple functions, + * and `` for anonymous functions. + */ val FirCallableDeclaration.irName: Name get() = when (this) { is FirConstructor -> SpecialNames.INIT is FirSimpleFunction -> this.name + is FirPropertyAccessor -> this.irName is FirVariable -> this.name - is FirPropertyAccessor -> { - val prefix = when { - isGetter -> " " error("unknown property accessor kind $this") - } - Name.special(prefix + propertySymbol.fir.name + ">") - } - - else -> SpecialNames.ANONYMOUS + is FirFunction -> SpecialNames.ANONYMOUS + } + +/** + * The name that an IR node generated from this [FirPropertyAccessor] will have. + * + * If the corresponding property has name `foo`, this will return `` or ``. + */ +val FirPropertyAccessor.irName: Name + get() { + val prefix = when { + isGetter -> " " error("unknown property accessor kind $this") + } + return Name.special(prefix + propertySymbol.fir.name + ">") } diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/mangle/BaseKotlinMangleComputer.kt b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/mangle/BaseKotlinMangleComputer.kt index d25e0baecd0..d38a53ca832 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/mangle/BaseKotlinMangleComputer.kt +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/mangle/BaseKotlinMangleComputer.kt @@ -5,6 +5,7 @@ package org.jetbrains.kotlin.backend.common.serialization.mangle +import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.types.model.* /** @@ -41,8 +42,6 @@ abstract class BaseKotlinMangleComputer(4) - protected var isRealExpect = false - protected open fun FunctionDeclaration.platformSpecificFunctionName(): String? = null protected open fun FunctionDeclaration.platformSpecificSuffix(): String? = null @@ -85,6 +84,13 @@ abstract class BaseKotlinMangleComputer + + protected abstract fun getExtensionReceiverParameterType(function: FunctionDeclaration): Type? + + protected abstract fun getValueParameters(function: FunctionDeclaration): List + + protected abstract fun getReturnType(function: FunctionDeclaration): Type? + + protected abstract fun isUnit(type: Type): Boolean + + protected abstract fun getTypeParametersWithIndices( + function: FunctionDeclaration, + container: Declaration, + ): Iterable> + + protected open fun FunctionDeclaration.platformSpecificFunctionMarks(): List = emptyList() + + /** + * Simply attempts to cast [Declaration] to [TypeParameterContainer]. + */ + protected abstract fun Declaration.asTypeParameterContainer(): TypeParameterContainer? + + protected fun FunctionDeclaration.mangleFunction( + name: Name, + isConstructor: Boolean, + isStatic: Boolean, + container: Declaration, + session: Session + ) { + + container.asTypeParameterContainer()?.let(typeParameterContainers::add) + + container.visitParentForFunctionMangling() + + builder.appendName(MangleConstant.FUNCTION_NAME_PREFIX) + + platformSpecificFunctionName()?.let { + builder.append(it) + return + } + + builder.append(name.asString()) + + mangleSignature(isConstructor, isStatic, container, session) + } + + private fun FunctionDeclaration.mangleSignature( + isConstructor: Boolean, + isStatic: Boolean, + typeParameterContainer: Declaration, + session: Session + ) { + if (!mode.signature) return + + if (!isConstructor && isStatic) { + builder.appendSignature(MangleConstant.STATIC_MEMBER_MARK) + } + + platformSpecificFunctionMarks().forEach { builder.appendSignature(it) } + + getContextReceiverTypes(this).forEach { + builder.appendSignature(MangleConstant.CONTEXT_RECEIVER_PREFIX) + mangleType(builder, it, session) + } + + getExtensionReceiverParameterType(this)?.let { + builder.appendSignature(MangleConstant.EXTENSION_RECEIVER_PREFIX) + mangleType(builder, it, session) + } + + getValueParameters(this).collectForMangler(builder, MangleConstant.VALUE_PARAMETERS) { + appendSignature(specialValueParamPrefix(it)) + mangleValueParameter(this, it, session) + } + + getTypeParametersWithIndices(this, typeParameterContainer).collectForMangler(builder, MangleConstant.TYPE_PARAMETERS) { + mangleTypeParameter(this, it.value, it.index, session) + } + + getReturnType(this)?.let { + if (!isConstructor && !isUnit(it) && (addReturnType() || addReturnTypeSpecialCase(this@mangleSignature))) { + mangleType(builder, it, session) + } + } + + platformSpecificSuffix()?.let { + builder.appendSignature(MangleConstant.PLATFORM_FUNCTION_MARKER) + builder.appendSignature(it) + } + } + protected abstract fun mangleType(tBuilder: StringBuilder, type: Type, declarationSiteSession: Session) protected open fun mangleTypePlatformSpecific(type: Type, tBuilder: StringBuilder) {} 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 e865aef7735..4c3f8b9dd26 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 @@ -5,6 +5,7 @@ package org.jetbrains.kotlin.backend.common.serialization.mangle.descriptor +import org.jetbrains.kotlin.backend.common.serialization.isExpectMember import org.jetbrains.kotlin.backend.common.serialization.mangle.* import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.ir.descriptors.IrImplementingDelegateDescriptor @@ -24,7 +25,7 @@ open class DescriptorMangleComputer(builder: StringBuilder, mode: MangleMode) : /*Type=*/KotlinType, /*TypeParameter=*/TypeParameterDescriptor, /*ValueParameter=*/ValueParameterDescriptor, - /*TypeParameterContainer=*/DeclarationDescriptor, + /*TypeParameterContainer=*/DeclarationDescriptor, // CallableDescriptor or ClassDescriptor /*FunctionDeclaration=*/FunctionDescriptor, /*Session=*/Nothing?, >(builder, mode) { @@ -49,61 +50,32 @@ open class DescriptorMangleComputer(builder: StringBuilder, mode: MangleMode) : private val CallableDescriptor.isRealStatic: Boolean get() = dispatchReceiverParameter == null && containingDeclaration !is PackageFragmentDescriptor - private fun FunctionDescriptor.mangleFunction(isCtor: Boolean, container: CallableDescriptor) { + override fun DeclarationDescriptor.asTypeParameterContainer(): DeclarationDescriptor = + this - isRealExpect = isRealExpect or isExpect + override fun getContextReceiverTypes(function: FunctionDescriptor): List = + function.contextReceiverParameters.map { it.type } - typeParameterContainers.add(container) - container.containingDeclaration.visit() + override fun getExtensionReceiverParameterType(function: FunctionDescriptor): KotlinType? = + function.extensionReceiverParameter?.type - builder.appendName(MangleConstant.FUNCTION_NAME_PREFIX) + override fun getValueParameters(function: FunctionDescriptor): List = + function.valueParameters - platformSpecificFunctionName()?.let { - builder.append(it) - return - } + override fun getReturnType(function: FunctionDescriptor): KotlinType? = + function.returnType - builder.append(name.asString()) + override fun getTypeParametersWithIndices( + function: FunctionDescriptor, + container: DeclarationDescriptor, + ): List> = + (container as? CallableDescriptor) + ?.typeParameters + .orEmpty() + .filter { it.containingDeclaration == container } + .map { IndexedValue(it.index, it) } - mangleSignature(isCtor, container) - } - - private fun FunctionDescriptor.mangleSignature(isCtor: Boolean, realTypeParameterContainer: CallableDescriptor) { - - if (!mode.signature) return - - if (!isCtor && realTypeParameterContainer.isRealStatic) { - builder.appendSignature(MangleConstant.STATIC_MEMBER_MARK) - } - - contextReceiverParameters.forEach { - builder.appendSignature(MangleConstant.CONTEXT_RECEIVER_PREFIX) - mangleType(builder, it.type, null) - } - - extensionReceiverParameter?.let { - builder.appendSignature(MangleConstant.EXTENSION_RECEIVER_PREFIX) - mangleExtensionReceiverParameter(builder, it) - } - - valueParameters.collectForMangler(builder, MangleConstant.VALUE_PARAMETERS) { - appendSignature(specialValueParamPrefix(it)) - mangleValueParameter(this, it, null) - } - realTypeParameterContainer.typeParameters.filter { it.containingDeclaration == realTypeParameterContainer } - .collectForMangler(builder, MangleConstant.TYPE_PARAMETERS) { mangleTypeParameter(this, it, it.index, null) } - - returnType?.run { - if (!isCtor && !isUnit() && (addReturnType() || addReturnTypeSpecialCase(this@mangleSignature))) { - mangleType(builder, this, null) - } - } - - platformSpecificSuffix()?.let { - builder.appendSignature(MangleConstant.PLATFORM_FUNCTION_MARKER) - builder.appendSignature(it) - } - } + override fun isUnit(type: KotlinType) = type.isUnit() private fun mangleExtensionReceiverParameter(vpBuilder: StringBuilder, param: ReceiverParameterDescriptor) { mangleType(vpBuilder, param.type, null) @@ -111,7 +83,8 @@ open class DescriptorMangleComputer(builder: StringBuilder, mode: MangleMode) : final override fun isVararg(valueParameter: ValueParameterDescriptor) = valueParameter.varargElementType != null - final override fun getValueParameterType(valueParameter: ValueParameterDescriptor) = valueParameter.type + final override fun getValueParameterType(valueParameter: ValueParameterDescriptor): KotlinType = + valueParameter.type @Suppress("PARAMETER_NAME_CHANGED_ON_OVERRIDE") final override fun mangleType(tBuilder: StringBuilder, wrappedType: KotlinType, declarationSiteSession: Nothing?) { @@ -173,7 +146,13 @@ open class DescriptorMangleComputer(builder: StringBuilder, mode: MangleMode) : private fun manglePropertyAccessor(accessor: PropertyAccessorDescriptor) { val property = accessor.correspondingProperty - accessor.mangleFunction(false, property) + accessor.mangleFunction( + name = accessor.name, + isConstructor = false, + isStatic = property.isRealStatic, + container = property, + session = null + ) } protected open fun visitModuleDeclaration(descriptor: ModuleDescriptor) = reportUnexpectedDescriptor(descriptor) @@ -189,7 +168,13 @@ open class DescriptorMangleComputer(builder: StringBuilder, mode: MangleMode) : override fun visitVariableDescriptor(descriptor: VariableDescriptor, data: Nothing?) = reportUnexpectedDescriptor(descriptor) override fun visitFunctionDescriptor(descriptor: FunctionDescriptor, data: Nothing?) { - descriptor.mangleFunction(false, descriptor) + descriptor.mangleFunction( + name = descriptor.name, + isConstructor = false, + isStatic = descriptor.isRealStatic, + container = descriptor, + session = null + ) } override fun visitTypeParameterDescriptor(descriptor: TypeParameterDescriptor, data: Nothing?) { @@ -200,7 +185,6 @@ open class DescriptorMangleComputer(builder: StringBuilder, mode: MangleMode) : } override fun visitClassDescriptor(descriptor: ClassDescriptor, data: Nothing?) { - isRealExpect = isRealExpect or descriptor.isExpect typeParameterContainers.add(descriptor) descriptor.mangleSimpleDeclaration(descriptor.name.asString()) } @@ -214,7 +198,13 @@ open class DescriptorMangleComputer(builder: StringBuilder, mode: MangleMode) : } override fun visitConstructorDescriptor(constructorDescriptor: ConstructorDescriptor, data: Nothing?) { - constructorDescriptor.mangleFunction(isCtor = true, container = constructorDescriptor) + constructorDescriptor.mangleFunction( + name = constructorDescriptor.name, + isConstructor = true, + isStatic = constructorDescriptor.isRealStatic, + container = constructorDescriptor, + session = null + ) } override fun visitScriptDescriptor(scriptDescriptor: ScriptDescriptor, data: Nothing?) = @@ -230,8 +220,6 @@ open class DescriptorMangleComputer(builder: StringBuilder, mode: MangleMode) : val extensionReceiver = actualDescriptor.extensionReceiverParameter - isRealExpect = isRealExpect or actualDescriptor.isExpect - typeParameterContainers.add(actualDescriptor) actualDescriptor.containingDeclaration.visit() 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 d13cc84db4b..e9f4af0170f 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 @@ -40,8 +40,6 @@ open class IrMangleComputer( get() = throw UnsupportedOperationException("Builtins are unavailable") } - open fun IrFunction.platformSpecificFunctionMarks(): List = emptyList() - override fun copy(newMode: MangleMode) = IrMangleComputer(builder, newMode, compatibleMode) final override fun IrDeclaration.visitParent() { @@ -52,70 +50,47 @@ open class IrMangleComputer( acceptVoid(Visitor()) } - private fun IrFunction.mangleFunction(isCtor: Boolean, isStatic: Boolean, container: IrDeclaration) { + override fun IrDeclaration.asTypeParameterContainer(): IrDeclaration = + this - isRealExpect = isRealExpect or isExpect - - typeParameterContainers.add(container) - val containerParent = container.parent - val realParent = - if (containerParent is IrField && containerParent.origin == IrDeclarationOrigin.DELEGATE) containerParent.parent else containerParent + override fun IrDeclaration.visitParentForFunctionMangling() { + val declarationParent = parent + val realParent = if (declarationParent is IrField && declarationParent.origin == IrDeclarationOrigin.DELEGATE) + declarationParent.parent + else + declarationParent realParent.acceptVoid(Visitor()) - - builder.appendName(MangleConstant.FUNCTION_NAME_PREFIX) - - platformSpecificFunctionName()?.let { - builder.append(it) - return - } - - val funName = name.asString() - - builder.append(funName) - - mangleSignature(isCtor, isStatic) } - private fun IrFunction.mangleSignature(isCtor: Boolean, isStatic: Boolean) { - if (!mode.signature) return + override fun getContextReceiverTypes(function: IrFunction): List = + function + .valueParameters + .asSequence() + .take(function.contextReceiverParametersCount) + .filterNot { it.isHidden } + .map { it.type } + .toList() - if (isStatic) { - builder.appendSignature(MangleConstant.STATIC_MEMBER_MARK) - } + override fun getExtensionReceiverParameterType(function: IrFunction) = + function + .extensionReceiverParameter + ?.takeUnless { it.isHidden } + ?.type - platformSpecificFunctionMarks().forEach { - builder.appendSignature(it) - } + override fun getValueParameters(function: IrFunction): List = + function + .valueParameters + .asSequence() + .drop(function.contextReceiverParametersCount) + .filterNot { it.isHidden } + .toList() - valueParameters.take(contextReceiverParametersCount).forEach { - if (!it.isHidden) { - builder.appendSignature(MangleConstant.CONTEXT_RECEIVER_PREFIX) - mangleType(builder, it.type, null) - } - } + override fun getReturnType(function: IrFunction) = function.returnType - extensionReceiverParameter?.let { - if (!it.isHidden) { - builder.appendSignature(MangleConstant.EXTENSION_RECEIVER_PREFIX) - mangleValueParameter(builder, it, null) - } - } + override fun getTypeParametersWithIndices(function: IrFunction, container: IrDeclaration): List> = + function.typeParameters.map { IndexedValue(it.index, it.symbol) } - valueParameters.drop(contextReceiverParametersCount).collectForMangler(builder, MangleConstant.VALUE_PARAMETERS) { - if (!it.isHidden) { - appendSignature(specialValueParamPrefix(it)) - mangleValueParameter(this, it, null) - } - } - - typeParameters.collectForMangler(builder, MangleConstant.TYPE_PARAMETERS) { - mangleTypeParameter(this, it.symbol, it.index, null) - } - - if (!isCtor && !returnType.isUnit() && (addReturnType() || addReturnTypeSpecialCase(this))) { - mangleType(builder, returnType, null) - } - } + override fun isUnit(type: IrType) = type.isUnit() final override fun getEffectiveParent(typeParameter: IrTypeParameterSymbol): IrDeclaration = typeParameter.owner.run { when (val irParent = parent) { @@ -171,7 +146,6 @@ open class IrMangleComputer( } override fun visitClass(declaration: IrClass) { - isRealExpect = isRealExpect or declaration.isExpect typeParameterContainers.add(declaration) val className = declaration.name.asString() @@ -188,7 +162,6 @@ open class IrMangleComputer( "Expected at least one accessor or backing field for property ${declaration.render()}" } - isRealExpect = isRealExpect or declaration.isExpect typeParameterContainers.add(declaration) declaration.visitParent() @@ -268,16 +241,26 @@ open class IrMangleComputer( } override fun visitSimpleFunction(declaration: IrSimpleFunction) { - isRealExpect = isRealExpect or declaration.isExpect - val container = declaration.correspondingPropertySymbol?.owner ?: declaration val isStatic = declaration.dispatchReceiverParameter == null && (container.parent !is IrPackageFragment && !container.parent.isFacadeClass) - - declaration.mangleFunction(false, isStatic, container) + declaration.mangleFunction( + name = declaration.name, + isConstructor = false, + isStatic = isStatic, + container = container, + session = null + ) } - override fun visitConstructor(declaration: IrConstructor) = - declaration.mangleFunction(isCtor = true, isStatic = false, declaration) + override fun visitConstructor(declaration: IrConstructor) { + declaration.mangleFunction( + name = declaration.name, + isConstructor = true, + isStatic = false, + container = declaration, + session = null + ) + } } } diff --git a/compiler/testData/ir/irText/classes/classes.kt b/compiler/testData/ir/irText/classes/classes.kt index 9b8254c6945..3526ee243f1 100644 --- a/compiler/testData/ir/irText/classes/classes.kt +++ b/compiler/testData/ir/irText/classes/classes.kt @@ -1,9 +1,6 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57777 - class TestClass interface TestInterface diff --git a/compiler/testData/ir/irText/classes/enum.kt b/compiler/testData/ir/irText/classes/enum.kt index 684c6a4ac2b..7fa416ffdbe 100644 --- a/compiler/testData/ir/irText/classes/enum.kt +++ b/compiler/testData/ir/irText/classes/enum.kt @@ -3,7 +3,7 @@ // IGNORE_BACKEND: JS_IR_ES6 // MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57775, KT-57777 +// ^ KT-57775 enum class TestEnum1 { TEST1, TEST2 diff --git a/compiler/testData/ir/irText/classes/enumClassModality.kt b/compiler/testData/ir/irText/classes/enumClassModality.kt index f01e5eb3a6b..e3028076a09 100644 --- a/compiler/testData/ir/irText/classes/enumClassModality.kt +++ b/compiler/testData/ir/irText/classes/enumClassModality.kt @@ -2,7 +2,7 @@ // IGNORE_BACKEND: JS_IR_ES6 // MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57775, KT-57777 +// ^ KT-57775 enum class TestFinalEnum1 { X1 diff --git a/compiler/testData/ir/irText/classes/enumEntries.kt b/compiler/testData/ir/irText/classes/enumEntries.kt index 1a71cc6cae1..211eef071b1 100644 --- a/compiler/testData/ir/irText/classes/enumEntries.kt +++ b/compiler/testData/ir/irText/classes/enumEntries.kt @@ -3,9 +3,6 @@ // FULL_JDK // WITH_STDLIB -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57775, KT-57430, KT-57777 - enum class MyEnum { Ok, Nope } diff --git a/compiler/testData/ir/irText/classes/enumWithMultipleCtors.kt b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.kt index 51551c51877..c697bc4c529 100644 --- a/compiler/testData/ir/irText/classes/enumWithMultipleCtors.kt +++ b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.kt @@ -2,7 +2,7 @@ // IGNORE_BACKEND: JS_IR_ES6 // MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57775, KT-57777 +// ^ KT-57775 enum class A { X("asd"), diff --git a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.kt b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.kt index 07b732a3c24..5f84766a8f3 100644 --- a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.kt +++ b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.kt @@ -3,7 +3,7 @@ // IGNORE_BACKEND: JS_IR_ES6 // MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57775, KT-57777 +// ^ KT-57775 enum class Test0(val x: Int) { ZERO; diff --git a/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.kt b/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.kt index 11125acad62..81e5baa3dcd 100644 --- a/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.kt +++ b/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.kt @@ -1,9 +1,6 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57777 - annotation class TestAnn(val x: String) @TestAnn("class") diff --git a/compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.kt b/compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.kt index b327c8edbe9..05cdf5f4189 100644 --- a/compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.kt +++ b/compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.kt @@ -1,9 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - const val ONE = 1 annotation class A(val x: Int) diff --git a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.kt b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.kt index f8a9839006f..dfafc186680 100644 --- a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.kt +++ b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.kt @@ -1,7 +1,3 @@ -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - annotation class A(val x: String) class Cell(var value: Int) { diff --git a/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.kt b/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.kt index 1c0df345332..3af7753f09e 100644 --- a/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.kt +++ b/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.kt @@ -1,9 +1,6 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57777 - enum class En { A, B, C, D } annotation class TestAnn(val x: En) diff --git a/compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.kt b/compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.kt index dc7768a5e33..fe85147292e 100644 --- a/compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.kt +++ b/compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.kt @@ -1,9 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - annotation class TestAnn(val x: String) @field:TestAnn("testVal.field") diff --git a/compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.kt b/compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.kt index 5383c58f586..0cb2089c115 100644 --- a/compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.kt +++ b/compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.kt @@ -1,9 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - annotation class TestAnn(val x: String) @TestAnn("testVal.property") diff --git a/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.kt b/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.kt index 8857935a344..de5718be96a 100644 --- a/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.kt +++ b/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.kt @@ -1,9 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - annotation class TestAnn(val x: String) val test1: String diff --git a/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.kt b/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.kt index 65c1471ada9..aa6d4ade38c 100644 --- a/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.kt +++ b/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.kt @@ -1,9 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - annotation class AnnParam @setparam:AnnParam diff --git a/compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.kt b/compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.kt index 3e7731ac07b..778efe05dff 100644 --- a/compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.kt +++ b/compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.kt @@ -1,9 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - annotation class Ann class A { diff --git a/compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.kt b/compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.kt index f4c241a66aa..c91f9b4e05b 100644 --- a/compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.kt +++ b/compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.kt @@ -1,7 +1,3 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - val test = try { } catch (e : Throwable) { } diff --git a/compiler/testData/ir/irText/declarations/constValInitializers.kt b/compiler/testData/ir/irText/declarations/constValInitializers.kt index e0d09260bdf..f21864bfb3c 100644 --- a/compiler/testData/ir/irText/declarations/constValInitializers.kt +++ b/compiler/testData/ir/irText/declarations/constValInitializers.kt @@ -1,9 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - const val I0 = 0 const val I1 = 1 const val I2 = I0 + I1 + I1 diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/property.kt b/compiler/testData/ir/irText/declarations/contextReceivers/property.kt index 19ee12a665e..2318f9dd52c 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/property.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/property.kt @@ -1,9 +1,6 @@ // FIR_IDENTICAL // !LANGUAGE: +ContextReceivers -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// ^ KT-57818 - interface A { fun a(): Int } diff --git a/compiler/testData/ir/irText/declarations/deprecatedProperty.kt b/compiler/testData/ir/irText/declarations/deprecatedProperty.kt index 4d7f5d6f38c..b82fb13cf57 100644 --- a/compiler/testData/ir/irText/declarations/deprecatedProperty.kt +++ b/compiler/testData/ir/irText/declarations/deprecatedProperty.kt @@ -1,9 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - @Deprecated("") val testVal = 1 diff --git a/compiler/testData/ir/irText/declarations/extensionProperties.kt b/compiler/testData/ir/irText/declarations/extensionProperties.kt index 565c9f02024..566dfbe0f81 100644 --- a/compiler/testData/ir/irText/declarations/extensionProperties.kt +++ b/compiler/testData/ir/irText/declarations/extensionProperties.kt @@ -1,9 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - val String.test1 get() = 42 var String.test2 diff --git a/compiler/testData/ir/irText/declarations/genericDelegatedProperty.kt b/compiler/testData/ir/irText/declarations/genericDelegatedProperty.kt index 7a751718f84..56a4f789fee 100644 --- a/compiler/testData/ir/irText/declarations/genericDelegatedProperty.kt +++ b/compiler/testData/ir/irText/declarations/genericDelegatedProperty.kt @@ -1,6 +1,3 @@ -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// ^ KT-57818 - class C object Delegate { diff --git a/compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass2.kt b/compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass2.kt index 1374c2602be..79f04dddd05 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass2.kt +++ b/compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass2.kt @@ -4,9 +4,6 @@ // IGNORE_BACKEND_K2: JS_IR // IGNORE_BACKEND_K2: JS_IR_ES6 -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57777 - // MODULE: lib // FILE: lib.kt expect enum class MyEnum { diff --git a/compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass2.sig.kt.txt b/compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass2.sig.kt.txt index 27dcbf57671..a701110fd4b 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass2.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass2.sig.kt.txt @@ -1,7 +1,93 @@ -// FILE: main.kt +// MODULE: +// FILE: lib.kt // CHECK: // Mangled name: MyEnum +// Public signature: /MyEnum|null[1] +expect enum class MyEnum : Enum { + // CHECK: + // Mangled name: MyEnum#(){} + // Public signature: /MyEnum.|-5645683436151566731[1] + private expect constructor() /* primary */ + // CHECK: + // Mangled name: MyEnum.BAR + // Public signature: /MyEnum.BAR|null[1] + BAR + + // CHECK: + // Mangled name: MyEnum.FOO + // Public signature: /MyEnum.FOO|null[1] + FOO + + // CHECK: + // Mangled name: MyEnum#valueOf#static(kotlin.String){}MyEnum + // Public signature: /MyEnum.valueOf|4316550590519800984[1] + expect fun valueOf(value: String): MyEnum + + // CHECK JVM_IR: + // Mangled name: MyEnum#values#static(){}kotlin.Array + // Public signature: /MyEnum.values|3097625172661156808[1] + expect fun values(): Array + + // CHECK JVM_IR: + // Mangled name: MyEnum#clone(){}kotlin.Any + // Public signature: /MyEnum.clone|-6903128697527593263[1] + protected expect /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: MyEnum#compareTo(MyEnum){}kotlin.Int + // Public signature: /MyEnum.compareTo|2015858924903177055[1] + expect /* fake */ override operator fun compareTo(other: MyEnum): Int + + // CHECK JVM_IR: + // Mangled name: MyEnum#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /MyEnum.equals|722809408929142791[1] + expect /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: MyEnum#hashCode(){}kotlin.Int + // Public signature: /MyEnum.hashCode|-8048879360829830756[1] + expect /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: MyEnum#toString(){}kotlin.String + // Public signature: /MyEnum.toString|6958853723545266802[1] + expect /* fake */ override fun toString(): String + + // CHECK JVM_IR: + // Mangled name: MyEnum#static{}entries + // Public signature: /MyEnum.entries|-5134227801081826149[1] + expect val entries: EnumEntries + // CHECK: + // Mangled name: MyEnum##static(){}kotlin.enums.EnumEntries + // Public signature: /MyEnum.entries.|-3922959509726908718[1] + get(): EnumEntries + + // CHECK JVM_IR: + // Mangled name: MyEnum{}name + // Public signature: /MyEnum.name|4231860309499509769[1] + expect /* fake */ override val name: String + // CHECK: + // Mangled name: MyEnum#(){}kotlin.String + // Public signature: /MyEnum.name.|-8006111524522882650[1] + /* fake */ override get(): String + + // CHECK JVM_IR: + // Mangled name: MyEnum{}ordinal + // Public signature: /MyEnum.ordinal|1912745122988592376[1] + expect /* fake */ override val ordinal: Int + // CHECK: + // Mangled name: MyEnum#(){}kotlin.Int + // Public signature: /MyEnum.ordinal.|-6902664390061762634[1] + /* fake */ override get(): Int + +} + +// MODULE: main +// FILE: main.kt + +// CHECK JVM_IR: +// Mangled name: MyEnum // Public signature: /MyEnum|null[0] enum class MyEnum : Enum { // CHECK: @@ -46,7 +132,7 @@ enum class MyEnum : Enum { // CHECK JVM_IR: // Mangled name: MyEnum#equals(kotlin.Any?){}kotlin.Boolean // Public signature: /MyEnum.equals|722809408929142791[0] - /* fake */ override fun equals(other: Any?): Boolean + /* fake */ override operator fun equals(other: Any?): Boolean // CHECK JVM_IR: // Mangled name: MyEnum#hashCode(){}kotlin.Int diff --git a/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.kt b/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.kt index ad4bfb53722..a58e6979c1b 100644 --- a/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.kt +++ b/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.kt @@ -1,6 +1,6 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: ANY +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR // ^ KT-57429 val test1 = 42 diff --git a/compiler/testData/ir/irText/declarations/parameters/lambdas.kt b/compiler/testData/ir/irText/declarations/parameters/lambdas.kt index 956efa7d233..1c04b684c78 100644 --- a/compiler/testData/ir/irText/declarations/parameters/lambdas.kt +++ b/compiler/testData/ir/irText/declarations/parameters/lambdas.kt @@ -1,7 +1,3 @@ -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - val test1 : (String) -> String = { it } val test2 : Any.(Any) -> Any = { it.hashCode() } val test3 = { i: Int, j: Int -> } diff --git a/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.kt b/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.kt index 001edc65c7c..ecd93d6356a 100644 --- a/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.kt +++ b/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.kt @@ -1,8 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// ^ KT-57818 - val test1 get() = 42 var test2 get() = 42; set(value) {} diff --git a/compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.kt b/compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.kt index 33b91024f6a..2496437b725 100644 --- a/compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.kt +++ b/compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.kt @@ -1,8 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// ^ KT-57818 - class Test1 fun test2() {} diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.kt b/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.kt index cc303848e1f..71fdb748b47 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.kt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.kt @@ -1,10 +1,6 @@ // FIR_IDENTICAL // WITH_STDLIB -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - class MyClass(val value: String) operator fun MyClass.provideDelegate(host: Any?, p: Any): String = diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.kt b/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.kt index fab6d278410..4b2e5683e6b 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.kt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.kt @@ -1,9 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - class Delegate(val value: String) { operator fun getValue(thisRef: Any?, property: Any?) = value } diff --git a/compiler/testData/ir/irText/expressions/arrayAccess.kt b/compiler/testData/ir/irText/expressions/arrayAccess.kt index 28b16d03c99..02d3653c2d7 100644 --- a/compiler/testData/ir/irText/expressions/arrayAccess.kt +++ b/compiler/testData/ir/irText/expressions/arrayAccess.kt @@ -1,7 +1,3 @@ -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - val p = 0 fun foo() = 1 diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignment1.kt b/compiler/testData/ir/irText/expressions/augmentedAssignment1.kt index 87c5f51cf9b..3456297b053 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignment1.kt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignment1.kt @@ -1,7 +1,3 @@ -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - var p = 0 fun testVariable() { diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignment2.kt b/compiler/testData/ir/irText/expressions/augmentedAssignment2.kt index f7e556e10a1..f6361352b7a 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignment2.kt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignment2.kt @@ -1,7 +1,3 @@ -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - class A operator fun A.plusAssign(s: String) {} diff --git a/compiler/testData/ir/irText/expressions/boundCallableReferences.kt b/compiler/testData/ir/irText/expressions/boundCallableReferences.kt index 74862ab22a4..ca9d189fca7 100644 --- a/compiler/testData/ir/irText/expressions/boundCallableReferences.kt +++ b/compiler/testData/ir/irText/expressions/boundCallableReferences.kt @@ -1,9 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - class A { fun foo() {} val bar = 0 diff --git a/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.kt b/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.kt index 01cfddd9d98..089f274b9c3 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.kt @@ -1,4 +1,4 @@ -// MUTE_SIGNATURE_COMPARISON_K2: ANY +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR // ^ KT-57429 open class L(val ll: LL) diff --git a/compiler/testData/ir/irText/expressions/callableReferences/genericMember.kt b/compiler/testData/ir/irText/expressions/callableReferences/genericMember.kt index c303a0f8a9b..0f62ff374a1 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/genericMember.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/genericMember.kt @@ -1,9 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - class A { fun foo() {} val bar = 42 diff --git a/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.kt b/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.kt index ba4f7c557e0..dc84100f047 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.kt @@ -1,6 +1,6 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: ANY +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR // ^ KT-57433 package test diff --git a/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.kt b/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.kt index affba97989d..4394fbc63c2 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.kt @@ -1,7 +1,3 @@ -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - import Host.objectMember object Host { diff --git a/compiler/testData/ir/irText/expressions/castToTypeParameter.kt b/compiler/testData/ir/irText/expressions/castToTypeParameter.kt index 62054746084..064c28b042f 100644 --- a/compiler/testData/ir/irText/expressions/castToTypeParameter.kt +++ b/compiler/testData/ir/irText/expressions/castToTypeParameter.kt @@ -1,8 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// ^ KT-57818 - fun castFun(x: Any) = x as T fun Any.castExtFun() = this as T diff --git a/compiler/testData/ir/irText/expressions/contructorCall.kt b/compiler/testData/ir/irText/expressions/contructorCall.kt index 7d7010d48f7..b1fa47d8a66 100644 --- a/compiler/testData/ir/irText/expressions/contructorCall.kt +++ b/compiler/testData/ir/irText/expressions/contructorCall.kt @@ -1,9 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - class A val test = A() diff --git a/compiler/testData/ir/irText/expressions/elvis.kt b/compiler/testData/ir/irText/expressions/elvis.kt index a34986ac982..af35ea9bffc 100644 --- a/compiler/testData/ir/irText/expressions/elvis.kt +++ b/compiler/testData/ir/irText/expressions/elvis.kt @@ -1,7 +1,3 @@ -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - val p: Any? = null fun foo(): Any? = null diff --git a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.kt b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.kt index 86084fcb34b..1d4eeb9516b 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.kt +++ b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.kt @@ -2,7 +2,7 @@ // IGNORE_BACKEND: JS_IR_ES6 // MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57777, KT-57427, KT-57430 +// ^ KT-57427, KT-57430 enum class X { diff --git a/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.kt b/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.kt index 04df59cef3a..4b25ae6a3a8 100644 --- a/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.kt +++ b/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.kt @@ -1,9 +1,6 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57777 - enum class A { V1 } fun testVariableAssignment_throws(a: A) { diff --git a/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.kt b/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.kt index 54ee4e96a86..f1df6c1baea 100644 --- a/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.kt +++ b/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.kt @@ -1,8 +1,4 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - val String.okext: String get() = "OK" fun String.test5() = okext diff --git a/compiler/testData/ir/irText/expressions/field.kt b/compiler/testData/ir/irText/expressions/field.kt index b1135d0d878..0b217296122 100644 --- a/compiler/testData/ir/irText/expressions/field.kt +++ b/compiler/testData/ir/irText/expressions/field.kt @@ -1,7 +1,3 @@ -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - var testSimple: Int = 0 set(value) { field = value diff --git a/compiler/testData/ir/irText/expressions/funInterface/partialSam.kt b/compiler/testData/ir/irText/expressions/funInterface/partialSam.kt index 9b9a399b60e..e6e7ec3989e 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/partialSam.kt +++ b/compiler/testData/ir/irText/expressions/funInterface/partialSam.kt @@ -1,9 +1,5 @@ // WITH_STDLIB -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - fun interface Fn { fun run(s: String, i: Int, t: T): R } diff --git a/compiler/testData/ir/irText/expressions/genericPropertyCall.kt b/compiler/testData/ir/irText/expressions/genericPropertyCall.kt index cb93075b7fb..edbb516888c 100644 --- a/compiler/testData/ir/irText/expressions/genericPropertyCall.kt +++ b/compiler/testData/ir/irText/expressions/genericPropertyCall.kt @@ -1,8 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// ^ KT-57818 - val T.id get() = this val test = "abc".id diff --git a/compiler/testData/ir/irText/expressions/genericPropertyRef.kt b/compiler/testData/ir/irText/expressions/genericPropertyRef.kt index 1453fd21435..6bafedb011f 100644 --- a/compiler/testData/ir/irText/expressions/genericPropertyRef.kt +++ b/compiler/testData/ir/irText/expressions/genericPropertyRef.kt @@ -1,5 +1,5 @@ -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57436, KT-57429 +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR +// ^ KT-57429 class Value(var value: T = null as T, var text: String? = null) diff --git a/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.kt b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.kt index 4439fb69426..baabd692637 100644 --- a/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.kt +++ b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.kt @@ -1,6 +1,3 @@ -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// ^ KT-57818 - inline fun Any.test1(): T? = if (this is T) this else null diff --git a/compiler/testData/ir/irText/expressions/kt28006.kt b/compiler/testData/ir/irText/expressions/kt28006.kt index 1afcca43879..f362d8a7559 100644 --- a/compiler/testData/ir/irText/expressions/kt28006.kt +++ b/compiler/testData/ir/irText/expressions/kt28006.kt @@ -1,9 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - val test1 = "\uD83E\uDD17" val test2 = "\uD83E\uDD17\uD83E\uDD17" diff --git a/compiler/testData/ir/irText/expressions/kt36956.kt b/compiler/testData/ir/irText/expressions/kt36956.kt index e3e5b37050c..a09bb7b20eb 100644 --- a/compiler/testData/ir/irText/expressions/kt36956.kt +++ b/compiler/testData/ir/irText/expressions/kt36956.kt @@ -1,4 +1,4 @@ -// MUTE_SIGNATURE_COMPARISON_K2: ANY +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR // ^ KT-57429 class A(private val value: T) { diff --git a/compiler/testData/ir/irText/expressions/membersImportedFromObject.kt b/compiler/testData/ir/irText/expressions/membersImportedFromObject.kt index 44951c7fd80..2540f67a26a 100644 --- a/compiler/testData/ir/irText/expressions/membersImportedFromObject.kt +++ b/compiler/testData/ir/irText/expressions/membersImportedFromObject.kt @@ -1,9 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - import A.foo import A.bar import A.fooExt diff --git a/compiler/testData/ir/irText/expressions/objectAsCallable.kt b/compiler/testData/ir/irText/expressions/objectAsCallable.kt index 2087d0fb323..35167f2edaf 100644 --- a/compiler/testData/ir/irText/expressions/objectAsCallable.kt +++ b/compiler/testData/ir/irText/expressions/objectAsCallable.kt @@ -1,9 +1,6 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57777 - object A enum class En { X } diff --git a/compiler/testData/ir/irText/expressions/references.kt b/compiler/testData/ir/irText/expressions/references.kt index 7216b45a124..426c6753b48 100644 --- a/compiler/testData/ir/irText/expressions/references.kt +++ b/compiler/testData/ir/irText/expressions/references.kt @@ -1,9 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - val ok = "OK" val ok2 = ok val ok3: String get() = "OK" diff --git a/compiler/testData/ir/irText/expressions/reflectionLiterals.kt b/compiler/testData/ir/irText/expressions/reflectionLiterals.kt index 8272165c7d9..9c105022a0b 100644 --- a/compiler/testData/ir/irText/expressions/reflectionLiterals.kt +++ b/compiler/testData/ir/irText/expressions/reflectionLiterals.kt @@ -1,9 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - class A { fun foo() {} } diff --git a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.kt b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.kt index 2e384ea63a5..c0a3f9552c4 100644 --- a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.kt +++ b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.kt @@ -1,4 +1,4 @@ -// MUTE_SIGNATURE_COMPARISON_K2: ANY +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR // ^ KT-57433 package test diff --git a/compiler/testData/ir/irText/expressions/signedToUnsignedConversions.kt b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions.kt index a020f2302e2..8f1f382509e 100644 --- a/compiler/testData/ir/irText/expressions/signedToUnsignedConversions.kt +++ b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions.kt @@ -1,9 +1,6 @@ // WITH_STDLIB // !LANGUAGE: +ImplicitSignedToUnsignedIntegerConversion -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// ^ KT-57818 - // FILE: signedToUnsignedConversions_annotation.kt package kotlin.internal diff --git a/compiler/testData/ir/irText/expressions/stringTemplates.kt b/compiler/testData/ir/irText/expressions/stringTemplates.kt index 0c0807c774d..2f881643b30 100644 --- a/compiler/testData/ir/irText/expressions/stringTemplates.kt +++ b/compiler/testData/ir/irText/expressions/stringTemplates.kt @@ -1,9 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - fun foo(): String = "" val x = 42 diff --git a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.kt b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.kt index 02b0c6f151e..bb84e7adfc9 100644 --- a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.kt +++ b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.kt @@ -1,9 +1,6 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57777 - val n: Any? = null enum class En(val x: String?) { diff --git a/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.kt b/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.kt index f57078cf97c..42e4391e5e8 100644 --- a/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.kt +++ b/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.kt @@ -1,7 +1,3 @@ -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - import Host.Nested class C(x: Int) diff --git a/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.kt b/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.kt index 8e89aab4762..5a9c3058d72 100644 --- a/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.kt +++ b/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.kt @@ -1,8 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// ^ KT-57818 - inline fun classRefFun() = T::class inline fun Any.classRefExtFun() = T::class diff --git a/compiler/testData/ir/irText/expressions/unsignedIntegerLiterals.kt b/compiler/testData/ir/irText/expressions/unsignedIntegerLiterals.kt index ec536d75aa3..4c31aadf17d 100644 --- a/compiler/testData/ir/irText/expressions/unsignedIntegerLiterals.kt +++ b/compiler/testData/ir/irText/expressions/unsignedIntegerLiterals.kt @@ -1,9 +1,6 @@ // FIR_IDENTICAL // WITH_STDLIB -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// ^ KT-57818 - val testSimpleUIntLiteral = 1u val testSimpleUIntLiteralWithOverflow = 0xFFFF_FFFFu diff --git a/compiler/testData/ir/irText/expressions/values.kt b/compiler/testData/ir/irText/expressions/values.kt index 4d3df96572c..c98a648a187 100644 --- a/compiler/testData/ir/irText/expressions/values.kt +++ b/compiler/testData/ir/irText/expressions/values.kt @@ -1,9 +1,6 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57777 - enum class Enum { A } object A val a = 0 diff --git a/compiler/testData/ir/irText/expressions/vararg.kt b/compiler/testData/ir/irText/expressions/vararg.kt index 360379261b8..7cb588e93ff 100644 --- a/compiler/testData/ir/irText/expressions/vararg.kt +++ b/compiler/testData/ir/irText/expressions/vararg.kt @@ -1,9 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - val test1 = arrayOf() val test2 = arrayOf("1", "2", "3") val test3 = arrayOf("0", *test2, *test1, "4") diff --git a/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.kt b/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.kt index 90951a985a7..d5417777b40 100644 --- a/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.kt +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.kt @@ -1,8 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// ^ KT-57818 - val T.gk: () -> T get() = { -> this } diff --git a/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.kt b/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.kt index 641362c9f33..9b6dea1c212 100644 --- a/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.kt +++ b/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.kt @@ -1,9 +1,6 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57777 - enum class En { A, B, C } fun test() { diff --git a/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.kt b/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.kt index 9380675cedc..79113da3eb3 100644 --- a/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.kt +++ b/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.kt @@ -2,9 +2,6 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57777 - enum class EE(val myName: String = this.toString().lowercase()) { ENTRY; } diff --git a/compiler/testData/ir/irText/js/external/kt38765.kt b/compiler/testData/ir/irText/js/external/kt38765.kt index 07e75ea29db..cba5b06cfcb 100644 --- a/compiler/testData/ir/irText/js/external/kt38765.kt +++ b/compiler/testData/ir/irText/js/external/kt38765.kt @@ -1,8 +1,5 @@ // TARGET_BACKEND: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57777 - package events external open class internal { diff --git a/compiler/testData/ir/irText/lambdas/justLambda.kt b/compiler/testData/ir/irText/lambdas/justLambda.kt index 2b150212a69..033b03fce77 100644 --- a/compiler/testData/ir/irText/lambdas/justLambda.kt +++ b/compiler/testData/ir/irText/lambdas/justLambda.kt @@ -1,9 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - val test1 = { 42 } val test2 = { } diff --git a/compiler/testData/ir/irText/singletons/enumEntry.kt b/compiler/testData/ir/irText/singletons/enumEntry.kt index 9fa949119b3..8a47a1b0bae 100644 --- a/compiler/testData/ir/irText/singletons/enumEntry.kt +++ b/compiler/testData/ir/irText/singletons/enumEntry.kt @@ -2,7 +2,7 @@ // IGNORE_BACKEND: JS_IR_ES6 // MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57775, KT-57430, KT-57777 +// ^ KT-57775, KT-57430 enum class Z { ENTRY { diff --git a/compiler/testData/ir/irText/stubs/simple.kt b/compiler/testData/ir/irText/stubs/simple.kt index 579c95f4df9..a8b4361cc3b 100644 --- a/compiler/testData/ir/irText/stubs/simple.kt +++ b/compiler/testData/ir/irText/stubs/simple.kt @@ -1,7 +1,3 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: NATIVE -// ^ KT-57818 - val test = 2 + 2 diff --git a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.kt b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.kt index bcfbc359c31..27c49de6cd0 100644 --- a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.kt +++ b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.kt @@ -1,6 +1,6 @@ // !LANGUAGE: -ForbidUsingExtensionPropertyTypeParameterInDelegate -// MUTE_SIGNATURE_COMPARISON_K2: ANY +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR // ^ KT-57429 import kotlin.reflect.KProperty1 diff --git a/compiler/testData/ir/irText/types/genericPropertyReferenceType.kt b/compiler/testData/ir/irText/types/genericPropertyReferenceType.kt index 57a62249a65..5c941bc1d38 100644 --- a/compiler/testData/ir/irText/types/genericPropertyReferenceType.kt +++ b/compiler/testData/ir/irText/types/genericPropertyReferenceType.kt @@ -1,6 +1,6 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: ANY +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR // ^ KT-57429, KT-57427 import kotlin.reflect.KMutableProperty