From 6e8283a6fe9e19480c7230756db3fc727714123c Mon Sep 17 00:00:00 2001 From: Sergej Jaskiewicz Date: Thu, 6 Apr 2023 15:07:36 +0200 Subject: [PATCH] [IR] Dump IdSignatures and mangled names in irText tests The reason #1 for this feature is that we want to test IdSignatures generated for declarations. Currently, there is no (easy) way to ensure that a change in the signature building logic doesn't cause any breaking changes wrt klibs. Now, most IdSignatures include hashed mangled names in them, so even if we catch a regression where the included hash changes, there would be no way of knowing immediately what caused it, unless we'd also have mangled names in the expectations. The reason #2 is to test the manglers themselves. Currently, there are no tests for them. They heavily duplicate each other, this is already causing issues (see KT-57427) that would be very hard to catch without these tests. ^KT-58238 Fixed --- .idea/dictionaries/sergej_jaskiewicz.xml | 7 + .../kotlin/ir/util/dumpKotlinLike.kt | 500 ++++---- .../ir/irText/classes/47424.sig.kt.txt | 87 ++ .../irText/classes/abstractMembers.sig.kt.txt | 84 ++ .../classes/annotationClasses.sig.kt.txt | 92 ++ ...ringInDelegatingConstructorCall.sig.kt.txt | 109 ++ .../clashingFakeOverrideSignatures.sig.kt.txt | 233 ++++ .../ir/irText/classes/classMembers.sig.kt.txt | 142 +++ .../testData/ir/irText/classes/classes.kt | 3 + .../ir/irText/classes/classes.sig.kt.txt | 142 +++ .../ir/irText/classes/cloneable.sig.kt.txt | 69 ++ .../irText/classes/companionObject.sig.kt.txt | 44 + .../dataClasses/dataClassWithArrayMembers.kt | 5 +- .../dataClassWithArrayMembers.sig.kt.txt | 346 ++++++ .../dataClasses/dataClasses.sig.kt.txt | 286 +++++ .../classes/dataClasses/dataClassesGeneric.kt | 5 +- .../dataClasses/dataClassesGeneric.sig.kt.txt | 248 ++++ .../dataClasses/delegationInSealed.sig.kt.txt | 129 ++ .../classes/dataClasses/kt31649.sig.kt.txt | 108 ++ .../classes/dataClasses/kt49936.sig.kt.txt | 74 ++ ...mbdaInDataClassDefaultParameter.sig.kt.txt | 124 ++ .../dataClasses/openDataClass.sig.kt.txt | 82 ++ .../classes/declarationOrder.sig.kt.txt | 92 ++ .../classes/delegatedGenericImplementation.kt | 3 + .../irText/classes/delegatedImplementation.kt | 5 +- .../delegatedImplementation.sig.kt.txt | 249 ++++ .../delegatedImplementationOfJavaInterface.kt | 4 + ...gatedImplementationWithExplicitOverride.kt | 5 +- ...lementationWithExplicitOverride.sig.kt.txt | 62 + ...ngConstructorCallToTypeAliasConstructor.kt | 3 + ...uctorCallToTypeAliasConstructor.sig.kt.txt | 77 ++ ...torCallsInSecondaryConstructors.sig.kt.txt | 30 + compiler/testData/ir/irText/classes/enum.kt | 3 + .../ir/irText/classes/enum.sig.kt.txt | 1005 +++++++++++++++ .../ir/irText/classes/enumClassModality.kt | 4 + .../classes/enumClassModality.sig.kt.txt | 1089 +++++++++++++++++ .../testData/ir/irText/classes/enumEntries.kt | 3 + .../ir/irText/classes/enumEntries.sig.kt.txt | 88 ++ .../irText/classes/enumWithMultipleCtors.kt | 4 + .../classes/enumWithMultipleCtors.sig.kt.txt | 292 +++++ .../irText/classes/enumWithSecondaryCtor.kt | 3 + .../classes/enumWithSecondaryCtor.sig.kt.txt | 557 +++++++++ ...verridesForJavaNonStaticMembers.sig.kt.txt | 52 + ...keOverridesForJavaStaticMembers.sig.kt.txt | 11 + ...mplicitNotNullOnDelegatedImplementation.kt | 6 +- ...otNullOnDelegatedImplementation.sig.kt.txt | 171 +++ .../ir/irText/classes/initBlock.sig.kt.txt | 78 ++ .../ir/irText/classes/initVal.sig.kt.txt | 69 ++ .../ir/irText/classes/initValInLambda.kt | 1 + .../irText/classes/initValInLambda.sig.kt.txt | 23 + .../ir/irText/classes/initVar.sig.kt.txt | 162 +++ .../ir/irText/classes/inlineClass.sig.kt.txt | 46 + .../classes/inlineClassSyntheticMethods.kt | 3 + .../inlineClassSyntheticMethods.sig.kt.txt | 93 ++ .../ir/irText/classes/innerClass.sig.kt.txt | 33 + ...rClassWithDelegatingConstructor.sig.kt.txt | 38 + .../ir/irText/classes/kt19306.sig.kt.txt | 64 + .../testData/ir/irText/classes/kt43217.kt | 5 + .../ir/irText/classes/kt43217.sig.kt.txt | 76 ++ .../testData/ir/irText/classes/kt45853.kt | 4 + .../testData/ir/irText/classes/kt45934.kt | 3 + .../ir/irText/classes/localClasses.kt | 7 +- .../ir/irText/classes/localClasses.sig.kt.txt | 17 + .../classes/objectLiteralExpressions.kt | 4 + .../objectLiteralExpressions.sig.kt.txt | 132 ++ .../classes/objectWithInitializers.sig.kt.txt | 46 + .../classes/outerClassAccess.sig.kt.txt | 53 + .../classes/primaryConstructor.sig.kt.txt | 105 ++ ...tructorWithSuperConstructorCall.sig.kt.txt | 72 ++ .../classes/qualifiedSuperCalls.sig.kt.txt | 76 ++ .../irText/classes/sealedClasses.sig.kt.txt | 80 ++ ...orWithInitializersFromClassBody.sig.kt.txt | 65 + .../classes/secondaryConstructors.sig.kt.txt | 15 + .../smartCastInValInitialization.sig.kt.txt | 46 + .../ir/irText/classes/superCalls.sig.kt.txt | 72 ++ .../classes/superCallsComposed.sig.kt.txt | 80 ++ ...nnotationOnClassWithInitializer.sig.kt.txt | 23 + ...nnotationsInAnnotationArguments.sig.kt.txt | 76 ++ .../annotationsOnDelegatedMembers.kt | 5 +- ...tionsWithDefaultParameterValues.sig.kt.txt | 65 + ...annotationsWithVarargParameters.sig.kt.txt | 41 + ...thDefaultValueInAnnotationClass.sig.kt.txt | 20 + .../arrayInAnnotationArguments.sig.kt.txt | 60 + .../classLiteralInAnnotation.sig.kt.txt | 40 + .../annotations/classesWithAnnotations.kt | 3 + .../classesWithAnnotations.sig.kt.txt | 193 +++ .../constExpressionsInAnnotationArguments.kt | 4 + ...xpressionsInAnnotationArguments.sig.kt.txt | 47 + .../constructorsWithAnnotations.sig.kt.txt | 40 + .../delegateFieldWithAnnotations.kt | 4 + .../delegateFieldWithAnnotations.sig.kt.txt | 32 + ...legatedPropertyAccessorsWithAnnotations.kt | 6 +- ...ropertyAccessorsWithAnnotations.sig.kt.txt | 94 ++ .../annotations/enumEntriesWithAnnotations.kt | 3 + .../annotations/enumsInAnnotationArguments.kt | 3 + .../enumsInAnnotationArguments.sig.kt.txt | 151 +++ .../annotations/fieldsWithAnnotations.kt | 7 +- .../fieldsWithAnnotations.sig.kt.txt | 51 + .../annotations/fileAnnotations.sig.kt.txt | 27 + .../functionsWithAnnotations.sig.kt.txt | 29 + .../annotations/genericAnnotationClasses.kt | 5 +- .../annotations/inheritingDeprecation.kt | 5 +- .../inheritingDeprecation.sig.kt.txt | 140 +++ .../annotations/javaAnnotation.sig.kt.txt | 18 + .../javaAnnotationWithSingleArrayArgument.kt | 4 + ...egatedPropertiesWithAnnotations.sig.kt.txt | 28 + ...ipleAnnotationsInSquareBrackets.sig.kt.txt | 41 + ...tructorParameterWithAnnotations.sig.kt.txt | 34 + .../annotations/propertiesWithAnnotations.kt | 7 +- .../propertiesWithAnnotations.sig.kt.txt | 36 + ...sFromClassHeaderWithAnnotations.sig.kt.txt | 65 + .../propertyAccessorsWithAnnotations.kt | 7 +- ...ropertyAccessorsWithAnnotations.sig.kt.txt | 85 ++ .../propertySetterParameterWithAnnotations.kt | 7 +- ...ySetterParameterWithAnnotations.sig.kt.txt | 54 + .../receiverParameterWithAnnotations.kt | 5 + ...eceiverParameterWithAnnotations.sig.kt.txt | 62 + .../spreadOperatorInAnnotationArguments.kt | 5 +- .../typeAliasesWithAnnotations.sig.kt.txt | 29 + .../typeParametersWithAnnotations.sig.kt.txt | 17 + .../valueParametersWithAnnotations.sig.kt.txt | 51 + .../varargsInAnnotationArguments.sig.kt.txt | 85 ++ .../variablesWithAnnotations.sig.kt.txt | 28 + .../catchParameterInTopLevelProperty.kt | 7 +- ...atchParameterInTopLevelProperty.sig.kt.txt | 9 + .../classLevelProperties.sig.kt.txt | 123 ++ .../declarations/constValInitializers.kt | 4 + .../constValInitializers.sig.kt.txt | 84 ++ .../arrayAccessCompositeOperators.kt | 3 + .../arrayAccessCompositeOperators.sig.kt.txt | 84 ++ .../contextReceivers/arrayAccessOperators.kt | 3 + .../arrayAccessOperators.sig.kt.txt | 65 + .../declarations/contextReceivers/class.kt | 4 + .../contextReceivers/class.sig.kt.txt | 50 + .../compoundAssignmentOperators.kt | 3 + .../compoundAssignmentOperators.sig.kt.txt | 114 ++ .../contextReceivers/contextReceiverMethod.kt | 3 + .../contextReceiverMethod.sig.kt.txt | 42 + .../contextualFunctionConversion.sig.kt.txt | 15 + .../contextReceivers/contextualInlineCall.kt | 5 +- .../contextualInlineCall.sig.kt.txt | 71 ++ .../contextualPrimaryConstructorWithParams.kt | 4 + ...ualPrimaryConstructorWithParams.sig.kt.txt | 65 + .../delegatedPropertiesOperators.kt | 3 + .../delegatedPropertiesOperators.sig.kt.txt | 83 ++ .../contextReceivers/fromKEEP/canvas.kt | 3 + .../fromKEEP/canvas.sig.kt.txt | 71 ++ .../contextReceivers/fromKEEP/compareTo.kt | 3 + .../fromKEEP/compareTo.sig.kt.txt | 79 ++ .../contextReceivers/fromKEEP/dp.kt | 3 + .../contextReceivers/fromKEEP/dp.sig.kt.txt | 35 + .../fromKEEP/functionalType.kt | 3 + .../fromKEEP/functionalType.sig.kt.txt | 62 + .../contextReceivers/fromKEEP/monoidSum.kt | 3 + .../fromKEEP/monoidSum.sig.kt.txt | 93 ++ .../declarations/contextReceivers/function.kt | 4 + .../contextReceivers/function.sig.kt.txt | 35 + .../contextReceivers/functionalType.kt | 3 + .../functionalType.sig.kt.txt | 80 ++ .../contextReceivers/genericOuterClass.kt | 4 + .../genericOuterClass.sig.kt.txt | 42 + .../contextReceivers/iteratorOperator.kt | 3 + .../iteratorOperator.sig.kt.txt | 138 +++ .../declarations/contextReceivers/kt52791.kt | 5 +- .../contextReceivers/kt52791.sig.kt.txt | 20 + .../declarations/contextReceivers/lazy.kt | 4 + .../contextReceivers/lazy.sig.kt.txt | 64 + .../contextReceivers/overloadPriority.kt | 4 + .../overloadPriority.sig.kt.txt | 30 + .../contextReceivers/overloading.kt | 4 + .../contextReceivers/overloading.sig.kt.txt | 20 + .../passingLambdaToContextualParam.sig.kt.txt | 30 + .../contextReceivers/plusMatrix.kt | 3 + .../contextReceivers/plusMatrix.sig.kt.txt | 34 + .../declarations/contextReceivers/property.kt | 3 + .../contextReceivers/property.sig.kt.txt | 44 + .../contextReceivers/thisWithCustomLabel.kt | 3 + .../thisWithCustomLabel.sig.kt.txt | 76 ++ .../typeParameterAsContextReceiver.kt | 4 + .../typeParameterAsContextReceiver.sig.kt.txt | 17 + .../contextReceivers/unaryOperators.kt | 3 + .../unaryOperators.sig.kt.txt | 86 ++ .../irText/declarations/defaultArguments.kt | 4 + .../declarations/defaultArguments.sig.kt.txt | 8 + .../delegatedProperties.sig.kt.txt | 79 ++ .../irText/declarations/deprecatedProperty.kt | 6 +- .../deprecatedProperty.sig.kt.txt | 160 +++ .../declarations/extensionProperties.kt | 7 +- .../extensionProperties.sig.kt.txt | 67 + .../declarations/fakeOverrides.sig.kt.txt | 75 ++ .../fileWithAnnotations.sig.kt.txt | 16 + .../fileWithTypeAliasesOnly.sig.kt.txt | 4 + .../declarations/genericDelegatedProperty.kt | 5 +- .../genericDelegatedProperty.sig.kt.txt | 51 + .../inlineCollectionOfInlineClass.sig.kt.txt | 181 +++ .../interfaceProperties.sig.kt.txt | 63 + .../dataClassWithJvmRecord.sig.kt.txt | 50 + .../javaRecordComponentAccess.sig.kt.txt | 10 + .../ir/irText/declarations/kt27005.sig.kt.txt | 21 + .../ir/irText/declarations/kt29833.sig.kt.txt | 31 + .../ir/irText/declarations/kt35550.kt | 3 + .../ir/irText/declarations/kt35550.sig.kt.txt | 46 + .../ir/irText/declarations/kt45308.kt | 3 + .../ir/irText/declarations/kt45308.sig.kt.txt | 25 + .../ir/irText/declarations/kt47527.sig.kt.txt | 24 + .../ir/irText/declarations/kt52677.sig.kt.txt | 135 ++ .../declarations/localClassWithOverrides.kt | 7 +- .../localClassWithOverrides.sig.kt.txt | 74 ++ .../localDelegatedProperties.sig.kt.txt | 10 + .../declarations/localVarInDoWhile.sig.kt.txt | 5 + .../expectClassInherited.sig.kt.txt | 74 ++ .../expectIntersectionOverride.sig.kt.txt | 121 ++ .../expectMemberInNotExpectClass.sig.kt.txt | 92 ++ ...expectMemberInNotExpectClassFir.sig.kt.txt | 98 ++ .../expectedEnumClass.sig.kt.txt | 222 ++++ .../multiplatform/expectedEnumClass2.kt | 3 + .../expectedEnumClass2.sig.kt.txt | 88 ++ .../expectedSealedClass.sig.kt.txt | 44 + .../packageLevelProperties.sig.kt.txt | 112 ++ .../declarations/parameters/class.sig.kt.txt | 46 + .../declarations/parameters/constructor.kt | 5 +- .../parameters/constructor.sig.kt.txt | 147 +++ .../parameters/dataClassMembers.kt | 3 + .../parameters/dataClassMembers.sig.kt.txt | 82 ++ .../parameters/defaultPropertyAccessors.kt | 6 +- .../defaultPropertyAccessors.sig.kt.txt | 106 ++ .../parameters/delegatedMembers.kt | 5 +- .../parameters/delegatedMembers.sig.kt.txt | 65 + .../declarations/parameters/fun.sig.kt.txt | 41 + .../parameters/genericInnerClass.kt | 6 +- .../parameters/genericInnerClass.sig.kt.txt | 27 + .../irText/declarations/parameters/lambdas.kt | 6 +- .../parameters/lambdas.sig.kt.txt | 48 + .../declarations/parameters/localFun.kt | 7 +- .../parameters/localFun.sig.kt.txt | 20 + .../parameters/propertyAccessors.kt | 5 +- .../parameters/propertyAccessors.sig.kt.txt | 179 +++ .../parameters/typeParameterBeforeBound.kt | 4 + .../typeParameterBeforeBound.sig.kt.txt | 29 + .../typeParameterBoundedBySubclass.sig.kt.txt | 54 + .../useNextParamInLambda.sig.kt.txt | 16 + .../primaryCtorDefaultArguments.sig.kt.txt | 23 + .../primaryCtorProperties.sig.kt.txt | 39 + .../provideDelegate/differentReceivers.kt | 4 + .../differentReceivers.sig.kt.txt | 75 ++ .../provideDelegate/javaDelegate.kt | 5 +- .../provideDelegate/javaDelegate.sig.kt.txt | 33 + .../declarations/provideDelegate/local.kt | 5 + .../provideDelegate/local.sig.kt.txt | 74 ++ .../localDifferentReceivers.kt | 4 + .../localDifferentReceivers.sig.kt.txt | 59 + .../provideDelegate/member.sig.kt.txt | 85 ++ .../memberExtension.sig.kt.txt | 74 ++ .../declarations/provideDelegate/topLevel.kt | 5 + .../provideDelegate/topLevel.sig.kt.txt | 74 ++ .../ir/irText/declarations/typeAlias.kt | 5 +- .../errors/suppressedNonPublicCall.sig.kt.txt | 21 + .../errors/unresolvedReference.sig.kt.txt | 40 + .../expressions/ambiguousFieldAccess.kt | 4 + .../ambiguousFieldAccess.sig.kt.txt | 28 + .../expressions/argumentMappedWithError.kt | 3 + .../argumentMappedWithError.sig.kt.txt | 22 + .../ir/irText/expressions/arrayAccess.kt | 6 +- .../irText/expressions/arrayAccess.sig.kt.txt | 28 + .../expressions/arrayAssignment.sig.kt.txt | 18 + .../arrayAugmentedAssignment1.sig.kt.txt | 54 + .../arrayAugmentedAssignment2.sig.kt.txt | 32 + .../irText/expressions/assignments.sig.kt.txt | 37 + .../expressions/augmentedAssignment1.kt | 4 + .../augmentedAssignment1.sig.kt.txt | 26 + .../expressions/augmentedAssignment2.kt | 4 + .../augmentedAssignment2.sig.kt.txt | 58 + ...gmentedAssignmentWithExpression.sig.kt.txt | 44 + .../expressions/badBreakContinue.sig.kt.txt | 20 + .../badInlinedBreakContinue.sig.kt.txt | 60 + .../ir/irText/expressions/bangbang.sig.kt.txt | 34 + .../booleanConstsInAndAndOrOr.sig.kt.txt | 10 + .../expressions/booleanOperators.sig.kt.txt | 32 + .../expressions/boundCallableReferences.kt | 5 + .../boundCallableReferences.sig.kt.txt | 69 ++ .../ir/irText/expressions/boxOk.sig.kt.txt | 8 + .../expressions/breakContinue.sig.kt.txt | 15 + .../breakContinueInLoopHeader.sig.kt.txt | 25 + .../breakContinueInWhen.sig.kt.txt | 30 + .../ir/irText/expressions/builtinOperators.kt | 4 + .../expressions/builtinOperators.sig.kt.txt | 7 + .../callWithReorderedArguments.sig.kt.txt | 42 + .../adaptedExtensionFunctions.sig.kt.txt | 46 + .../adaptedWithCoercionToUnit.sig.kt.txt | 54 + .../boundInlineAdaptedReference.kt | 3 + .../boundInlineAdaptedReference.sig.kt.txt | 20 + .../boundInnerGenericConstructor.kt | 4 + .../boundInnerGenericConstructor.sig.kt.txt | 64 + .../caoWithAdaptationForSam.sig.kt.txt | 110 ++ ...constructorWithAdaptedArguments.sig.kt.txt | 65 + ...efaultParametersAsKCallableStar.sig.kt.txt | 72 ++ .../genericLocalClassConstructorReference.kt | 5 +- ...cLocalClassConstructorReference.sig.kt.txt | 74 ++ .../callableReferences/genericMember.kt | 7 +- .../genericMember.sig.kt.txt | 52 + .../callableReferences/importedFromObject.kt | 6 +- .../importedFromObject.sig.kt.txt | 81 ++ .../callableReferences/kt37131.sig.kt.txt | 55 + .../callableReferences/kt46069.sig.kt.txt | 43 + .../suspendConversion.sig.kt.txt | 124 ++ .../callableReferences/typeArguments.kt | 4 + .../typeArguments.sig.kt.txt | 62 + ...erReferenceWithAdaptedArguments.sig.kt.txt | 63 + .../varargFunImportedFromObject.sig.kt.txt | 43 + .../withAdaptationForSam.sig.kt.txt | 30 + .../withAdaptedArguments.sig.kt.txt | 109 ++ ...thArgumentAdaptationAndReceiver.sig.kt.txt | 49 + .../withVarargViewedAsArray.sig.kt.txt | 61 + .../ir/irText/expressions/calls.sig.kt.txt | 48 + .../irText/expressions/castToTypeParameter.kt | 4 + .../castToTypeParameter.sig.kt.txt | 95 ++ .../catchParameterAccess.sig.kt.txt | 5 + .../expressions/chainOfSafeCalls.sig.kt.txt | 35 + ...ndConversionForSimpleExpression.sig.kt.txt | 30 + .../expressions/classReference.sig.kt.txt | 16 + .../expressions/coercionToUnit.sig.kt.txt | 19 + .../complexAugmentedAssignment.sig.kt.txt | 139 +++ ...ructorWithOwnTypeParametersCall.sig.kt.txt | 32 + .../ir/irText/expressions/contructorCall.kt | 7 +- .../expressions/contructorCall.sig.kt.txt | 23 + .../conventionComparisons.sig.kt.txt | 54 + .../expressions/destructuring1.sig.kt.txt | 43 + .../destructuringWithUnderscore.sig.kt.txt | 51 + .../expressions/dotQualified.sig.kt.txt | 16 + .../testData/ir/irText/expressions/elvis.kt | 6 +- .../ir/irText/expressions/elvis.sig.kt.txt | 60 + .../irText/expressions/enumEntryAsReceiver.kt | 3 + .../enumEntryAsReceiver.sig.kt.txt | 219 ++++ .../enumEntryReferenceFromEnumEntryClass.kt | 3 + .../ir/irText/expressions/equality.sig.kt.txt | 24 + .../ir/irText/expressions/equals.sig.kt.txt | 20 + .../exclExclOnPlatformType.sig.kt.txt | 10 + .../expressions/exhaustiveWhenElseBranch.kt | 3 + .../exhaustiveWhenElseBranch.sig.kt.txt | 155 +++ .../expressions/extFunInvokeAsFun.sig.kt.txt | 10 + .../expressions/extFunSafeInvoke.sig.kt.txt | 8 + .../extensionPropertyGetterCall.kt | 5 + .../extensionPropertyGetterCall.sig.kt.txt | 20 + .../testData/ir/irText/expressions/field.kt | 6 +- .../ir/irText/expressions/field.sig.kt.txt | 32 + .../comparableWithDoubleOrFloat.sig.kt.txt | 16 + ...hsConditionPossiblyAffectingLhs.sig.kt.txt | 8 + .../floatingPointCompareTo.sig.kt.txt | 88 ++ .../floatingPointEqeq.sig.kt.txt | 112 ++ .../floatingPointEquals.sig.kt.txt | 160 +++ .../floatingPointExcleq.sig.kt.txt | 112 ++ .../floatingPointLess.sig.kt.txt | 64 + .../nullableAnyAsIntToDouble.sig.kt.txt | 8 + .../nullableFloatingPointEqeq.sig.kt.txt | 32 + ...erWithPrimitiveNumericSupertype.sig.kt.txt | 75 ++ .../whenByFloatingPoint.sig.kt.txt | 56 + .../ir/irText/expressions/for.sig.kt.txt | 20 + .../forWithBreakContinue.sig.kt.txt | 20 + .../forWithImplicitReceivers.sig.kt.txt | 74 ++ .../expressions/funImportedFromObject.kt | 4 + .../funImportedFromObject.sig.kt.txt | 29 + ...rrayAsVarargAfterSamArgument_fi.sig.kt.txt | 27 + .../basicFunInterfaceConversion.kt | 4 + .../basicFunInterfaceConversion.sig.kt.txt | 36 + .../funInterface/castFromAny.sig.kt.txt | 17 + .../funInterface/functionSupertype.sig.kt.txt | 22 + .../expressions/funInterface/partialSam.kt | 4 + .../funInterface/partialSam.sig.kt.txt | 63 + .../samConversionInVarargs.sig.kt.txt | 40 + .../samConversionInVarargsMixed.sig.kt.txt | 22 + ...amConversionOnCallableReference.sig.kt.txt | 56 + .../samConversionsWithSmartCasts.sig.kt.txt | 107 ++ ...unInterfaceConstructorReference.sig.kt.txt | 115 ++ ...genericConstructorCallWithTypeArguments.kt | 3 + ...onstructorCallWithTypeArguments.sig.kt.txt | 39 + .../irText/expressions/genericPropertyCall.kt | 6 +- .../genericPropertyCall.sig.kt.txt | 24 + .../irText/expressions/genericPropertyRef.kt | 5 +- .../expressions/genericPropertyRef.sig.kt.txt | 158 +++ .../ir/irText/expressions/identity.sig.kt.txt | 24 + .../ir/irText/expressions/ifElseIf.sig.kt.txt | 23 + ...icitCastInReturnFromConstructor.sig.kt.txt | 15 + .../implicitCastOnPlatformType.sig.kt.txt | 5 + .../implicitCastToNonNull.sig.kt.txt | 37 + .../implicitCastToTypeParameter.kt | 5 +- .../implicitCastToTypeParameter.sig.kt.txt | 48 + ...mplicitNotNullInDestructuringAssignment.kt | 4 + ...otNullInDestructuringAssignment.sig.kt.txt | 15 + .../ir/irText/expressions/in.sig.kt.txt | 32 + .../expressions/incrementDecrement.sig.kt.txt | 178 +++ .../expressions/inlinedBreakContinue.kt | 4 + .../inlinedBreakContinue.sig.kt.txt | 66 + .../expressions/interfaceThisRef.sig.kt.txt | 17 + ...aSyntheticGenericPropretyAccess.sig.kt.txt | 5 + .../javaSyntheticPropertyAccess.sig.kt.txt | 5 + ...dReferenceWithIntersectionTypes.sig.kt.txt | 67 + .../jvmInstanceFieldReference.sig.kt.txt | 21 + .../jvmStaticFieldReference.sig.kt.txt | 38 + .../ir/irText/expressions/kt16904.sig.kt.txt | 93 ++ .../ir/irText/expressions/kt16905.sig.kt.txt | 56 + .../ir/irText/expressions/kt23030.sig.kt.txt | 67 + .../ir/irText/expressions/kt24804.sig.kt.txt | 24 + .../ir/irText/expressions/kt27933.sig.kt.txt | 8 + .../testData/ir/irText/expressions/kt28006.kt | 6 +- .../ir/irText/expressions/kt28006.sig.kt.txt | 96 ++ .../ir/irText/expressions/kt28456.sig.kt.txt | 42 + .../ir/irText/expressions/kt28456a.sig.kt.txt | 21 + .../ir/irText/expressions/kt28456b.sig.kt.txt | 42 + .../ir/irText/expressions/kt30020.sig.kt.txt | 234 ++++ .../ir/irText/expressions/kt30796.sig.kt.txt | 13 + .../ir/irText/expressions/kt35730.sig.kt.txt | 33 + .../testData/ir/irText/expressions/kt36956.kt | 5 +- .../ir/irText/expressions/kt36956.sig.kt.txt | 60 + .../ir/irText/expressions/kt36963.sig.kt.txt | 13 + .../ir/irText/expressions/kt37570.sig.kt.txt | 31 + .../ir/irText/expressions/kt37779.sig.kt.txt | 15 + .../ir/irText/expressions/kt42321.sig.kt.txt | 46 + .../testData/ir/irText/expressions/kt44993.kt | 4 + .../ir/irText/expressions/kt44993.sig.kt.txt | 25 + .../ir/irText/expressions/kt45022.sig.kt.txt | 25 + .../ir/irText/expressions/kt47082.sig.kt.txt | 41 + .../ir/irText/expressions/kt47245.sig.kt.txt | 5 + .../testData/ir/irText/expressions/kt47328.kt | 3 + .../ir/irText/expressions/kt47328.sig.kt.txt | 76 ++ .../ir/irText/expressions/kt47450.sig.kt.txt | 8 + .../ir/irText/expressions/kt48708.sig.kt.txt | 10 + .../ir/irText/expressions/kt48806.sig.kt.txt | 35 + .../ir/irText/expressions/kt49203.sig.kt.txt | 115 ++ .../ir/irText/expressions/kt50028.sig.kt.txt | 16 + .../ir/irText/expressions/kt51036.sig.kt.txt | 32 + .../irText/expressions/lambdaInCAO.sig.kt.txt | 33 + .../ir/irText/expressions/literals.sig.kt.txt | 204 +++ .../irText/expressions/memberTypeArguments.kt | 6 +- .../memberTypeArguments.sig.kt.txt | 31 + .../expressions/membersImportedFromObject.kt | 7 +- .../membersImportedFromObject.sig.kt.txt | 99 ++ .../expressions/multipleSmartCasts.sig.kt.txt | 35 + .../expressions/multipleThisReferences.kt | 7 +- .../multipleThisReferences.sig.kt.txt | 102 ++ .../nullCheckOnGenericLambdaReturn.kt | 3 +- .../nullCheckOnGenericLambdaReturn.sig.kt.txt | 45 + .../nullCheckOnLambdaReturn.sig.kt.txt | 57 + .../ir/irText/expressions/objectAsCallable.kt | 3 + .../expressions/objectAsCallable.sig.kt.txt | 155 +++ .../expressions/objectByNameInsideObject.kt | 7 +- .../objectByNameInsideObject.sig.kt.txt | 68 + .../objectClassReference.sig.kt.txt | 16 + .../expressions/objectReference.sig.kt.txt | 82 ++ ...eferenceInClosureInSuperConstructorCall.kt | 3 +- ...InClosureInSuperConstructorCall.sig.kt.txt | 46 + ...jectReferenceInFieldInitializer.sig.kt.txt | 47 + .../outerClassInstanceReference.sig.kt.txt | 32 + .../primitiveComparisons.sig.kt.txt | 192 +++ .../primitivesImplicitConversions.sig.kt.txt | 105 ++ .../expressions/propertyReferences.sig.kt.txt | 254 ++++ .../protectedJavaFieldRef.sig.kt.txt | 25 + .../ir/irText/expressions/references.kt | 5 + .../irText/expressions/references.sig.kt.txt | 88 ++ .../irText/expressions/reflectionLiterals.kt | 7 +- .../expressions/reflectionLiterals.sig.kt.txt | 105 ++ .../expressions/safeAssignment.sig.kt.txt | 32 + .../safeCallWithIncrementDecrement.kt | 3 + .../safeCallWithIncrementDecrement.sig.kt.txt | 60 + .../irText/expressions/safeCalls.sig.kt.txt | 92 ++ .../arrayAsVarargAfterSamArgument.sig.kt.txt | 5 + .../sam/genericSamProjectedOut.sig.kt.txt | 5 + .../sam/genericSamSmartcast.sig.kt.txt | 5 + .../expressions/sam/samByProjectedType.kt | 3 +- .../sam/samByProjectedType.sig.kt.txt | 5 + .../sam/samConstructors.sig.kt.txt | 25 + .../samConversionInGenericConstructorCall.kt | 4 + ...versionInGenericConstructorCall.sig.kt.txt | 60 + .../sam/samConversionToGeneric.sig.kt.txt | 50 + .../irText/expressions/sam/samConversions.kt | 3 +- .../expressions/sam/samConversions.sig.kt.txt | 25 + .../samConversionsWithSmartCasts.sig.kt.txt | 50 + .../expressions/sam/samOperators.sig.kt.txt | 20 + .../setFieldWithImplicitCast.sig.kt.txt | 16 + .../signedToUnsignedConversions.sig.kt.txt | 129 ++ .../expressions/simpleOperators.sig.kt.txt | 88 ++ .../simpleUnaryOperators.sig.kt.txt | 48 + .../irText/expressions/smartCasts.sig.kt.txt | 47 + .../smartCastsWithDestructuring.sig.kt.txt | 35 + .../specializedTypeAliasConstructorCall.kt | 3 + ...ializedTypeAliasConstructorCall.sig.kt.txt | 35 + .../expressions/stringComparisons.sig.kt.txt | 32 + .../irText/expressions/stringPlus.sig.kt.txt | 24 + .../ir/irText/expressions/stringTemplates.kt | 6 +- .../expressions/stringTemplates.sig.kt.txt | 128 ++ .../suspendConversionForExtensionFunction.kt | 3 + ...dConversionForExtensionFunction.sig.kt.txt | 9 + .../suspendConversionInVararg.sig.kt.txt | 15 + ...ConversionOnArbitraryExpression.sig.kt.txt | 123 ++ ...pendConversionWithFunInterfaces.sig.kt.txt | 48 + .../temporaryInEnumEntryInitializer.kt | 3 + ...temporaryInEnumEntryInitializer.sig.kt.txt | 128 ++ .../temporaryInInitBlock.sig.kt.txt | 23 + .../expressions/thisOfGenericOuterClass.kt | 5 +- .../thisOfGenericOuterClass.sig.kt.txt | 54 + ...ectInNestedClassConstructorCall.sig.kt.txt | 80 ++ .../thisReferenceBeforeClassDeclared.kt | 7 +- ...hisReferenceBeforeClassDeclared.sig.kt.txt | 52 + .../ir/irText/expressions/throw.sig.kt.txt | 10 + .../ir/irText/expressions/tryCatch.sig.kt.txt | 13 + .../tryCatchWithImplicitCast.sig.kt.txt | 5 + .../typeAliasConstructorReference.kt | 6 +- .../typeAliasConstructorReference.sig.kt.txt | 65 + .../expressions/typeArguments.sig.kt.txt | 5 + .../expressions/typeOperators.sig.kt.txt | 39 + .../expressions/typeParameterClassLiteral.kt | 4 + .../typeParameterClassLiteral.sig.kt.txt | 67 + .../unsignedIntegerLiterals.sig.kt.txt | 120 ++ .../irText/expressions/useImportedMember.kt | 5 +- .../expressions/useImportedMember.sig.kt.txt | 165 +++ .../testData/ir/irText/expressions/values.kt | 3 + .../ir/irText/expressions/values.sig.kt.txt | 181 +++ .../testData/ir/irText/expressions/vararg.kt | 7 +- .../ir/irText/expressions/vararg.sig.kt.txt | 36 + .../varargWithImplicitCast.sig.kt.txt | 16 + .../variableAsFunctionCall.sig.kt.txt | 34 + .../variableAsFunctionCallWithGenerics.kt | 3 + ...iableAsFunctionCallWithGenerics.sig.kt.txt | 40 + .../ir/irText/expressions/when.sig.kt.txt | 35 + .../expressions/whenCoercedToUnit.sig.kt.txt | 5 + .../ir/irText/expressions/whenElse.sig.kt.txt | 8 + .../irText/expressions/whenReturn.sig.kt.txt | 8 + .../expressions/whenReturnUnit.sig.kt.txt | 10 + .../irText/expressions/whenSmartCastToEnum.kt | 3 + .../whenSmartCastToEnum.sig.kt.txt | 122 ++ .../whenUnusedExpression.sig.kt.txt | 5 + .../whenWithSubjectVariable.sig.kt.txt | 16 + .../expressions/whileDoWhile.sig.kt.txt | 10 + .../irText/firProblems/AbstractMutableMap.kt | 3 + .../ir/irText/firProblems/AllCandidates.kt | 4 + .../firProblems/AllCandidates.sig.kt.txt | 36 + .../AnnotationInAnnotation.sig.kt.txt | 61 + .../firProblems/AnnotationLoader.sig.kt.txt | 47 + .../AnonymousAsReturnOfGenericFunction.kt | 5 + ...nymousAsReturnOfGenericFunction.sig.kt.txt | 33 + .../irText/firProblems/ArrayListOverrides.kt | 3 + .../ir/irText/firProblems/ArrayMap.kt | 3 + .../ir/irText/firProblems/ArrayMap.sig.kt.txt | 407 ++++++ .../firProblems/ClashResolutionDescriptor.kt | 3 + .../ClashResolutionDescriptor.sig.kt.txt | 84 ++ .../firProblems/DeepCopyIrTree.sig.kt.txt | 132 ++ .../DelegationAndInheritanceFromJava.kt | 4 + ...elegationAndInheritanceFromJava.sig.kt.txt | 78 ++ .../ErrorInDefaultValue.sig.kt.txt | 64 + .../FakeOverrideInAnonymousWithDelegation.kt | 5 + ...errideInAnonymousWithDelegation.sig.kt.txt | 114 ++ .../Fir2IrClassifierStorage.sig.kt.txt | 152 +++ .../irText/firProblems/FirBuilder.sig.kt.txt | 63 + .../irText/firProblems/FlushFromAnonymous.kt | 4 + .../firProblems/FlushFromAnonymous.sig.kt.txt | 33 + .../firProblems/ImplicitReceiverStack.kt | 3 + .../ImplicitReceiverStack.sig.kt.txt | 175 +++ .../InnerClassInAnonymous.sig.kt.txt | 8 + .../firProblems/LocalSuspendFun.sig.kt.txt | 12 + .../ir/irText/firProblems/Modality.sig.kt.txt | 90 ++ .../ir/irText/firProblems/MultiList.kt | 3 + .../testData/ir/irText/firProblems/OutBox.kt | 6 +- .../ir/irText/firProblems/OutBox.sig.kt.txt | 29 + .../firProblems/SafeLetWithReturn.sig.kt.txt | 28 + .../SameJavaFieldReferences.sig.kt.txt | 5 + .../firProblems/SignatureClash.sig.kt.txt | 128 ++ .../SignatureComputationComplexJavaGeneric.kt | 3 + ...reComputationComplexJavaGeneric.sig.kt.txt | 25 + .../firProblems/SimpleTypeMarker.sig.kt.txt | 60 + .../SyntheticSetterType.sig.kt.txt | 5 + .../TypeParameterBounds.sig.kt.txt | 151 +++ .../firProblems/TypeParameterInNestedClass.kt | 3 + .../TypeParameterInNestedClass.sig.kt.txt | 41 + .../firProblems/V8ArrayToList.sig.kt.txt | 16 + .../irText/firProblems/VarInInit.sig.kt.txt | 27 + .../VarargIntegerLiteral.sig.kt.txt | 37 + .../firProblems/candidateSymbol.sig.kt.txt | 100 ++ .../cannotCastToFunction.sig.kt.txt | 35 + .../coercionToUnitForNestedWhen.kt | 4 + .../coercionToUnitForNestedWhen.sig.kt.txt | 19 + .../irText/firProblems/dataObject.sig.kt.txt | 33 + .../irText/firProblems/deprecated.sig.kt.txt | 24 + .../irText/firProblems/emptyWhen.sig.kt.txt | 5 + ...functionLiteralGenericSignature.sig.kt.txt | 72 ++ .../inapplicableCollectionSet.sig.kt.txt | 43 + ...iteralWithExpectedTypealiasType.sig.kt.txt | 20 + .../internalPotentialFakeOverride.sig.kt.txt | 42 + .../internalPotentialOverride.sig.kt.txt | 56 + .../ir/irText/firProblems/kt19251.sig.kt.txt | 5 + .../testData/ir/irText/firProblems/kt43342.kt | 3 + .../ir/irText/firProblems/kt43342.sig.kt.txt | 209 ++++ .../testData/ir/irText/firProblems/kt55458.kt | 3 + .../ir/irText/firProblems/kt55458.sig.kt.txt | 9 + .../lambdaInEnumEntryConstructorCall.kt | 5 + ...ambdaInEnumEntryConstructorCall.sig.kt.txt | 136 ++ .../localClassUsedBeforeDeclaration.kt | 5 + ...localClassUsedBeforeDeclaration.sig.kt.txt | 57 + .../ir/irText/firProblems/localCompanion.kt | 5 + .../firProblems/localCompanion.sig.kt.txt | 45 + .../irText/firProblems/putIfAbsent.sig.kt.txt | 16 + .../irText/firProblems/readWriteProperty.kt | 4 + .../firProblems/readWriteProperty.sig.kt.txt | 129 ++ ...CapturedTypeInPropertyReference.sig.kt.txt | 42 + ...otationOnDefaultMethodParameter.sig.kt.txt | 28 + .../reflectGetOnNullableTypeAlias.kt | 3 + .../reflectGetOnNullableTypeAlias.sig.kt.txt | 37 + .../firProblems/thisInEnumConstructor.kt | 3 + .../thisInEnumConstructor.sig.kt.txt | 116 ++ .../throwableStackTrace.sig.kt.txt | 5 + .../ir/irText/firProblems/timesInBuilder.kt | 3 + .../firProblems/timesInBuilder.sig.kt.txt | 85 ++ .../typeParameterFromJavaClass.sig.kt.txt | 5 + .../typeVariableAfterBuildMap.sig.kt.txt | 693 +++++++++++ .../firProblems/valueClassEquals.sig.kt.txt | 43 + .../js/dynamic/dynamicAndMembersOfAny.kt | 4 +- .../dynamic/dynamicAndMembersOfAny.sig.kt.txt | 15 + .../irText/js/dynamic/dynamicArrayAccess.kt | 4 + .../js/dynamic/dynamicArrayAccess.sig.kt.txt | 15 + .../js/dynamic/dynamicArrayAssignment.kt | 4 + .../dynamic/dynamicArrayAssignment.sig.kt.txt | 10 + .../dynamicArrayAugmentedAssignment.kt | 5 +- ...dynamicArrayAugmentedAssignment.sig.kt.txt | 5 + .../dynamicArrayIncrementDecrement.sig.kt.txt | 5 + .../dynamic/dynamicBinaryEqualityOperator.kt | 5 +- .../dynamicBinaryEqualityOperator.sig.kt.txt | 20 + .../dynamic/dynamicBinaryLogicalOperator.kt | 4 + .../dynamicBinaryLogicalOperator.sig.kt.txt | 10 + .../js/dynamic/dynamicBinaryOperator.kt | 5 +- .../dynamic/dynamicBinaryOperator.sig.kt.txt | 25 + .../dynamicBinaryRelationalOperator.kt | 5 +- ...dynamicBinaryRelationalOperator.sig.kt.txt | 20 + .../ir/irText/js/dynamic/dynamicCall.kt | 4 + .../irText/js/dynamic/dynamicCall.sig.kt.txt | 15 + .../irText/js/dynamic/dynamicElvisOperator.kt | 3 + .../dynamic/dynamicElvisOperator.sig.kt.txt | 5 + .../js/dynamic/dynamicExclExclOperator.kt | 4 + .../dynamicExclExclOperator.sig.kt.txt | 5 + .../ir/irText/js/dynamic/dynamicInfixCall.kt | 5 +- .../js/dynamic/dynamicInfixCall.sig.kt.txt | 10 + .../irText/js/dynamic/dynamicMemberAccess.kt | 5 +- .../js/dynamic/dynamicMemberAccess.sig.kt.txt | 10 + .../js/dynamic/dynamicMemberAssignment.kt | 3 + .../dynamicMemberAssignment.sig.kt.txt | 10 + .../dynamicMemberAugmentedAssignment.kt | 3 + ...ynamicMemberAugmentedAssignment.sig.kt.txt | 10 + ...dynamicMemberIncrementDecrement.sig.kt.txt | 10 + .../irText/js/dynamic/dynamicUnaryOperator.kt | 5 +- .../dynamic/dynamicUnaryOperator.sig.kt.txt | 15 + .../irText/js/dynamic/dynamicWithSmartCast.kt | 3 + .../dynamic/dynamicWithSmartCast.sig.kt.txt | 10 + .../js/dynamic/implicitCastFromDynamic.kt | 5 +- .../implicitCastFromDynamic.sig.kt.txt | 38 + .../js/dynamic/implicitCastToDynamic.kt | 4 + .../dynamic/implicitCastToDynamic.sig.kt.txt | 61 + .../ir/irText/js/dynamic/invokeOperator.kt | 5 +- .../js/dynamic/invokeOperator.sig.kt.txt | 40 + .../ir/irText/js/external/kt38765.ir.txt | 2 + .../testData/ir/irText/js/external/kt38765.kt | 6 +- .../ir/irText/js/external/kt38765.kt.txt | 13 +- .../ir/irText/js/external/kt38765.sig.kt.txt | 130 ++ .../js/native/nativeNativeKotlin.kt.txt | 4 +- .../js/native/nativeNativeKotlin.sig.kt.txt | 64 + .../ir/irText/lambdas/anonymousFunction.kt | 4 + .../lambdas/anonymousFunction.sig.kt.txt | 18 + .../lambdas/destructuringInLambda.sig.kt.txt | 98 ++ .../irText/lambdas/extensionLambda.sig.kt.txt | 8 + .../testData/ir/irText/lambdas/justLambda.kt | 7 +- .../ir/irText/lambdas/justLambda.sig.kt.txt | 24 + .../lambdas/lambdaReturningUnit.sig.kt.txt | 10 + .../irText/lambdas/localFunction.sig.kt.txt | 5 + .../multipleImplicitReceivers.sig.kt.txt | 61 + .../irText/lambdas/nonLocalReturn.sig.kt.txt | 30 + .../testData/ir/irText/lambdas/samAdapter.kt | 2 +- .../ir/irText/lambdas/samAdapter.sig.kt.txt | 5 + .../backingFieldVisibility.sig.kt.txt | 68 + .../explicitBackingFieldType.sig.kt.txt | 62 + .../independentBackingFieldType.sig.kt.txt | 31 + .../propertyTypeNarrowing.sig.kt.txt | 47 + .../regressions/coercionInLoop.sig.kt.txt | 8 + .../irText/regressions/integerCoercionToT.kt | 3 + .../regressions/integerCoercionToT.sig.kt.txt | 74 ++ .../ir/irText/regressions/kt24114.sig.kt.txt | 32 + .../ir/irText/regressions/kt44855.sig.kt.txt | 41 + .../testData/ir/irText/regressions/kt45236.kt | 3 + .../ir/irText/regressions/kt45236.sig.kt.txt | 89 ++ .../newInferenceFixationOrder1.sig.kt.txt | 39 + .../typeAliasCtorForGenericClass.kt | 5 +- .../typeAliasCtorForGenericClass.sig.kt.txt | 36 + .../typeParametersInImplicitCast.sig.kt.txt | 5 + .../ir/irText/singletons/companion.sig.kt.txt | 32 + .../ir/irText/singletons/enumEntry.kt | 3 + .../ir/irText/singletons/enumEntry.sig.kt.txt | 199 +++ .../ir/irText/singletons/object.sig.kt.txt | 32 + .../stubs/arraysFromBuiltins.sig.kt.txt | 8 + .../ir/irText/stubs/builtinMap.sig.kt.txt | 5 + .../irText/stubs/constFromBuiltins.sig.kt.txt | 9 + .../stubs/genericClassInDifferentModule.kt | 3 + .../genericClassInDifferentModule.sig.kt.txt | 120 ++ ...vaConstructorWithTypeParameters.sig.kt.txt | 20 + .../ir/irText/stubs/javaEnum.sig.kt.txt | 9 + .../ir/irText/stubs/javaInnerClass.sig.kt.txt | 24 + .../ir/irText/stubs/javaMethod.sig.kt.txt | 5 + .../irText/stubs/javaNestedClass.sig.kt.txt | 5 + .../javaNestedClassesInHierarchy.sig.kt.txt | 5 + .../irText/stubs/javaStaticMethod.sig.kt.txt | 5 + .../stubs/javaSyntheticProperty.sig.kt.txt | 9 + .../jdkClassSyntheticProperty.sig.kt.txt | 9 + .../irText/stubs/kotlinInnerClass.sig.kt.txt | 5 + compiler/testData/ir/irText/stubs/simple.kt | 4 + .../ir/irText/stubs/simple.sig.kt.txt | 12 + .../irText/types/abbreviatedTypes.sig.kt.txt | 40 + .../irText/types/asOnPlatformType.sig.kt.txt | 15 + .../types/castsInsideCoroutineInference.kt | 3 + .../castsInsideCoroutineInference.sig.kt.txt | 203 +++ ...ercionToUnitInLambdaReturnValue.sig.kt.txt | 10 + .../ir/irText/types/definitelyNonNull.kt | 5 +- .../irText/types/definitelyNonNull.sig.kt.txt | 17 + .../definitelyNonNullOverride.sig.kt.txt | 61 + .../types/definitelyNonNullSAM.sig.kt.txt | 144 +++ .../definitelyNonNullWithJava.sig.kt.txt | 17 + .../types/definitelyNotNullAsArgument.kt | 3 + .../definitelyNotNullAsArgument.sig.kt.txt | 79 ++ .../types/definitelyNotNullAsReceiver.kt | 6 +- .../definitelyNotNullAsReceiver.sig.kt.txt | 18 + ...initelyNotNullWithIntersection1.sig.kt.txt | 40 + .../types/dontLeaveStubTypesInSetter.kt | 3 + .../dontLeaveStubTypesInSetter.sig.kt.txt | 44 + .../types/genericDelegatedDeepProperty.kt | 4 + .../genericDelegatedDeepProperty.sig.kt.txt | 162 +++ .../types/genericFunWithStar.sig.kt.txt | 55 + .../types/genericPropertyReferenceType.kt | 6 +- .../genericPropertyReferenceType.sig.kt.txt | 58 + .../inStarProjectionInReceiverType.sig.kt.txt | 45 + .../irText/types/intersectionType1.sig.kt.txt | 40 + .../irText/types/intersectionType2.sig.kt.txt | 52 + .../irText/types/intersectionType3.sig.kt.txt | 109 ++ .../intersectionTypeInSamType.sig.kt.txt | 124 ++ .../ir/irText/types/javaWildcardType.kt | 6 +- .../irText/types/javaWildcardType.sig.kt.txt | 85 ++ .../ir/irText/types/kt36143.sig.kt.txt | 8 + .../ir/irText/types/kt49526.sig.kt.txt | 8 + ...localVariableOfIntersectionType.sig.kt.txt | 70 ++ .../nullChecks/enhancedNullability.sig.kt.txt | 48 + ...cedNullabilityInDestructuringAssignment.kt | 4 + ...bilityInDestructuringAssignment.sig.kt.txt | 108 ++ .../enhancedNullabilityInForLoop.sig.kt.txt | 105 ++ ...reToCallsOnPlatformTypeReceiver.sig.kt.txt | 30 + .../implicitNotNullOnPlatformType.sig.kt.txt | 55 + .../nullChecks/nullCheckInElvisRhs.sig.kt.txt | 14 + .../nullCheckOnInterfaceDelegation.kt | 3 + .../nullCheckOnInterfaceDelegation.sig.kt.txt | 56 + .../nullCheckOnLambdaResult/nnStringVsT.kt | 1 + .../nnStringVsT.sig.kt.txt | 10 + .../nullCheckOnLambdaResult/nnStringVsTAny.kt | 1 + .../nnStringVsTAny.sig.kt.txt | 10 + .../nnStringVsTConstrained.kt | 5 + .../nnStringVsTConstrained.sig.kt.txt | 13 + .../nnStringVsTXArray.kt | 1 + .../nnStringVsTXArray.sig.kt.txt | 10 + .../nnStringVsTXString.kt | 1 + .../nnStringVsTXString.sig.kt.txt | 10 + .../nullCheckOnLambdaResult/stringVsAny.kt | 1 + .../stringVsAny.sig.kt.txt | 10 + .../nullCheckOnLambdaResult/stringVsT.kt | 1 + .../stringVsT.sig.kt.txt | 10 + .../nullCheckOnLambdaResult/stringVsTAny.kt | 1 + .../stringVsTAny.sig.kt.txt | 10 + .../stringVsTConstrained.kt | 1 + .../stringVsTConstrained.sig.kt.txt | 10 + .../stringVsTXArray.kt | 1 + .../stringVsTXArray.sig.kt.txt | 10 + .../stringVsTXString.kt | 1 + .../stringVsTXString.sig.kt.txt | 10 + ...ityAssertionOnExtensionReceiver.sig.kt.txt | 31 + .../platformTypeReceiver.sig.kt.txt | 10 + ...xedNullableAndNotNullableBounds.sig.kt.txt | 10 + ...erWithMultipleNotNullableBounds.sig.kt.txt | 10 + ...meterWithMultipleNullableBounds.sig.kt.txt | 10 + .../ir/irText/types/rawTypeInSignature.kt | 6 +- .../receiverOfIntersectionType.sig.kt.txt | 73 ++ ...smartCastOnFakeOverrideReceiver.sig.kt.txt | 177 +++ ...astOnFieldReceiverOfGenericType.sig.kt.txt | 10 + .../types/smartCastOnReceiverOfGenericType.kt | 4 + ...martCastOnReceiverOfGenericType.sig.kt.txt | 74 ++ .../ir/irText/types/starProjection.sig.kt.txt | 26 + .../types/typeAliasWithUnsafeVariance.kt | 3 + .../typeAliasWithUnsafeVariance.sig.kt.txt | 79 ++ .../typeCheckOnDefinitelyNotNull.sig.kt.txt | 24 + .../IrMangledNameAndSignatureDumpHandler.kt | 516 ++++++++ .../handlers/IrPrettyKotlinDumpHandler.kt | 54 +- .../test/directives/CodegenTestDirectives.kt | 19 + .../test/runners/ir/AbstractIrTextTest.kt | 7 +- 791 files changed, 36162 insertions(+), 357 deletions(-) create mode 100644 .idea/dictionaries/sergej_jaskiewicz.xml create mode 100644 compiler/testData/ir/irText/classes/47424.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/abstractMembers.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/annotationClasses.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/classMembers.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/classes.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/cloneable.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/companionObject.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/dataClasses/dataClasses.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/dataClasses/kt31649.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/dataClasses/kt49936.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/dataClasses/openDataClass.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/declarationOrder.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/delegatedImplementation.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/delegatingConstructorCallsInSecondaryConstructors.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/enum.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/enumClassModality.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/enumEntries.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/enumWithMultipleCtors.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/enumWithSecondaryCtor.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/fakeOverridesForJavaNonStaticMembers.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/fakeOverridesForJavaStaticMembers.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/initBlock.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/initVal.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/initValInLambda.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/initVar.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/inlineClass.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/innerClass.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/kt19306.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/kt43217.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/localClasses.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/objectLiteralExpressions.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/objectWithInitializers.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/outerClassAccess.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/primaryConstructor.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/qualifiedSuperCalls.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/sealedClasses.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/secondaryConstructors.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/smartCastInValInitialization.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/superCalls.sig.kt.txt create mode 100644 compiler/testData/ir/irText/classes/superCallsComposed.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/annotationOnClassWithInitializer.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/annotationsInAnnotationArguments.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/annotationsWithDefaultParameterValues.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/annotationsWithVarargParameters.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/argWithDefaultValueInAnnotationClass.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/arrayInAnnotationArguments.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/classLiteralInAnnotation.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/constructorsWithAnnotations.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/fileAnnotations.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/functionsWithAnnotations.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/javaAnnotation.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/localDelegatedPropertiesWithAnnotations.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/multipleAnnotationsInSquareBrackets.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/propertyAccessorsFromClassHeaderWithAnnotations.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/typeParametersWithAnnotations.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/varargsInAnnotationArguments.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/variablesWithAnnotations.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/classLevelProperties.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/constValInitializers.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/class.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/contextualFunctionConversion.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/function.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/functionalType.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/kt52791.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/lazy.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/overloadPriority.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/overloading.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/property.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/defaultArguments.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/delegatedProperties.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/deprecatedProperty.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/extensionProperties.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/fakeOverrides.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/fileWithAnnotations.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/fileWithTypeAliasesOnly.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/genericDelegatedProperty.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/interfaceProperties.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/jvmRecord/javaRecordComponentAccess.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/kt27005.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/kt29833.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/kt35550.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/kt45308.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/kt47527.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/kt52677.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/localClassWithOverrides.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/localDelegatedProperties.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/localVarInDoWhile.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/multiplatform/expectClassInherited.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/multiplatform/expectIntersectionOverride.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/multiplatform/expectMemberInNotExpectClass.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/multiplatform/expectMemberInNotExpectClassFir.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass2.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/multiplatform/expectedSealedClass.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/packageLevelProperties.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/class.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/constructor.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/dataClassMembers.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/delegatedMembers.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/fun.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/genericInnerClass.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/lambdas.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/localFun.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/propertyAccessors.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/useNextParamInLambda.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/primaryCtorDefaultArguments.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/primaryCtorProperties.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/provideDelegate/javaDelegate.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/provideDelegate/local.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/provideDelegate/member.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.sig.kt.txt create mode 100644 compiler/testData/ir/irText/declarations/provideDelegate/topLevel.sig.kt.txt create mode 100644 compiler/testData/ir/irText/errors/suppressedNonPublicCall.sig.kt.txt create mode 100644 compiler/testData/ir/irText/errors/unresolvedReference.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/ambiguousFieldAccess.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/argumentMappedWithError.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/arrayAccess.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/arrayAssignment.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/assignments.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/augmentedAssignment1.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/augmentedAssignment2.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/badBreakContinue.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/badInlinedBreakContinue.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/bangbang.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/booleanConstsInAndAndOrOr.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/booleanOperators.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/boundCallableReferences.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/boxOk.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/breakContinue.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/breakContinueInWhen.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/builtinOperators.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/callWithReorderedArguments.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/callableReferences/adaptedWithCoercionToUnit.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/callableReferences/boundInlineAdaptedReference.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/callableReferences/funWithDefaultParametersAsKCallableStar.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/callableReferences/genericMember.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/callableReferences/kt37131.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/callableReferences/kt46069.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/callableReferences/typeArguments.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/callableReferences/varargFunImportedFromObject.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/calls.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/castToTypeParameter.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/catchParameterAccess.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/chainOfSafeCalls.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/classReference.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/coercionToUnit.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/complexAugmentedAssignment.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/contructorCall.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/conventionComparisons.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/destructuring1.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/destructuringWithUnderscore.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/dotQualified.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/elvis.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/enumEntryAsReceiver.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/equality.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/equals.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/exclExclOnPlatformType.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/extFunInvokeAsFun.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/extFunSafeInvoke.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/field.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/comparableWithDoubleOrFloat.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/eqeqRhsConditionPossiblyAffectingLhs.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointLess.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableAnyAsIntToDouble.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableFloatingPointEqeq.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/for.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/forWithBreakContinue.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/forWithImplicitReceivers.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/funImportedFromObject.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/funInterface/basicFunInterfaceConversion.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/funInterface/castFromAny.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/funInterface/functionSupertype.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/funInterface/partialSam.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargsMixed.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/genericPropertyCall.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/genericPropertyRef.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/identity.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/ifElseIf.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/implicitCastInReturnFromConstructor.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/implicitCastOnPlatformType.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/implicitCastToNonNull.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/implicitNotNullInDestructuringAssignment.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/in.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/incrementDecrement.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/inlinedBreakContinue.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/interfaceThisRef.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/javaSyntheticGenericPropretyAccess.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/javaSyntheticPropertyAccess.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/jvmStaticFieldReference.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt16904.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt16905.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt23030.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt24804.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt27933.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt28006.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt28456.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt28456a.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt28456b.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt30020.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt30796.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt35730.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt36956.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt36963.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt37570.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt37779.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt42321.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt44993.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt45022.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt47082.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt47245.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt47328.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt47450.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt48708.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt48806.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt49203.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt50028.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/kt51036.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/lambdaInCAO.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/literals.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/memberTypeArguments.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/membersImportedFromObject.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/multipleSmartCasts.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/multipleThisReferences.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/nullCheckOnGenericLambdaReturn.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/objectAsCallable.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/objectByNameInsideObject.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/objectClassReference.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/objectReference.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/objectReferenceInFieldInitializer.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/outerClassInstanceReference.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/primitiveComparisons.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/primitivesImplicitConversions.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/propertyReferences.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/protectedJavaFieldRef.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/references.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/reflectionLiterals.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/safeAssignment.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/safeCalls.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/sam/genericSamSmartcast.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/sam/samByProjectedType.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/sam/samConstructors.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/sam/samConversions.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/sam/samOperators.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/signedToUnsignedConversions.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/simpleOperators.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/simpleUnaryOperators.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/smartCasts.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/smartCastsWithDestructuring.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/stringComparisons.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/stringPlus.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/stringTemplates.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/suspendConversionForExtensionFunction.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/suspendConversionInVararg.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/temporaryInInitBlock.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/thisRefToObjectInNestedClassConstructorCall.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/throw.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/tryCatch.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/typeAliasConstructorReference.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/typeArguments.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/typeOperators.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/typeParameterClassLiteral.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/unsignedIntegerLiterals.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/useImportedMember.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/values.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/vararg.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/varargWithImplicitCast.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/variableAsFunctionCall.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/when.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/whenCoercedToUnit.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/whenElse.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/whenReturn.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/whenReturnUnit.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/whenSmartCastToEnum.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/whenUnusedExpression.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/whenWithSubjectVariable.sig.kt.txt create mode 100644 compiler/testData/ir/irText/expressions/whileDoWhile.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/AllCandidates.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/AnnotationInAnnotation.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/AnnotationLoader.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/AnonymousAsReturnOfGenericFunction.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/ArrayMap.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/DeepCopyIrTree.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/FirBuilder.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/FlushFromAnonymous.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/LocalSuspendFun.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/Modality.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/OutBox.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/SafeLetWithReturn.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/SameJavaFieldReferences.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/SignatureClash.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/SignatureComputationComplexJavaGeneric.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/SimpleTypeMarker.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/SyntheticSetterType.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/TypeParameterBounds.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/TypeParameterInNestedClass.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/V8ArrayToList.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/VarInInit.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/VarargIntegerLiteral.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/candidateSymbol.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/cannotCastToFunction.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/dataObject.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/deprecated.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/emptyWhen.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/functionLiteralGenericSignature.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/integerLiteralWithExpectedTypealiasType.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/internalPotentialFakeOverride.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/internalPotentialOverride.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/kt19251.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/kt43342.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/kt55458.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/localCompanion.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/putIfAbsent.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/readWriteProperty.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/reflectGetOnNullableTypeAlias.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/thisInEnumConstructor.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/throwableStackTrace.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/timesInBuilder.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/typeParameterFromJavaClass.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.sig.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/valueClassEquals.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/dynamic/dynamicAndMembersOfAny.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/dynamic/dynamicArrayAccess.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/dynamic/dynamicArrayAssignment.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/dynamic/dynamicArrayAugmentedAssignment.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/dynamic/dynamicArrayIncrementDecrement.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/dynamic/dynamicBinaryEqualityOperator.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/dynamic/dynamicBinaryLogicalOperator.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/dynamic/dynamicBinaryOperator.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/dynamic/dynamicBinaryRelationalOperator.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/dynamic/dynamicCall.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/dynamic/dynamicElvisOperator.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/dynamic/dynamicExclExclOperator.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/dynamic/dynamicInfixCall.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/dynamic/dynamicMemberAccess.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/dynamic/dynamicMemberAssignment.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/dynamic/dynamicMemberAugmentedAssignment.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/dynamic/dynamicMemberIncrementDecrement.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/dynamic/dynamicUnaryOperator.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/dynamic/dynamicWithSmartCast.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/dynamic/implicitCastFromDynamic.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/dynamic/invokeOperator.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/external/kt38765.sig.kt.txt create mode 100644 compiler/testData/ir/irText/js/native/nativeNativeKotlin.sig.kt.txt create mode 100644 compiler/testData/ir/irText/lambdas/anonymousFunction.sig.kt.txt create mode 100644 compiler/testData/ir/irText/lambdas/destructuringInLambda.sig.kt.txt create mode 100644 compiler/testData/ir/irText/lambdas/extensionLambda.sig.kt.txt create mode 100644 compiler/testData/ir/irText/lambdas/justLambda.sig.kt.txt create mode 100644 compiler/testData/ir/irText/lambdas/lambdaReturningUnit.sig.kt.txt create mode 100644 compiler/testData/ir/irText/lambdas/localFunction.sig.kt.txt create mode 100644 compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.sig.kt.txt create mode 100644 compiler/testData/ir/irText/lambdas/nonLocalReturn.sig.kt.txt create mode 100644 compiler/testData/ir/irText/lambdas/samAdapter.sig.kt.txt create mode 100644 compiler/testData/ir/irText/properties/backingField/backingFieldVisibility.sig.kt.txt create mode 100644 compiler/testData/ir/irText/properties/backingField/explicitBackingFieldType.sig.kt.txt create mode 100644 compiler/testData/ir/irText/properties/backingField/independentBackingFieldType.sig.kt.txt create mode 100644 compiler/testData/ir/irText/properties/backingField/propertyTypeNarrowing.sig.kt.txt create mode 100644 compiler/testData/ir/irText/regressions/coercionInLoop.sig.kt.txt create mode 100644 compiler/testData/ir/irText/regressions/integerCoercionToT.sig.kt.txt create mode 100644 compiler/testData/ir/irText/regressions/kt24114.sig.kt.txt create mode 100644 compiler/testData/ir/irText/regressions/kt44855.sig.kt.txt create mode 100644 compiler/testData/ir/irText/regressions/kt45236.sig.kt.txt create mode 100644 compiler/testData/ir/irText/regressions/newInferenceFixationOrder1.sig.kt.txt create mode 100644 compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.sig.kt.txt create mode 100644 compiler/testData/ir/irText/regressions/typeParametersInImplicitCast.sig.kt.txt create mode 100644 compiler/testData/ir/irText/singletons/companion.sig.kt.txt create mode 100644 compiler/testData/ir/irText/singletons/enumEntry.sig.kt.txt create mode 100644 compiler/testData/ir/irText/singletons/object.sig.kt.txt create mode 100644 compiler/testData/ir/irText/stubs/arraysFromBuiltins.sig.kt.txt create mode 100644 compiler/testData/ir/irText/stubs/builtinMap.sig.kt.txt create mode 100644 compiler/testData/ir/irText/stubs/constFromBuiltins.sig.kt.txt create mode 100644 compiler/testData/ir/irText/stubs/genericClassInDifferentModule.sig.kt.txt create mode 100644 compiler/testData/ir/irText/stubs/javaConstructorWithTypeParameters.sig.kt.txt create mode 100644 compiler/testData/ir/irText/stubs/javaEnum.sig.kt.txt create mode 100644 compiler/testData/ir/irText/stubs/javaInnerClass.sig.kt.txt create mode 100644 compiler/testData/ir/irText/stubs/javaMethod.sig.kt.txt create mode 100644 compiler/testData/ir/irText/stubs/javaNestedClass.sig.kt.txt create mode 100644 compiler/testData/ir/irText/stubs/javaNestedClassesInHierarchy.sig.kt.txt create mode 100644 compiler/testData/ir/irText/stubs/javaStaticMethod.sig.kt.txt create mode 100644 compiler/testData/ir/irText/stubs/javaSyntheticProperty.sig.kt.txt create mode 100644 compiler/testData/ir/irText/stubs/jdkClassSyntheticProperty.sig.kt.txt create mode 100644 compiler/testData/ir/irText/stubs/kotlinInnerClass.sig.kt.txt create mode 100644 compiler/testData/ir/irText/stubs/simple.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/abbreviatedTypes.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/asOnPlatformType.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/castsInsideCoroutineInference.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/coercionToUnitInLambdaReturnValue.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/definitelyNonNull.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/definitelyNonNullOverride.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/definitelyNonNullSAM.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/definitelyNonNullWithJava.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/definitelyNotNullAsArgument.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/definitelyNotNullAsReceiver.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/definitelyNotNullWithIntersection1.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/dontLeaveStubTypesInSetter.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/genericDelegatedDeepProperty.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/genericFunWithStar.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/genericPropertyReferenceType.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/inStarProjectionInReceiverType.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/intersectionType1.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/intersectionType2.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/intersectionType3.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/intersectionTypeInSamType.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/javaWildcardType.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/kt36143.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/kt49526.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/localVariableOfIntersectionType.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/nullChecks/enhancedNullability.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/nullChecks/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/nullChecks/nullCheckInElvisRhs.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsT.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTAny.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTConstrained.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXArray.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXString.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsAny.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsT.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTAny.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTConstrained.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXArray.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXString.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/nullChecks/nullabilityAssertionOnExtensionReceiver.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/nullChecks/platformTypeReceiver.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/nullChecks/typeParameterWithMixedNullableAndNotNullableBounds.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/nullChecks/typeParameterWithMultipleNotNullableBounds.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/nullChecks/typeParameterWithMultipleNullableBounds.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/receiverOfIntersectionType.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/starProjection.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.sig.kt.txt create mode 100644 compiler/testData/ir/irText/types/typeCheckOnDefinitelyNotNull.sig.kt.txt create mode 100644 compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrMangledNameAndSignatureDumpHandler.kt diff --git a/.idea/dictionaries/sergej_jaskiewicz.xml b/.idea/dictionaries/sergej_jaskiewicz.xml new file mode 100644 index 00000000000..26916ae882d --- /dev/null +++ b/.idea/dictionaries/sergej_jaskiewicz.xml @@ -0,0 +1,7 @@ + + + + unmuted + + + \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/dumpKotlinLike.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/dumpKotlinLike.kt index ad0de3ebedc..606780aed09 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/dumpKotlinLike.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/dumpKotlinLike.kt @@ -19,6 +19,7 @@ import org.jetbrains.kotlin.ir.symbols.IrFunctionSymbol import org.jetbrains.kotlin.ir.symbols.IrSymbol import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol import org.jetbrains.kotlin.ir.types.* +import org.jetbrains.kotlin.ir.util.CustomKotlinLikeDumpStrategy.Modifiers import org.jetbrains.kotlin.ir.visitors.IrElementVisitor import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.types.Variance @@ -55,7 +56,8 @@ private inline fun dumpKotlinLike( return sb.toString() } -class KotlinLikeDumpOptions( +data class KotlinLikeDumpOptions( + val customDumpStrategy: CustomKotlinLikeDumpStrategy = CustomKotlinLikeDumpStrategy.Default, val printRegionsPerFile: Boolean = false, val printFileName: Boolean = true, val printFilePath: Boolean = true, @@ -66,6 +68,7 @@ class KotlinLikeDumpOptions( val printFakeOverridesStrategy: FakeOverridesStrategy = FakeOverridesStrategy.ALL, val bodyPrintingStrategy: BodyPrintingStrategy = BodyPrintingStrategy.PRINT_BODIES, val printElseAsTrue: Boolean = false, + val printUnitReturnType: Boolean = false, val stableOrder: Boolean = false, /* TODO add more options: @@ -99,6 +102,49 @@ enum class BodyPrintingStrategy { PRINT_BODIES, } +/** + * An interface for customizing the Kotlin-like dump. + * It allows to e.g. skip certain declarations or annotations from the dump, or print arbitrary text before and after each IR element. + */ +interface CustomKotlinLikeDumpStrategy { + + fun shouldPrintAnnotation(annotation: IrConstructorCall, container: IrAnnotationContainer): Boolean = true + + fun willPrintElement(element: IrElement, container: IrDeclaration?, printer: Printer): Boolean = true + + fun didPrintElement(element: IrElement, container: IrDeclaration?, printer: Printer) {} + + fun transformModifiersForDeclaration(declaration: IrDeclaration, modifiers: Modifiers): Modifiers = modifiers + + data class Modifiers( + val visibility: DescriptorVisibility = DescriptorVisibilities.DEFAULT_VISIBILITY, + val isExpect: Boolean = false, + val modality: Modality? = null, + val isExternal: Boolean = false, + val isOverride: Boolean = false, + val isFakeOverride: Boolean = false, + val isLateinit: Boolean = false, + val isTailrec: Boolean = false, + val isSuspend: Boolean = false, + val isInner: Boolean = false, + val isInline: Boolean = false, + val isValue: Boolean = false, + val isData: Boolean = false, + val isCompanion: Boolean = false, + val isFunInterface: Boolean = false, + val classKind: ClassKind? = null, + val isInfix: Boolean = false, + val isOperator: Boolean = false, + val isVararg: Boolean = false, + val isCrossinline: Boolean = false, + val isNoinline: Boolean = false, + val isHidden: Boolean = false, + val isAssignable: Boolean = false, + ) + + object Default : CustomKotlinLikeDumpStrategy +} + // TODO_ conventions: // TODO support -- for unsupported nodes // TODO no test -- for the cases with no test(s) @@ -183,6 +229,15 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption return classTypes.sortedBy(IrType::render) + interfaceTypes.sortedBy(IrType::render) } + private inline fun wrap(element: IrElement, container: IrDeclaration?, block: () -> Unit) { + if (!options.customDumpStrategy.willPrintElement(element, container, p)) return + try { + block() + } finally { + options.customDumpStrategy.didPrintElement(element, container, p) + } + } + override fun visitElement(element: IrElement, data: IrDeclaration?) { val e = "/* ERROR: unsupported element type: " + element.javaClass.simpleName + " */" if (element is IrExpression) { @@ -194,13 +249,13 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption } } - override fun visitModuleFragment(declaration: IrModuleFragment, data: IrDeclaration?) { + override fun visitModuleFragment(declaration: IrModuleFragment, data: IrDeclaration?) = wrap(declaration, data) { p.println("// MODULE: ${declaration.name.asString()}") declaration.acceptChildren(this, null) } @OptIn(ObsoleteDescriptorBasedAPI::class) - override fun visitFile(declaration: IrFile, data: IrDeclaration?) { + override fun visitFile(declaration: IrFile, data: IrDeclaration?) = wrap(declaration, data) { if (options.printRegionsPerFile) p.println("//region block: ${declaration.name}") if (options.printFileName) p.println("// FILE: ${declaration.name}") @@ -217,7 +272,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption if (options.printRegionsPerFile) p.println("//endregion") } - override fun visitClass(declaration: IrClass, data: IrDeclaration?) { + override fun visitClass(declaration: IrClass, data: IrDeclaration?) = wrap(declaration, data) { // TODO omit super class for enums, annotations? // TODO omit Companion name for companion objects? // TODO do we need to print info about `thisReceiver`? @@ -228,26 +283,19 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption declaration.run { printModifiersWithNoIndent( - visibility, - isExpect, - modality, - isExternal, - isOverride = INAPPLICABLE, - isFakeOverride = INAPPLICABLE, - isLateinit = INAPPLICABLE, - isTailrec = INAPPLICABLE, - isVararg = INAPPLICABLE, - isSuspend = INAPPLICABLE, - isInner, - isInline = false, - isValue, - isData, - isCompanion, - isFun, - kind, - isInfix = INAPPLICABLE, - isOperator = INAPPLICABLE, - isInterfaceMember = INAPPLICABLE + this, + Modifiers( + visibility = visibility, + isExpect = isExpect, + modality = modality, + isExternal = isExternal, + isInner = isInner, + isValue = isValue, + isData = isData, + isCompanion = isCompanion, + isFunInterface = isFun, + classKind = kind, + ), ) } @@ -305,62 +353,43 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption operator data */ - private fun printModifiersWithNoIndent( - visibility: DescriptorVisibility, - isExpect: Boolean, - modality: Modality?, - isExternal: Boolean, - isOverride: Boolean, - isFakeOverride: Boolean, - isLateinit: Boolean, - isTailrec: Boolean, - isVararg: Boolean, - isSuspend: Boolean, - isInner: Boolean, - isInline: Boolean, - isValue: Boolean, - isData: Boolean, - isCompanion: Boolean, - isFunInterface: Boolean, - classKind: ClassKind?, - isInfix: Boolean, - isOperator: Boolean, - isInterfaceMember: Boolean, - ) { - printVisibility(visibility) - p(isExpect, "expect") // TODO actual? - val defaultModality = when { - isInterfaceMember || (isOverride || isFakeOverride) && modality == Modality.OPEN -> - Modality.OPEN - classKind == ClassKind.INTERFACE -> - Modality.ABSTRACT - else -> - Modality.FINAL + private fun printModifiersWithNoIndent(declaration: IrDeclaration, modifiers: Modifiers) = + options.customDumpStrategy.transformModifiersForDeclaration(declaration, modifiers).run { + val isInterfaceMember = declaration is IrOverridableMember && (declaration.parent as? IrClass)?.isInterface == true + printVisibility(visibility) + p(isExpect, "expect") // TODO actual? + val defaultModality = when { + isInterfaceMember || (isOverride || isFakeOverride) && modality == Modality.OPEN -> + Modality.OPEN + classKind == ClassKind.INTERFACE -> + Modality.ABSTRACT + else -> + Modality.FINAL + } + p(modality, defaultModality) { name.lowercase() } + p(isExternal, "external") + p(isFakeOverride, customModifier("fake")) + p(isOverride, "override") + p(isLateinit, "lateinit") + p(isTailrec, "tailrec") + printParameterModifiersWithNoIndent( + isVararg, + isCrossinline, + isNoinline, + isHidden, + isAssignable, + ) + p(isSuspend, "suspend") + p(isInner, "inner") + p(isInline, "inline") + p(isValue, "value") + p(isData, "data") + p(isCompanion, "companion") + p(isFunInterface, "fun") + p(classKind) { name.lowercase().replace('_', ' ') + if (this == ClassKind.ENUM_ENTRY) " class" else "" } + p(isInfix, "infix") + p(isOperator, "operator") } - p(modality, defaultModality) { name.lowercase() } - p(isExternal, "external") - p(isFakeOverride, customModifier("fake")) - p(isOverride, "override") - p(isLateinit, "lateinit") - p(isTailrec, "tailrec") - printParameterModifiersWithNoIndent( - isVararg, - isCrossinline = INAPPLICABLE, - isNoinline = INAPPLICABLE, - isHidden = INAPPLICABLE, - isAssignable = INAPPLICABLE - ) - p(isSuspend, "suspend") - p(isInner, "inner") - p(isInline, "inline") - p(isValue, "value") - p(isData, "data") - p(isCompanion, "companion") - p(isFunInterface, "fun") - p(classKind) { name.lowercase().replace('_', ' ') + if (this == ClassKind.ENUM_ENTRY) " class" else "" } - p(isInfix, "infix") - p(isOperator, "operator") - } private fun printVisibility(visibility: DescriptorVisibility) { // TODO don't print visibility if it's not changed in override? @@ -412,15 +441,18 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption p(this, Variance.INVARIANT) { label } } + private fun filterAnnotations(annotations: List, container: IrAnnotationContainer): List = + annotations.filter { options.customDumpStrategy.shouldPrintAnnotation(it, container) } + private fun IrAnnotationContainer.printAnnotationsWithNoIndent() { - annotations.forEach { + filterAnnotations(annotations, this).forEach { it.printAnAnnotationWithNoIndent() p.printWithNoIndent(" ") } } private fun IrAnnotationContainer.printlnAnnotations(prefix: String = "") { - annotations.forEach { + filterAnnotations(annotations, this).forEach { p.printIndent() it.printAnAnnotationWithNoIndent(prefix) p.printlnWithNoIndent() @@ -513,7 +545,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption } } - override fun visitTypeAlias(declaration: IrTypeAlias, data: IrDeclaration?) { + override fun visitTypeAlias(declaration: IrTypeAlias, data: IrDeclaration?) = wrap(declaration, data) { declaration.printlnAnnotations() p.printIndent() @@ -529,7 +561,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption p.printlnWithNoIndent() } - override fun visitEnumEntry(declaration: IrEnumEntry, data: IrDeclaration?) { + override fun visitEnumEntry(declaration: IrEnumEntry, data: IrDeclaration?) = wrap(declaration, data) { // TODO better rendering for enum entries declaration.correspondingClass?.let { p.println() } @@ -551,7 +583,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption p.println() } - override fun visitAnonymousInitializer(declaration: IrAnonymousInitializer, data: IrDeclaration?) { + override fun visitAnonymousInitializer(declaration: IrAnonymousInitializer, data: IrDeclaration?) = wrap(declaration, data) { // TODO no tests, looks like IrAnonymousInitializer has annotations accidentally. declaration.printlnAnnotations() p.printIndent() @@ -569,6 +601,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption override fun visitSimpleFunction(declaration: IrSimpleFunction, data: IrDeclaration?) { declaration.printSimpleFunction( + data, "fun ", declaration.name.asString(), printTypeParametersAndExtensionReceiver = true, @@ -577,7 +610,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption p.printlnWithNoIndent() } - override fun visitConstructor(declaration: IrConstructor, data: IrDeclaration?) { + override fun visitConstructor(declaration: IrConstructor, data: IrDeclaration?) = wrap(declaration, data) { // TODO name? // TODO is it worth to merge code for IrConstructor and IrSimpleFunction? // TODO dispatchReceiverParameter -- outer `this` for inner classes @@ -588,26 +621,13 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption declaration.run { printModifiersWithNoIndent( - visibility, - isExpect, - modality = INAPPLICABLE_N, - isExternal, - isOverride = INAPPLICABLE, - isFakeOverride = INAPPLICABLE, - isLateinit = INAPPLICABLE, - isTailrec = INAPPLICABLE, - isVararg = INAPPLICABLE, - isSuspend = INAPPLICABLE, - isInner = INAPPLICABLE, - isInline, - isValue = INAPPLICABLE, - isData = INAPPLICABLE, - isCompanion = INAPPLICABLE, - isFunInterface = INAPPLICABLE, - classKind = INAPPLICABLE_N, - isInfix = INAPPLICABLE, - isOperator = INAPPLICABLE, - isInterfaceMember = INAPPLICABLE + this, + Modifiers( + visibility = visibility, + isExpect = isExpect, + isExternal = isExternal, + isInline = isInline, + ), ) } @@ -628,6 +648,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption } private fun IrSimpleFunction.printSimpleFunction( + data: IrDeclaration?, keyword: String, name: String, printTypeParametersAndExtensionReceiver: Boolean, @@ -645,64 +666,58 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption return } - printlnAnnotations() - p.print("") + wrap(this, data) { + printlnAnnotations() + p.print("") - run { printModifiersWithNoIndent( - visibility, - isExpect, - modality, - isExternal, - isOverride = overriddenSymbols.isNotEmpty(), - isFakeOverride, - isLateinit = INAPPLICABLE, - isTailrec, - isVararg = INAPPLICABLE, - isSuspend, - isInner = INAPPLICABLE, - isInline, - isValue = INAPPLICABLE, - isData = INAPPLICABLE, - isCompanion = INAPPLICABLE, - isFunInterface = INAPPLICABLE, - classKind = INAPPLICABLE_N, - isInfix, - isOperator, - isInterfaceMember = (this@printSimpleFunction.parent as? IrClass)?.isInterface == true + this, + Modifiers( + visibility = visibility, + isExpect = isExpect, + modality = modality, + isExternal = isExternal, + isOverride = overriddenSymbols.isNotEmpty(), + isFakeOverride = isFakeOverride, + isLateinit = isTailrec, + isSuspend = isSuspend, + isInline = isInline, + isInfix = isInfix, + isOperator = isOperator, + ), ) - } - p.printWithNoIndent(keyword) + p.printWithNoIndent(keyword) - if (printTypeParametersAndExtensionReceiver) printTypeParametersWithNoIndent(postfix = " ") + if (printTypeParametersAndExtensionReceiver) printTypeParametersWithNoIndent(postfix = " ") - if (printTypeParametersAndExtensionReceiver) { - extensionReceiverParameter?.printExtensionReceiverParameter() - } - - p.printWithNoIndent(name) - - if (printSignatureAndBody) { - printValueParametersWithNoIndent() - - if (!returnType.isUnit()) { - p.printWithNoIndent(": ") - returnType.printTypeWithNoIndent() + if (printTypeParametersAndExtensionReceiver) { + extensionReceiverParameter?.printExtensionReceiverParameter() } - printWhereClauseIfNeededWithNoIndent() - body?.let { - if (options.bodyPrintingStrategy == BodyPrintingStrategy.PRINT_BODIES) { - p.printWithNoIndent(" ") + p.printWithNoIndent(name) + + if (printSignatureAndBody) { + printValueParametersWithNoIndent() + + if (options.printUnitReturnType || !returnType.isUnit()) { + p.printWithNoIndent(": ") + returnType.printTypeWithNoIndent() } - it.accept(this@KotlinLikeDumper, null) + printWhereClauseIfNeededWithNoIndent() + + body?.let { + if (options.bodyPrintingStrategy == BodyPrintingStrategy.PRINT_BODIES) { + p.printWithNoIndent(" ") + } + it.accept(this@KotlinLikeDumper, null) + } + } - } - - if (!printSignatureAndBody || body == null || options.bodyPrintingStrategy != BodyPrintingStrategy.PRINT_BODIES) { - p.printlnWithNoIndent() + if (!printSignatureAndBody || body == null || options.bodyPrintingStrategy != BodyPrintingStrategy.PRINT_BODIES) { + p.printlnWithNoIndent() + } } } @@ -747,17 +762,17 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption } } - override fun visitTypeParameter(declaration: IrTypeParameter, data: IrDeclaration?) { + override fun visitTypeParameter(declaration: IrTypeParameter, data: IrDeclaration?) = wrap(declaration, data) { declaration.printATypeParameterWithNoIndent() if (declaration.superTypes.size > 1) declaration.printWhereClauseTypesWithNoIndent(true) } - override fun visitValueParameter(declaration: IrValueParameter, data: IrDeclaration?) { + override fun visitValueParameter(declaration: IrValueParameter, data: IrDeclaration?) = wrap(declaration, data) { // TODO index? declaration.printAValueParameterWithNoIndent(data) } - override fun visitProperty(declaration: IrProperty, data: IrDeclaration?) { + override fun visitProperty(declaration: IrProperty, data: IrDeclaration?) = wrap(declaration, data) { if (options.printFakeOverridesStrategy == FakeOverridesStrategy.NONE && declaration.isFakeOverride) return declaration.printlnAnnotations() @@ -767,29 +782,21 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption // modifiers that could be different between accessors and property have a comment declaration.run { printModifiersWithNoIndent( - // accessors by default have same visibility, but the can define own value - visibility, - isExpect, - modality, - isExternal, - // couldn't be different for getter, possible for set, but it's invalid kotlin - isOverride = getter?.overriddenSymbols?.isNotEmpty() == true, - isFakeOverride, - isLateinit, - isTailrec = INAPPLICABLE, - isVararg = INAPPLICABLE, - isSuspend = getter?.isSuspend == true, - isInner = INAPPLICABLE, - // could be used on property if all accessors have same state, otherwise must be defined on each accessor - isInline = false, - isValue = INAPPLICABLE, - isData = INAPPLICABLE, - isCompanion = INAPPLICABLE, - isFunInterface = INAPPLICABLE, - classKind = INAPPLICABLE_N, - isInfix = INAPPLICABLE, - isOperator = INAPPLICABLE, - isInterfaceMember = (declaration.parent as? IrClass)?.isInterface == true + this, + Modifiers( + // accessors by default have same visibility, but the can define own value + visibility = visibility, + isExpect = isExpect, + modality = modality, + isExternal = isExternal, + // couldn't be different for getter, possible for set, but it's invalid kotlin + isOverride = getter?.overriddenSymbols?.isNotEmpty() == true, + isFakeOverride = isFakeOverride, + isLateinit = isLateinit, + isSuspend = getter?.isSuspend == true, + // could be used on property if all accessors have same state, otherwise must be defined on each accessor + isInline = false, + ), ) } @@ -852,44 +859,35 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption } // TODO generate better name for set parameter ``? - declaration.getter?.printAccessor("get") - declaration.setter?.printAccessor("set") + declaration.getter?.printAccessor("get", declaration) + declaration.setter?.printAccessor("set", declaration) p.popIndent() p.printlnWithNoIndent() } - private fun IrSimpleFunction.printAccessor(s: String) { + private fun IrSimpleFunction.printAccessor(s: String, property: IrDeclaration) { val isDefaultAccessor = origin != IrDeclarationOrigin.DEFAULT_PROPERTY_ACCESSOR - printSimpleFunction("", s, printTypeParametersAndExtensionReceiver = false, printSignatureAndBody = isDefaultAccessor) + printSimpleFunction( + property, + keyword = "", + name = s, + printTypeParametersAndExtensionReceiver = false, + printSignatureAndBody = isDefaultAccessor, + ) } - override fun visitField(declaration: IrField, data: IrDeclaration?) { + override fun visitField(declaration: IrField, data: IrDeclaration?) = wrap(declaration, data) { declaration.printlnAnnotations() p.printIndent() declaration.run { printModifiersWithNoIndent( - visibility, - isExpect = INAPPLICABLE, - modality = INAPPLICABLE_N, - isExternal, - isOverride = INAPPLICABLE, - isFakeOverride = INAPPLICABLE, - isLateinit = INAPPLICABLE, - isTailrec = INAPPLICABLE, - isVararg = INAPPLICABLE, - isSuspend = INAPPLICABLE, - isInner = INAPPLICABLE, - isInline = INAPPLICABLE, - isValue = INAPPLICABLE, - isData = INAPPLICABLE, - isCompanion = INAPPLICABLE, - isFunInterface = INAPPLICABLE, - classKind = INAPPLICABLE_N, - isInfix = INAPPLICABLE, - isOperator = INAPPLICABLE, - isInterfaceMember = (declaration.parent as? IrClass)?.isInterface == true + this, + Modifiers( + visibility = visibility, + isExternal = isExternal, + ), ) } @@ -919,7 +917,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption p.printlnWithNoIndent() } - override fun visitVariable(declaration: IrVariable, data: IrDeclaration?) { + override fun visitVariable(declaration: IrVariable, data: IrDeclaration?) = wrap(declaration, data) { declaration.printlnAnnotations() p.printIndent() @@ -933,7 +931,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption } } - override fun visitLocalDelegatedProperty(declaration: IrLocalDelegatedProperty, data: IrDeclaration?) { + override fun visitLocalDelegatedProperty(declaration: IrLocalDelegatedProperty, data: IrDeclaration?) = wrap(declaration, data) { declaration.printlnAnnotations() p.printIndent() @@ -946,8 +944,8 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption declaration.delegate.accept(this, declaration) p.printlnWithNoIndent() - declaration.getter.printAccessor("get") - declaration.setter?.printAccessor("set") + declaration.getter.printAccessor("get", declaration) + declaration.setter?.printAccessor("set", declaration) p.popIndent() p.printlnWithNoIndent() @@ -961,7 +959,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption type.printTypeWithNoIndent() } - private fun printBody(body: Body, data: IrDeclaration?, actuallyPrint: () -> Unit) { + private fun printBody(body: Body, data: IrDeclaration?, actuallyPrint: () -> Unit) = wrap(body, data) { when (options.bodyPrintingStrategy) { BodyPrintingStrategy.NO_BODIES -> {} BodyPrintingStrategy.PRINT_ONLY_LOCAL_CLASSES_AND_FUNCTIONS -> body.acceptChildren( @@ -1006,11 +1004,11 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption } } - override fun visitComposite(expression: IrComposite, data: IrDeclaration?) { + override fun visitComposite(expression: IrComposite, data: IrDeclaration?) = wrap(expression, data) { expression.printStatementContainer("// COMPOSITE {", "// }", data, withIndentation = false) } - override fun visitBlock(expression: IrBlock, data: IrDeclaration?) { + override fun visitBlock(expression: IrBlock, data: IrDeclaration?) = wrap(expression, data) { // TODO special blocks using `origin` // TODO inlineFunctionSymbol for IrReturnableBlock // TODO no tests for IrReturnableBlock? @@ -1050,7 +1048,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption } } - override fun visitCall(expression: IrCall, data: IrDeclaration?) { + override fun visitCall(expression: IrCall, data: IrDeclaration?) = wrap(expression, data) { // TODO process specially builtin symbols expression.printMemberAccessExpressionWithNoIndent( expression.symbol.safeName, @@ -1061,7 +1059,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption ) } - override fun visitConstructorCall(expression: IrConstructorCall, data: IrDeclaration?) { + override fun visitConstructorCall(expression: IrConstructorCall, data: IrDeclaration?) = wrap(expression, data) { expression.printMemberAccessExpressionWithNoIndent( expression.symbol.safeParentClassName, expression.symbol.safeValueParameters, @@ -1164,12 +1162,12 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption if (wrapArguments) p.printWithNoIndent("*/") } - override fun visitDelegatingConstructorCall(expression: IrDelegatingConstructorCall, data: IrDeclaration?) { + override fun visitDelegatingConstructorCall(expression: IrDelegatingConstructorCall, data: IrDeclaration?) = wrap(expression, data) { // TODO skip call to Any? expression.printConstructorCallWithNoIndent(data) } - override fun visitEnumConstructorCall(expression: IrEnumConstructorCall, data: IrDeclaration?) { + override fun visitEnumConstructorCall(expression: IrEnumConstructorCall, data: IrDeclaration?) = wrap(expression, data) { // TODO skip call to Enum? expression.printConstructorCallWithNoIndent(data) } @@ -1202,7 +1200,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption ) } - override fun visitInstanceInitializerCall(expression: IrInstanceInitializerCall, data: IrDeclaration?) { + override fun visitInstanceInitializerCall(expression: IrInstanceInitializerCall, data: IrDeclaration?) = wrap(expression, data) { // TODO assert that `expression.classSymbol.owner == data.parentAsClass // TODO better rendering p.printlnWithNoIndent("/* () */") @@ -1216,6 +1214,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption // TODO don't print visibility? p.withholdIndentOnce() expression.function.printSimpleFunction( + data, "fun ", expression.function.name.asString(), printTypeParametersAndExtensionReceiver = true, @@ -1223,11 +1222,11 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption ) } - override fun visitGetField(expression: IrGetField, data: IrDeclaration?) { + override fun visitGetField(expression: IrGetField, data: IrDeclaration?) = wrap(expression, data) { expression.printFieldAccess(data) } - override fun visitSetField(expression: IrSetField, data: IrDeclaration?) { + override fun visitSetField(expression: IrSetField, data: IrDeclaration?) = wrap(expression, data) { expression.printFieldAccess(data) p.printWithNoIndent(" = ") expression.value.accept(this, data) @@ -1252,27 +1251,27 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption p.printWithNoIndent("#" + symbol.safeName) } - override fun visitGetValue(expression: IrGetValue, data: IrDeclaration?) { + override fun visitGetValue(expression: IrGetValue, data: IrDeclaration?) = wrap(expression, data) { p.printWithNoIndent(expression.symbol.safeName) } - override fun visitSetValue(expression: IrSetValue, data: IrDeclaration?) { + override fun visitSetValue(expression: IrSetValue, data: IrDeclaration?) = wrap(expression, data) { p.printWithNoIndent(expression.symbol.safeName + " = ") expression.value.accept(this, data) } - override fun visitGetObjectValue(expression: IrGetObjectValue, data: IrDeclaration?) { + override fun visitGetObjectValue(expression: IrGetObjectValue, data: IrDeclaration?) = wrap(expression, data) { // TODO what if symbol is unbound? expression.symbol.defaultType.printTypeWithNoIndent() } - override fun visitGetEnumValue(expression: IrGetEnumValue, data: IrDeclaration?) { + override fun visitGetEnumValue(expression: IrGetEnumValue, data: IrDeclaration?) = wrap(expression, data) { p.printWithNoIndent(expression.symbol.safeParentClassName) p.printWithNoIndent(".") p.printWithNoIndent(expression.symbol.safeName) } - override fun visitRawFunctionReference(expression: IrRawFunctionReference, data: IrDeclaration?) { + override fun visitRawFunctionReference(expression: IrRawFunctionReference, data: IrDeclaration?) = wrap(expression, data) { // TODO support // TODO no test // it's not valid kotlin @@ -1280,7 +1279,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption super.visitRawFunctionReference(expression, data) } - override fun visitReturn(expression: IrReturn, data: IrDeclaration?) { + override fun visitReturn(expression: IrReturn, data: IrDeclaration?) = wrap(expression, data) { // TODO label // TODO optionally don't print Unit when return type of returnTargetSymbol is Unit p.printWithNoIndent("return ") @@ -1292,7 +1291,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption expression.value.accept(this, data) } - override fun visitStringConcatenation(expression: IrStringConcatenation, data: IrDeclaration?) { + override fun visitStringConcatenation(expression: IrStringConcatenation, data: IrDeclaration?) = wrap(expression, data) { // TODO use triple quotes when possible? // TODO optionally each argument at a separate line, another option add a wrapping expression.arguments.forEachIndexed { i, e -> @@ -1301,7 +1300,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption } } - override fun visitConst(expression: IrConst<*>, data: IrDeclaration?) { + override fun visitConst(expression: IrConst<*>, data: IrDeclaration?) = wrap(expression, data) { val kind = expression.kind val (prefix, postfix) = when (kind) { @@ -1330,7 +1329,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption p.printWithNoIndent(prefix, safeValue, postfix) } - override fun visitVararg(expression: IrVararg, data: IrDeclaration?) { + override fun visitVararg(expression: IrVararg, data: IrDeclaration?) = wrap(expression, data) { // TODO better rendering? // TODO varargElementType // it's not valid kotlin @@ -1342,12 +1341,12 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption p.printWithNoIndent("]") } - override fun visitSpreadElement(spread: IrSpreadElement, data: IrDeclaration?) { + override fun visitSpreadElement(spread: IrSpreadElement, data: IrDeclaration?) = wrap(spread, data) { p.printWithNoIndent("*") spread.expression.accept(this, data) } - override fun visitTypeOperator(expression: IrTypeOperatorCall, data: IrDeclaration?) { + override fun visitTypeOperator(expression: IrTypeOperatorCall, data: IrDeclaration?) = wrap(expression, data) { val (operator, after) = when (expression.operator) { IrTypeOperator.CAST -> "as" to "" IrTypeOperator.IMPLICIT_CAST -> "/*as" to " */" @@ -1369,7 +1368,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption } - override fun visitWhen(expression: IrWhen, data: IrDeclaration?) { + override fun visitWhen(expression: IrWhen, data: IrDeclaration?) = wrap(expression, data) { // TODO print if when possible? p.printlnWithNoIndent("when {") p.pushIndent() @@ -1380,7 +1379,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption p.print("}") } - override fun visitBranch(branch: IrBranch, data: IrDeclaration?) { + override fun visitBranch(branch: IrBranch, data: IrDeclaration?) = wrap(branch, data) { p.printIndent() branch.condition.accept(this, data) p.printWithNoIndent(" -> ") @@ -1388,7 +1387,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption p.println() } - override fun visitElseBranch(branch: IrElseBranch, data: IrDeclaration?) { + override fun visitElseBranch(branch: IrElseBranch, data: IrDeclaration?) = wrap(branch, data) { p.printIndent() if ((branch.condition as? IrConst<*>)?.value == true) { p.printWithNoIndent(if (options.printElseAsTrue) "true" else "else") @@ -1408,7 +1407,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption } } - override fun visitWhileLoop(loop: IrWhileLoop, data: IrDeclaration?) { + override fun visitWhileLoop(loop: IrWhileLoop, data: IrDeclaration?) = wrap(loop, data) { loop.printLabel() p.printWithNoIndent("while (") @@ -1418,7 +1417,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption loop.body?.accept(this, data) } - override fun visitDoWhileLoop(loop: IrDoWhileLoop, data: IrDeclaration?) { + override fun visitDoWhileLoop(loop: IrDoWhileLoop, data: IrDeclaration?) = wrap(loop, data) { loop.printLabel() p.printWithNoIndent("do") @@ -1431,7 +1430,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption } - override fun visitBreakContinue(jump: IrBreakContinue, data: IrDeclaration?) { + override fun visitBreakContinue(jump: IrBreakContinue, data: IrDeclaration?) = wrap(jump, data) { // TODO render loop reference p.printWithNoIndent(if (jump is IrContinue) "continue" else "break") jump.label?.let { @@ -1440,7 +1439,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption } } - override fun visitTry(aTry: IrTry, data: IrDeclaration?) { + override fun visitTry(aTry: IrTry, data: IrDeclaration?) = wrap(aTry, data) { p.printWithNoIndent("try ") aTry.tryResult.accept(this, data) p.printlnWithNoIndent() @@ -1453,7 +1452,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption } } - override fun visitCatch(aCatch: IrCatch, data: IrDeclaration?) { + override fun visitCatch(aCatch: IrCatch, data: IrDeclaration?) = wrap(aCatch, data) { p.print("catch (") aCatch.catchParameter.run { p.printWithNoIndent(name.asString()) @@ -1465,31 +1464,32 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption p.printlnWithNoIndent() } - override fun visitGetClass(expression: IrGetClass, data: IrDeclaration?) { + override fun visitGetClass(expression: IrGetClass, data: IrDeclaration?) = wrap(expression, data) { expression.argument.accept(this, data) p.printWithNoIndent("::class") } - override fun visitClassReference(expression: IrClassReference, data: IrDeclaration?) { + override fun visitClassReference(expression: IrClassReference, data: IrDeclaration?) = wrap(expression, data) { // TODO use classType p.printWithNoIndent(expression.symbol.safeName) p.printWithNoIndent("::class") } - override fun visitFunctionReference(expression: IrFunctionReference, data: IrDeclaration?) { + override fun visitFunctionReference(expression: IrFunctionReference, data: IrDeclaration?) = wrap(expression, data) { // TODO reflectionTarget expression.printCallableReferenceWithNoIndent(expression.symbol.safeValueParameters, data) } - override fun visitPropertyReference(expression: IrPropertyReference, data: IrDeclaration?) { + override fun visitPropertyReference(expression: IrPropertyReference, data: IrDeclaration?) = wrap(expression, data) { // TODO do we need additional fields (field, getter, setter)? expression.printCallableReferenceWithNoIndent(emptyList(), data) } - override fun visitLocalDelegatedPropertyReference(expression: IrLocalDelegatedPropertyReference, data: IrDeclaration?) { - // TODO do we need additional fields (delegate, getter, setter)? - expression.printCallableReferenceWithNoIndent(emptyList(), data) - } + override fun visitLocalDelegatedPropertyReference(expression: IrLocalDelegatedPropertyReference, data: IrDeclaration?) = + wrap(expression, data) { + // TODO do we need additional fields (delegate, getter, setter)? + expression.printCallableReferenceWithNoIndent(emptyList(), data) + } private fun IrCallableReference<*>.printCallableReferenceWithNoIndent(valueParameters: List, data: IrDeclaration?) { // TODO where from to get type arguments for a class? @@ -1512,7 +1512,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption ) } - override fun visitDynamicOperatorExpression(expression: IrDynamicOperatorExpression, data: IrDeclaration?) { + override fun visitDynamicOperatorExpression(expression: IrDynamicOperatorExpression, data: IrDeclaration?) = wrap(expression, data) { // TODO marker to show that it's dynamic call val s = when (val op = expression.operator) { IrDynamicOperator.ARRAY_ACCESS -> "[" to "]" @@ -1547,23 +1547,23 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption p.printWithNoIndent(s.second) } - override fun visitDynamicMemberExpression(expression: IrDynamicMemberExpression, data: IrDeclaration?) { + override fun visitDynamicMemberExpression(expression: IrDynamicMemberExpression, data: IrDeclaration?) = wrap(expression, data) { expression.receiver.accept(this, data) p.printWithNoIndent(".") p.printWithNoIndent(expression.memberName) } - override fun visitErrorDeclaration(declaration: IrErrorDeclaration, data: IrDeclaration?) { + override fun visitErrorDeclaration(declaration: IrErrorDeclaration, data: IrDeclaration?) = wrap(declaration, data) { // TODO declaration.printlnAnnotations() p.println("/* ErrorDeclaration */") } - override fun visitErrorExpression(expression: IrErrorExpression, data: IrDeclaration?) { + override fun visitErrorExpression(expression: IrErrorExpression, data: IrDeclaration?) = wrap(expression, data) { // TODO description p.printWithNoIndent("error(\"\") /* ErrorExpression */") } - override fun visitErrorCallExpression(expression: IrErrorCallExpression, data: IrDeclaration?) { + override fun visitErrorCallExpression(expression: IrErrorCallExpression, data: IrDeclaration?) = wrap(expression, data) { // TODO description // TODO better rendering p.printWithNoIndent("error(\"\") /* ErrorCallExpression */") @@ -1595,8 +1595,6 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption } private companion object { - private const val INAPPLICABLE = false - private val INAPPLICABLE_N = null private const val CUSTOM_MODIFIER_START = "/* " private const val CUSTOM_MODIFIER_END = " */" } diff --git a/compiler/testData/ir/irText/classes/47424.sig.kt.txt b/compiler/testData/ir/irText/classes/47424.sig.kt.txt new file mode 100644 index 00000000000..524d565fc76 --- /dev/null +++ b/compiler/testData/ir/irText/classes/47424.sig.kt.txt @@ -0,0 +1,87 @@ +package com.example + +// CHECK: +// Mangled name: com.example.Aa +// Public signature: com.example/Aa|null[0] +interface Aa { + +} + +// CHECK: +// Mangled name: com.example.Ab +// Public signature: com.example/Ab|null[0] +interface Ab> : Aa { + +} + +// CHECK: +// Mangled name: com.example.Ba +// Public signature: com.example/Ba|null[0] +interface Ba { + +} + +// CHECK: +// Mangled name: com.example.Bb +// Public signature: com.example/Bb|null[0] +interface Bb> : Ab, Ba { + +} + +// CHECK: +// Mangled name: com.example.C +// Public signature: com.example/C|null[0] +interface C : Ca, Cb { + + // CHECK: + // Mangled name: com.example.C{}b + // Public signature: com.example/C.b|772347207915745207[0] + abstract /* fake */ override val b: Bb<*> + // CHECK JVM_IR: + // Mangled name: com.example.C#(){}com.example.Bb<*> + // Public signature: com.example/C.b.|8945515346267380674[0] + // CHECK JS_IR NATIVE: + // Mangled name: com.example.C#(){} + // Public signature: com.example/C.b.|812004636995167743[0] + abstract /* fake */ override get(): Bb<*> + +} + +// CHECK: +// Mangled name: com.example.Ca +// Public signature: com.example/Ca|null[0] +interface Ca { + + // CHECK: + // Mangled name: com.example.Ca{}b + // Public signature: com.example/Ca.b|772347207915745207[0] + abstract val b: Ba + // CHECK JVM_IR: + // Mangled name: com.example.Ca#(){}com.example.Ba + // Public signature: com.example/Ca.b.|-5371331002991031414[0] + // CHECK JS_IR NATIVE: + // Mangled name: com.example.Ca#(){} + // Public signature: com.example/Ca.b.|812004636995167743[0] + abstract get + +} + +// CHECK: +// Mangled name: com.example.Cb +// Public signature: com.example/Cb|null[0] +interface Cb { + + // CHECK: + // Mangled name: com.example.Cb{}b + // Public signature: com.example/Cb.b|772347207915745207[0] + abstract val b: Bb<*> + // CHECK JVM_IR: + // Mangled name: com.example.Cb#(){}com.example.Bb<*> + // Public signature: com.example/Cb.b.|8945515346267380674[0] + // CHECK JS_IR NATIVE: + // Mangled name: com.example.Cb#(){} + // Public signature: com.example/Cb.b.|812004636995167743[0] + abstract get + +} + diff --git a/compiler/testData/ir/irText/classes/abstractMembers.sig.kt.txt b/compiler/testData/ir/irText/classes/abstractMembers.sig.kt.txt new file mode 100644 index 00000000000..6b1d9a00c91 --- /dev/null +++ b/compiler/testData/ir/irText/classes/abstractMembers.sig.kt.txt @@ -0,0 +1,84 @@ +// CHECK: +// Mangled name: AbstractClass +// Public signature: /AbstractClass|null[0] +abstract class AbstractClass { + // CHECK: + // Mangled name: AbstractClass#(){} + // Public signature: /AbstractClass.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: AbstractClass#abstractFun(){} + // Public signature: /AbstractClass.abstractFun|-8137574360252002020[0] + abstract fun abstractFun(): Unit + + // CHECK: + // Mangled name: AbstractClass{}abstractVal + // Public signature: /AbstractClass.abstractVal|2000751617811374017[0] + abstract val abstractVal: Int + // CHECK JVM_IR: + // Mangled name: AbstractClass#(){}kotlin.Int + // Public signature: /AbstractClass.abstractVal.|1560246296064696993[0] + // CHECK JS_IR NATIVE: + // Mangled name: AbstractClass#(){} + // Public signature: /AbstractClass.abstractVal.|-836793625462255519[0] + abstract get + + // CHECK: + // Mangled name: AbstractClass{}abstractVar + // Public signature: /AbstractClass.abstractVar|-2520811489168320452[0] + abstract var abstractVar: Int + // CHECK JVM_IR: + // Mangled name: AbstractClass#(){}kotlin.Int + // Public signature: /AbstractClass.abstractVar.|-3718567610021314347[0] + // CHECK JS_IR NATIVE: + // Mangled name: AbstractClass#(){} + // Public signature: /AbstractClass.abstractVar.|7559126596100066971[0] + abstract get + // CHECK: + // Mangled name: AbstractClass#(kotlin.Int){} + // Public signature: /AbstractClass.abstractVar.|-250114380965539035[0] + abstract set + +} + +// CHECK: +// Mangled name: Interface +// Public signature: /Interface|null[0] +interface Interface { + + // CHECK: + // Mangled name: Interface#abstractFun(){} + // Public signature: /Interface.abstractFun|-8137574360252002020[0] + abstract fun abstractFun(): Unit + + // CHECK: + // Mangled name: Interface{}abstractVal + // Public signature: /Interface.abstractVal|2000751617811374017[0] + abstract val abstractVal: Int + // CHECK JVM_IR: + // Mangled name: Interface#(){}kotlin.Int + // Public signature: /Interface.abstractVal.|1560246296064696993[0] + // CHECK JS_IR NATIVE: + // Mangled name: Interface#(){} + // Public signature: /Interface.abstractVal.|-836793625462255519[0] + abstract get + + // CHECK: + // Mangled name: Interface{}abstractVar + // Public signature: /Interface.abstractVar|-2520811489168320452[0] + abstract var abstractVar: Int + // CHECK JVM_IR: + // Mangled name: Interface#(){}kotlin.Int + // Public signature: /Interface.abstractVar.|-3718567610021314347[0] + // CHECK JS_IR NATIVE: + // Mangled name: Interface#(){} + // Public signature: /Interface.abstractVar.|7559126596100066971[0] + abstract get + // CHECK: + // Mangled name: Interface#(kotlin.Int){} + // Public signature: /Interface.abstractVar.|-250114380965539035[0] + abstract set + +} + diff --git a/compiler/testData/ir/irText/classes/annotationClasses.sig.kt.txt b/compiler/testData/ir/irText/classes/annotationClasses.sig.kt.txt new file mode 100644 index 00000000000..6c7a166f73c --- /dev/null +++ b/compiler/testData/ir/irText/classes/annotationClasses.sig.kt.txt @@ -0,0 +1,92 @@ +// CHECK: +// Mangled name: Test1 +// Public signature: /Test1|null[0] +open annotation class Test1 : Annotation { + // CHECK: + // Mangled name: Test1{}x + // Public signature: /Test1.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: Test1#(){}kotlin.Int + // Public signature: /Test1.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Test1#(kotlin.Int){} + // Public signature: /Test1.|-5182794243525578284[0] + constructor(x: Int) /* primary */ + +} + +// CHECK: +// Mangled name: Test2 +// Public signature: /Test2|null[0] +open annotation class Test2 : Annotation { + // CHECK: + // Mangled name: Test2{}x + // Public signature: /Test2.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: Test2#(){}kotlin.Int + // Public signature: /Test2.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#(){} + // Public signature: /Test2.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Test2#(kotlin.Int){} + // Public signature: /Test2.|-5182794243525578284[0] + constructor(x: Int) /* primary */ + +} + +// CHECK: +// Mangled name: Test3 +// Public signature: /Test3|null[0] +open annotation class Test3 : Annotation { + // CHECK: + // Mangled name: Test3{}x + // Public signature: /Test3.x|-8060530855978347579[0] + val x: Test1 + // CHECK JVM_IR: + // Mangled name: Test3#(){}Test1 + // Public signature: /Test3.x.|-2232578314937133118[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#(){} + // Public signature: /Test3.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Test3#(Test1){} + // Public signature: /Test3.|-2039475164068253223[0] + constructor(x: Test1) /* primary */ + +} + +// CHECK: +// Mangled name: Test4 +// Public signature: /Test4|null[0] +open annotation class Test4 : Annotation { + // CHECK: + // Mangled name: Test4{}xs + // Public signature: /Test4.xs|1063330853857063704[0] + val xs: IntArray + // CHECK JVM_IR: + // Mangled name: Test4#(){}kotlin.IntArray + // Public signature: /Test4.xs.|5887559004820637749[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test4#(){} + // Public signature: /Test4.xs.|-6958094100501701183[0] + get + + // CHECK: + // Mangled name: Test4#(kotlin.IntArray...){} + // Public signature: /Test4.|3304157197881351514[0] + constructor(vararg xs: Int) /* primary */ + +} + diff --git a/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.sig.kt.txt b/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.sig.kt.txt new file mode 100644 index 00000000000..9c64a28ccc4 --- /dev/null +++ b/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.sig.kt.txt @@ -0,0 +1,109 @@ +// CHECK: +// Mangled name: Base +// Public signature: /Base|null[0] +open class Base { + // CHECK: + // Mangled name: Base{}x + // Public signature: /Base.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: Base#(){}kotlin.Int + // Public signature: /Base.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Base#(){} + // Public signature: /Base.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Base{}y + // Public signature: /Base.y|3625903257357557171[0] + val y: Int + // CHECK JVM_IR: + // Mangled name: Base#(){}kotlin.Int + // Public signature: /Base.y.|-6745575372101973707[0] + // CHECK JS_IR NATIVE: + // Mangled name: Base#(){} + // Public signature: /Base.y.|-7902422373892128922[0] + get + + // CHECK: + // Mangled name: Base#(kotlin.Int;kotlin.Int){} + // Public signature: /Base.|-7691762014320324121[0] + constructor(x: Int, y: Int) /* primary */ + +} + +// CHECK: +// Mangled name: Test1 +// Public signature: /Test1|null[0] +class Test1 : Base { + // CHECK: + // Mangled name: Test1#(kotlin.Int;kotlin.Int){} + // Public signature: /Test1.|-7691762014320324121[0] + constructor(xx: Int, yy: Int) /* primary */ + + // CHECK: + // Mangled name: Test1{}x + // Public signature: /Test1.x|-8060530855978347579[0] + /* fake */ override val x: Int + // CHECK JVM_IR: + // Mangled name: Test1#(){}kotlin.Int + // Public signature: /Test1.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.x.|1482705010654679335[0] + /* fake */ override get(): Int + + // CHECK: + // Mangled name: Test1{}y + // Public signature: /Test1.y|3625903257357557171[0] + /* fake */ override val y: Int + // CHECK JVM_IR: + // Mangled name: Test1#(){}kotlin.Int + // Public signature: /Test1.y.|-6745575372101973707[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.y.|-7902422373892128922[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: Test2 +// Public signature: /Test2|null[0] +class Test2 : Base { + // CHECK: + // Mangled name: Test2#(kotlin.Int;kotlin.Int){} + // Public signature: /Test2.|-7691762014320324121[0] + constructor(xx: Int, yy: Int) + // CHECK: + // Mangled name: Test2#(kotlin.Int;kotlin.Int;kotlin.Any){} + // Public signature: /Test2.|-2775945437722696135[0] + constructor(xxx: Int, yyy: Int, a: Any) + + // CHECK: + // Mangled name: Test2{}x + // Public signature: /Test2.x|-8060530855978347579[0] + /* fake */ override val x: Int + // CHECK JVM_IR: + // Mangled name: Test2#(){}kotlin.Int + // Public signature: /Test2.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#(){} + // Public signature: /Test2.x.|1482705010654679335[0] + /* fake */ override get(): Int + + // CHECK: + // Mangled name: Test2{}y + // Public signature: /Test2.y|3625903257357557171[0] + /* fake */ override val y: Int + // CHECK JVM_IR: + // Mangled name: Test2#(){}kotlin.Int + // Public signature: /Test2.y.|-6745575372101973707[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#(){} + // Public signature: /Test2.y.|-7902422373892128922[0] + /* fake */ override get(): Int + +} + diff --git a/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.sig.kt.txt b/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.sig.kt.txt new file mode 100644 index 00000000000..a10a7c7dac9 --- /dev/null +++ b/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.sig.kt.txt @@ -0,0 +1,233 @@ +// CHECK: +// Mangled name: Base +// Public signature: /Base|null[0] +open class Base { + // CHECK: + // Mangled name: Base#(){} + // Public signature: /Base.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Base#foo(1:0){} + // Public signature: /Base.foo|-701456291278879981[0] + fun foo(x: T): Unit + + // CHECK: + // Mangled name: Base#foo(kotlin.String){} + // Public signature: /Base.foo|1351044947738582195[0] + fun foo(y: String): Unit + + // CHECK: + // Mangled name: Base@1:0{}bar + // Public signature: /Base.bar|2723903059187474703[0] + val T.bar: Int + // CHECK JVM_IR: + // Mangled name: Base#@1:0(){}kotlin.Int + // Public signature: /Base.bar.|-3456944057375693285[0] + get(): Int + + // CHECK: + // Mangled name: Base@kotlin.String{}bar + // Public signature: /Base.bar|-1423076340722422780[0] + val String.bar: Int + // CHECK JVM_IR: + // Mangled name: Base#@kotlin.String(){}kotlin.Int + // Public signature: /Base.bar.|-1735437823545695148[0] + get(): Int + +} + +// CHECK: +// Mangled name: BaseXY +// Public signature: /BaseXY|null[0] +open class BaseXY { + // CHECK: + // Mangled name: BaseXY#(){} + // Public signature: /BaseXY.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: BaseXY#foo(1:0;kotlin.String){} + // Public signature: /BaseXY.foo|-6449444608569619796[0] + fun foo(x: X, y: String): Unit + + // CHECK: + // Mangled name: BaseXY#foo(kotlin.String;1:1){} + // Public signature: /BaseXY.foo|1702475903058974856[0] + fun foo(x: String, y: Y): Unit + +} + +// CHECK: +// Mangled name: Derived +// Public signature: /Derived|null[0] +open class Derived : Base { + // CHECK: + // Mangled name: Derived#(){} + // Public signature: /Derived.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Derived#foo(kotlin.String){} + // Public signature: /Derived.foo|1351044947738582195[0] + /* fake */ override fun foo(x: String): Unit + + // CHECK: + // Mangled name: Derived#foo(kotlin.String){} + // Public signature: /Derived.foo|1351044947738582195[0] + /* fake */ override fun foo(y: String): Unit + + // CHECK: + // Mangled name: Derived@kotlin.String{}bar + // Public signature: /Derived.bar|-1423076340722422780[0] + /* fake */ override val String.bar: Int + // CHECK JVM_IR: + // Mangled name: Derived#@kotlin.String(){}kotlin.Int + // Public signature: /Derived.bar.|-1735437823545695148[0] + /* fake */ override get(): Int + + // CHECK: + // Mangled name: Derived@kotlin.String{}bar + // Public signature: /Derived.bar|-1423076340722422780[0] + /* fake */ override val String.bar: Int + // CHECK JVM_IR: + // Mangled name: Derived#@kotlin.String(){}kotlin.Int + // Public signature: /Derived.bar.|-1735437823545695148[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: Derived2 +// Public signature: /Derived2|null[0] +class Derived2 : Derived { + // CHECK: + // Mangled name: Derived2#(){} + // Public signature: /Derived2.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Derived2#foo(kotlin.String){} + // Public signature: /Derived2.foo|1351044947738582195[0] + /* fake */ override fun foo(x: String): Unit + + // CHECK: + // Mangled name: Derived2#foo(kotlin.String){} + // Public signature: /Derived2.foo|1351044947738582195[0] + /* fake */ override fun foo(y: String): Unit + + // CHECK: + // Mangled name: Derived2@kotlin.String{}bar + // Public signature: /Derived2.bar|-1423076340722422780[0] + /* fake */ override val String.bar: Int + // CHECK JVM_IR: + // Mangled name: Derived2#@kotlin.String(){}kotlin.Int + // Public signature: /Derived2.bar.|-1735437823545695148[0] + /* fake */ override get(): Int + + // CHECK: + // Mangled name: Derived2@kotlin.String{}bar + // Public signature: /Derived2.bar|-1423076340722422780[0] + /* fake */ override val String.bar: Int + // CHECK JVM_IR: + // Mangled name: Derived2#@kotlin.String(){}kotlin.Int + // Public signature: /Derived2.bar.|-1735437823545695148[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: DerivedXY +// Public signature: /DerivedXY|null[0] +class DerivedXY : BaseXY { + // CHECK: + // Mangled name: DerivedXY#(){} + // Public signature: /DerivedXY.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: DerivedXY#foo(kotlin.String;kotlin.String){} + // Public signature: /DerivedXY.foo|-3768462707108232911[0] + /* fake */ override fun foo(x: String, y: String): Unit + + // CHECK: + // Mangled name: DerivedXY#foo(kotlin.String;kotlin.String){} + // Public signature: /DerivedXY.foo|-3768462707108232911[0] + /* fake */ override fun foo(x: String, y: String): Unit + +} + +// CHECK: +// Mangled name: Outer +// Public signature: /Outer|null[0] +open class Outer { + // CHECK: + // Mangled name: Outer.Inner + // Public signature: /Outer.Inner|null[0] + open inner class Inner { + // CHECK: + // Mangled name: Outer.Inner#(){} + // Public signature: /Outer.Inner.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Outer.Inner#foo(2:0){} + // Public signature: /Outer.Inner.foo|5312251114282969214[0] + fun foo(x: T): Unit + + // CHECK: + // Mangled name: Outer.Inner#foo(kotlin.String){} + // Public signature: /Outer.Inner.foo|1351044947738582195[0] + fun foo(y: String): Unit + + } + + // CHECK: + // Mangled name: Outer#(){} + // Public signature: /Outer.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: OuterDerived +// Public signature: /OuterDerived|null[0] +class OuterDerived : Outer { + // CHECK: + // Mangled name: OuterDerived.InnerDerived + // Public signature: /OuterDerived.InnerDerived|null[0] + inner class InnerDerived : Inner { + // CHECK: + // Mangled name: OuterDerived.InnerDerived#(){} + // Public signature: /OuterDerived.InnerDerived.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: OuterDerived.InnerDerived#foo(kotlin.String){} + // Public signature: /OuterDerived.InnerDerived.foo|1351044947738582195[0] + /* fake */ override fun foo(x: String): Unit + + // CHECK: + // Mangled name: OuterDerived.InnerDerived#foo(kotlin.String){} + // Public signature: /OuterDerived.InnerDerived.foo|1351044947738582195[0] + /* fake */ override fun foo(y: String): Unit + + } + + // CHECK: + // Mangled name: OuterDerived#(){} + // Public signature: /OuterDerived.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: #outerFun(){} +// Public signature: /outerFun|-7637205853782391556[0] +fun outerFun(): Unit + +// CHECK: +// Mangled name: #test(Base;Derived;Derived2){} +// Public signature: /test|4797523954931916574[0] +fun test(b: Base, d: Derived, d2: Derived2): Unit + diff --git a/compiler/testData/ir/irText/classes/classMembers.sig.kt.txt b/compiler/testData/ir/irText/classes/classMembers.sig.kt.txt new file mode 100644 index 00000000000..c0a161114e7 --- /dev/null +++ b/compiler/testData/ir/irText/classes/classMembers.sig.kt.txt @@ -0,0 +1,142 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C{}y + // Public signature: /C.y|3625903257357557171[0] + val y: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.y.|-6745575372101973707[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.y.|-7902422373892128922[0] + get + + // CHECK: + // Mangled name: C{}z + // Public signature: /C.z|7549650372729116193[0] + var z: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.z.|373477940260174794[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.z.|4925813204745917177[0] + get + // CHECK: + // Mangled name: C#(kotlin.Int){} + // Public signature: /C.z.|8486465404430625584[0] + set + + // CHECK: + // Mangled name: C{}property + // Public signature: /C.property|4634558160746314112[0] + val property: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.property.|2853131919076574313[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.property.|4838831487146901942[0] + get + + // CHECK: + // Mangled name: C.NestedClass + // Public signature: /C.NestedClass|null[0] + class NestedClass { + // CHECK: + // Mangled name: C.NestedClass#(){} + // Public signature: /C.NestedClass.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: C.NestedClass#function(){} + // Public signature: /C.NestedClass.function|-3322893411126713785[0] + fun function(): Unit + + // CHECK: + // Mangled name: C.NestedClass#memberExtensionFunction@kotlin.Int(){} + // Public signature: /C.NestedClass.memberExtensionFunction|4691153119931446820[0] + fun Int.memberExtensionFunction(): Unit + + } + + // CHECK: + // Mangled name: C.NestedInterface + // Public signature: /C.NestedInterface|null[0] + interface NestedInterface { + + // CHECK: + // Mangled name: C.NestedInterface#bar(){} + // Public signature: /C.NestedInterface.bar|496682602797471549[0] + fun bar(): Unit + + // CHECK: + // Mangled name: C.NestedInterface#foo(){} + // Public signature: /C.NestedInterface.foo|-1041209573719867811[0] + abstract fun foo(): Unit + + } + + // CHECK: + // Mangled name: C.Companion + // Public signature: /C.Companion|null[0] + companion object Companion { + // CHECK: + // Mangled name: C.Companion#(){} + // Public signature: /C.Companion.|-5645683436151566731[0] + private constructor() /* primary */ + + } + + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() + // CHECK: + // Mangled name: C#(kotlin.Int;kotlin.Int;kotlin.Int){} + // Public signature: /C.|3555954663887180339[0] + constructor(x: Int, y: Int, z: Int) /* primary */ + + // CHECK: + // Mangled name: C#function(){} + // Public signature: /C.function|-3322893411126713785[0] + fun function(): Unit + + // CHECK: + // Mangled name: C#memberExtensionFunction@kotlin.Int(){} + // Public signature: /C.memberExtensionFunction|4691153119931446820[0] + fun Int.memberExtensionFunction(): Unit + + // CHECK: + // Mangled name: C{}propertyWithGet + // Public signature: /C.propertyWithGet|3309863354483039401[0] + val propertyWithGet: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.propertyWithGet.|-1283372725192636165[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.propertyWithGet.|5182559010864477179[0] + get(): Int + + // CHECK: + // Mangled name: C{}propertyWithGetAndSet + // Public signature: /C.propertyWithGetAndSet|9136157132489204883[0] + var propertyWithGetAndSet: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.propertyWithGetAndSet.|2703109318737687323[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.propertyWithGetAndSet.|6534309127249044994[0] + get(): Int + // CHECK: + // Mangled name: C#(kotlin.Int){} + // Public signature: /C.propertyWithGetAndSet.|-6849583414558768890[0] + set(value: Int): Unit + +} + diff --git a/compiler/testData/ir/irText/classes/classes.kt b/compiler/testData/ir/irText/classes/classes.kt index 3526ee243f1..9b8254c6945 100644 --- a/compiler/testData/ir/irText/classes/classes.kt +++ b/compiler/testData/ir/irText/classes/classes.kt @@ -1,6 +1,9 @@ // 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/classes.sig.kt.txt b/compiler/testData/ir/irText/classes/classes.sig.kt.txt new file mode 100644 index 00000000000..64ce3f29162 --- /dev/null +++ b/compiler/testData/ir/irText/classes/classes.sig.kt.txt @@ -0,0 +1,142 @@ +// CHECK: +// Mangled name: TestAnnotationClass +// Public signature: /TestAnnotationClass|null[0] +open annotation class TestAnnotationClass : Annotation { + // CHECK: + // Mangled name: TestAnnotationClass#(){} + // Public signature: /TestAnnotationClass.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: TestClass +// Public signature: /TestClass|null[0] +class TestClass { + // CHECK: + // Mangled name: TestClass#(){} + // Public signature: /TestClass.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: TestEnumClass +// Public signature: /TestEnumClass|null[0] +enum class TestEnumClass : Enum { + // CHECK: + // Mangled name: TestEnumClass#(){} + // Public signature: /TestEnumClass.|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK JVM_IR: + // Mangled name: TestEnumClass#valueOf#static(kotlin.String){}TestEnumClass + // Public signature: /TestEnumClass.valueOf|3258702714702284561[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnumClass#valueOf#static(kotlin.String){} + // Public signature: /TestEnumClass.valueOf|-4683474617854611729[0] + fun valueOf(value: String): TestEnumClass + + // CHECK JVM_IR: + // Mangled name: TestEnumClass#values#static(){}kotlin.Array + // Public signature: /TestEnumClass.values|2819729310351736077[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnumClass#values#static(){} + // Public signature: /TestEnumClass.values|-8715569000920726747[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: TestEnumClass#clone(){}kotlin.Any + // Public signature: /TestEnumClass.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnumClass#compareTo(TestEnumClass){} + // Public signature: /TestEnumClass.compareTo|5404150121610277282[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: TestEnumClass#compareTo(TestEnumClass){}kotlin.Int + // Public signature: /TestEnumClass.compareTo|-9135154948806454387[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnumClass#equals(kotlin.Any?){} + // Public signature: /TestEnumClass.equals|4638265728071529943[0] + /* fake */ override operator fun compareTo(other: TestEnumClass): Int + + // CHECK JVM_IR: + // Mangled name: TestEnumClass#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestEnumClass.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnumClass#hashCode(){} + // Public signature: /TestEnumClass.hashCode|3409210261493131192[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: TestEnumClass#hashCode(){}kotlin.Int + // Public signature: /TestEnumClass.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnumClass#toString(){} + // Public signature: /TestEnumClass.toString|-1522858123163872138[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestEnumClass#toString(){}kotlin.String + // Public signature: /TestEnumClass.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnumClass#static{}entries + // Public signature: /TestEnumClass.entries|-5134227801081826149[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: TestEnumClass#static{}entries + // Public signature: /TestEnumClass.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: TestEnumClass##static(){}kotlin.enums.EnumEntries + // Public signature: /TestEnumClass.entries.|-5859730592340272958[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnumClass{}name + // Public signature: /TestEnumClass.name|4231860309499509769[0] + get(): EnumEntries + + // CHECK: + // Mangled name: TestEnumClass{}name + // Public signature: /TestEnumClass.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: TestEnumClass#(){}kotlin.String + // Public signature: /TestEnumClass.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnumClass{}ordinal + // Public signature: /TestEnumClass.ordinal|1912745122988592376[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: TestEnumClass{}ordinal + // Public signature: /TestEnumClass.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: TestEnumClass#(){}kotlin.Int + // Public signature: /TestEnumClass.ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestInterface + // Public signature: /TestInterface|null[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: TestInterface +// Public signature: /TestInterface|null[0] +interface TestInterface { + +} + +// CHECK: +// Mangled name: TestObject +// Public signature: /TestObject|null[0] +object TestObject { + // CHECK: + // Mangled name: TestObject#(){} + // Public signature: /TestObject.|-5645683436151566731[0] + private constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/classes/cloneable.sig.kt.txt b/compiler/testData/ir/irText/classes/cloneable.sig.kt.txt new file mode 100644 index 00000000000..5a27d888f34 --- /dev/null +++ b/compiler/testData/ir/irText/classes/cloneable.sig.kt.txt @@ -0,0 +1,69 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A : Cloneable { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + // CHECK JVM_IR: + // Mangled name: A#clone(){}kotlin.Any + // Public signature: /A.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#clone(){} + // Public signature: /A.clone|-2406852056970293187[0] + protected /* fake */ override fun clone(): Any + +} + +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C : I { + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() /* primary */ + // CHECK JVM_IR: + // Mangled name: C#clone(){}kotlin.Any + // Public signature: /C.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#clone(){} + // Public signature: /C.clone|-2406852056970293187[0] + protected /* fake */ override fun clone(): Any + +} + +// CHECK: +// Mangled name: OC +// Public signature: /OC|null[0] +class OC : I { + // CHECK: + // Mangled name: OC#(){} + // Public signature: /OC.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: OC#clone(){}OC + // Public signature: /OC.clone|8389954697594281582[0] + // CHECK JS_IR NATIVE: + // Mangled name: OC#clone(){} + // Public signature: /OC.clone|-2406852056970293187[0] + protected override fun clone(): OC + +} + +// CHECK: +// Mangled name: I +// Public signature: /I|null[0] +interface I : Cloneable { + // CHECK JVM_IR: + // Mangled name: I#clone(){}kotlin.Any + // Public signature: /I.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: I#clone(){} + // Public signature: /I.clone|-2406852056970293187[0] + protected /* fake */ override fun clone(): Any + +} + diff --git a/compiler/testData/ir/irText/classes/companionObject.sig.kt.txt b/compiler/testData/ir/irText/classes/companionObject.sig.kt.txt new file mode 100644 index 00000000000..d249341cb35 --- /dev/null +++ b/compiler/testData/ir/irText/classes/companionObject.sig.kt.txt @@ -0,0 +1,44 @@ +// CHECK: +// Mangled name: Test1 +// Public signature: /Test1|null[0] +class Test1 { + // CHECK: + // Mangled name: Test1.Companion + // Public signature: /Test1.Companion|null[0] + companion object Companion { + // CHECK: + // Mangled name: Test1.Companion#(){} + // Public signature: /Test1.Companion.|-5645683436151566731[0] + private constructor() /* primary */ + + } + + // CHECK: + // Mangled name: Test1#(){} + // Public signature: /Test1.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: Test2 +// Public signature: /Test2|null[0] +class Test2 { + // CHECK: + // Mangled name: Test2.Named + // Public signature: /Test2.Named|null[0] + companion object Named { + // CHECK: + // Mangled name: Test2.Named#(){} + // Public signature: /Test2.Named.|-5645683436151566731[0] + private constructor() /* primary */ + + } + + // CHECK: + // Mangled name: Test2#(){} + // Public signature: /Test2.|-5645683436151566731[0] + constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.kt b/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.kt index 8a8663dfd93..8d2d71e7d5d 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.kt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.kt @@ -1,3 +1,6 @@ +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR +// ^ KT-57429 + data class Test1( val stringArray: Array, val charArray: CharArray, @@ -16,4 +19,4 @@ data class Test2( data class Test3( val anyArrayN: Array? -) \ No newline at end of file +) diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.sig.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.sig.kt.txt new file mode 100644 index 00000000000..4a2ae1720ae --- /dev/null +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.sig.kt.txt @@ -0,0 +1,346 @@ +// CHECK: +// Mangled name: Test1 +// Public signature: /Test1|null[0] +data class Test1 { + // CHECK: + // Mangled name: Test1{}stringArray + // Public signature: /Test1.stringArray|3224078221487065108[0] + val stringArray: Array + // CHECK JVM_IR: + // Mangled name: Test1#(){}kotlin.Array + // Public signature: /Test1.stringArray.|3372814522015375360[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.stringArray.|-999420313937698549[0] + get + + // CHECK: + // Mangled name: Test1{}charArray + // Public signature: /Test1.charArray|-5349931751208968301[0] + val charArray: CharArray + // CHECK JVM_IR: + // Mangled name: Test1#(){}kotlin.CharArray + // Public signature: /Test1.charArray.|-3365262090570994726[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.charArray.|-8841051727055591008[0] + get + + // CHECK: + // Mangled name: Test1{}booleanArray + // Public signature: /Test1.booleanArray|7605527965651232515[0] + val booleanArray: BooleanArray + // CHECK JVM_IR: + // Mangled name: Test1#(){}kotlin.BooleanArray + // Public signature: /Test1.booleanArray.|-2975190751408552199[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.booleanArray.|-1483974669542225092[0] + get + + // CHECK: + // Mangled name: Test1{}byteArray + // Public signature: /Test1.byteArray|-2314777124899298189[0] + val byteArray: ByteArray + // CHECK JVM_IR: + // Mangled name: Test1#(){}kotlin.ByteArray + // Public signature: /Test1.byteArray.|-4531821776506226927[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.byteArray.|1184466848294423218[0] + get + + // CHECK: + // Mangled name: Test1{}shortArray + // Public signature: /Test1.shortArray|3516401755230006906[0] + val shortArray: ShortArray + // CHECK JVM_IR: + // Mangled name: Test1#(){}kotlin.ShortArray + // Public signature: /Test1.shortArray.|3616346085964569365[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.shortArray.|6916129091578524572[0] + get + + // CHECK: + // Mangled name: Test1{}intArray + // Public signature: /Test1.intArray|-5845507301569286943[0] + val intArray: IntArray + // CHECK JVM_IR: + // Mangled name: Test1#(){}kotlin.IntArray + // Public signature: /Test1.intArray.|540017735713660266[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.intArray.|8581538667026869746[0] + get + + // CHECK: + // Mangled name: Test1{}longArray + // Public signature: /Test1.longArray|-261136028309834719[0] + val longArray: LongArray + // CHECK JVM_IR: + // Mangled name: Test1#(){}kotlin.LongArray + // Public signature: /Test1.longArray.|-1197859177727725361[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.longArray.|7513485594208747900[0] + get + + // CHECK: + // Mangled name: Test1{}floatArray + // Public signature: /Test1.floatArray|-863616440006860352[0] + val floatArray: FloatArray + // CHECK JVM_IR: + // Mangled name: Test1#(){}kotlin.FloatArray + // Public signature: /Test1.floatArray.|379636537041432797[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.floatArray.|-7251674888770048121[0] + get + + // CHECK: + // Mangled name: Test1{}doubleArray + // Public signature: /Test1.doubleArray|-3027997348205759511[0] + val doubleArray: DoubleArray + // CHECK JVM_IR: + // Mangled name: Test1#(){}kotlin.DoubleArray + // Public signature: /Test1.doubleArray.|5171225634314785003[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.doubleArray.|-8332107536960256489[0] + get + + // CHECK: + // Mangled name: Test1#(kotlin.Array;kotlin.CharArray;kotlin.BooleanArray;kotlin.ByteArray;kotlin.ShortArray;kotlin.IntArray;kotlin.LongArray;kotlin.FloatArray;kotlin.DoubleArray){} + // Public signature: /Test1.|-2901047261480922149[0] + constructor(stringArray: Array, charArray: CharArray, booleanArray: BooleanArray, byteArray: ByteArray, shortArray: ShortArray, intArray: IntArray, longArray: LongArray, floatArray: FloatArray, doubleArray: DoubleArray) /* primary */ + // CHECK JVM_IR: + // Mangled name: Test1#component1(){}kotlin.Array + // Public signature: /Test1.component1|2673462985803256369[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#component1(){} + // Public signature: /Test1.component1|162597135895221648[0] + operator fun component1(): Array + + // CHECK JVM_IR: + // Mangled name: Test1#component2(){}kotlin.CharArray + // Public signature: /Test1.component2|-8172205221988991671[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#component2(){} + // Public signature: /Test1.component2|3796717572321500973[0] + operator fun component2(): CharArray + + // CHECK JVM_IR: + // Mangled name: Test1#component3(){}kotlin.BooleanArray + // Public signature: /Test1.component3|8179741844146192752[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#component3(){} + // Public signature: /Test1.component3|-7448948688383327918[0] + operator fun component3(): BooleanArray + + // CHECK JVM_IR: + // Mangled name: Test1#component4(){}kotlin.ByteArray + // Public signature: /Test1.component4|-1739414106658456946[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#component4(){} + // Public signature: /Test1.component4|-5228865120014592696[0] + operator fun component4(): ByteArray + + // CHECK JVM_IR: + // Mangled name: Test1#component5(){}kotlin.ShortArray + // Public signature: /Test1.component5|-3423229537519330548[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#component5(){} + // Public signature: /Test1.component5|-6761990273390998797[0] + operator fun component5(): ShortArray + + // CHECK JVM_IR: + // Mangled name: Test1#component6(){}kotlin.IntArray + // Public signature: /Test1.component6|-2300576074023927975[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#component6(){} + // Public signature: /Test1.component6|-341469160952212663[0] + operator fun component6(): IntArray + + // CHECK JVM_IR: + // Mangled name: Test1#component7(){}kotlin.LongArray + // Public signature: /Test1.component7|-867169008637195949[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#component7(){} + // Public signature: /Test1.component7|-5566060557311180434[0] + operator fun component7(): LongArray + + // CHECK JVM_IR: + // Mangled name: Test1#component8(){}kotlin.FloatArray + // Public signature: /Test1.component8|4154428752572134259[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#component8(){} + // Public signature: /Test1.component8|-536160406046914439[0] + operator fun component8(): FloatArray + + // CHECK JVM_IR: + // Mangled name: Test1#component9(){}kotlin.DoubleArray + // Public signature: /Test1.component9|-6146261915259686298[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#component9(){} + // Public signature: /Test1.component9|4077304044778180766[0] + operator fun component9(): DoubleArray + + // CHECK JVM_IR: + // Mangled name: Test1#copy(kotlin.Array;kotlin.CharArray;kotlin.BooleanArray;kotlin.ByteArray;kotlin.ShortArray;kotlin.IntArray;kotlin.LongArray;kotlin.FloatArray;kotlin.DoubleArray){}Test1 + // Public signature: /Test1.copy|3580547657034916048[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#copy(kotlin.Array;kotlin.CharArray;kotlin.BooleanArray;kotlin.ByteArray;kotlin.ShortArray;kotlin.IntArray;kotlin.LongArray;kotlin.FloatArray;kotlin.DoubleArray){} + // Public signature: /Test1.copy|-3582680923088795384[0] + fun copy(stringArray: Array, charArray: CharArray, booleanArray: BooleanArray, byteArray: ByteArray, shortArray: ShortArray, intArray: IntArray, longArray: LongArray, floatArray: FloatArray, doubleArray: DoubleArray): Test1 + + // CHECK JVM_IR: + // Mangled name: Test1#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Test1.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#equals(kotlin.Any?){} + // Public signature: /Test1.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Test1#hashCode(){}kotlin.Int + // Public signature: /Test1.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#hashCode(){} + // Public signature: /Test1.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Test1#toString(){}kotlin.String + // Public signature: /Test1.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#toString(){} + // Public signature: /Test1.toString|-1522858123163872138[0] + override fun toString(): String + +} + +// CHECK: +// Mangled name: Test2 +// Public signature: /Test2|null[0] +data class Test2 { + // CHECK: + // Mangled name: Test2{}genericArray + // Public signature: /Test2.genericArray|-3006201342680303597[0] + val genericArray: Array + // CHECK JVM_IR: + // Mangled name: Test2#(){}kotlin.Array<1:0> + // Public signature: /Test2.genericArray.|-887796497194881267[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#(){} + // Public signature: /Test2.genericArray.|-4084285588594711286[0] + get + + // CHECK: + // Mangled name: Test2#(kotlin.Array<1:0>){} + // Public signature: /Test2.|-6569388914691766420[0] + constructor(genericArray: Array) /* primary */ + // CHECK JVM_IR: + // Mangled name: Test2#component1(){}kotlin.Array<1:0> + // Public signature: /Test2.component1|-8550302254215159930[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#component1(){} + // Public signature: /Test2.component1|162597135895221648[0] + operator fun component1(): Array + + // CHECK JVM_IR: + // Mangled name: Test2#copy(kotlin.Array<1:0>){}Test2<1:0> + // Public signature: /Test2.copy|-4093092771055361563[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#copy(kotlin.Array<1:0>){} + // Public signature: /Test2.copy|-4145030177598586254[0] + fun copy(genericArray: Array): Test2 + + // CHECK JVM_IR: + // Mangled name: Test2#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Test2.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#equals(kotlin.Any?){} + // Public signature: /Test2.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Test2#hashCode(){}kotlin.Int + // Public signature: /Test2.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#hashCode(){} + // Public signature: /Test2.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Test2#toString(){}kotlin.String + // Public signature: /Test2.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#toString(){} + // Public signature: /Test2.toString|-1522858123163872138[0] + override fun toString(): String + +} + +// CHECK: +// Mangled name: Test3 +// Public signature: /Test3|null[0] +data class Test3 { + // CHECK: + // Mangled name: Test3{}anyArrayN + // Public signature: /Test3.anyArrayN|-3755548963031234944[0] + val anyArrayN: Array? + // CHECK JVM_IR: + // Mangled name: Test3#(){}kotlin.Array? + // Public signature: /Test3.anyArrayN.|1018695805048889237[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#(){} + // Public signature: /Test3.anyArrayN.|7972114620855000537[0] + get + + // CHECK: + // Mangled name: Test3#(kotlin.Array?){} + // Public signature: /Test3.|2034455610636948474[0] + constructor(anyArrayN: Array?) /* primary */ + // CHECK JVM_IR: + // Mangled name: Test3#component1(){}kotlin.Array? + // Public signature: /Test3.component1|3443609172722853741[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#component1(){} + // Public signature: /Test3.component1|162597135895221648[0] + operator fun component1(): Array? + + // CHECK JVM_IR: + // Mangled name: Test3#copy(kotlin.Array?){}Test3 + // Public signature: /Test3.copy|-3165504510354767753[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#copy(kotlin.Array?){} + // Public signature: /Test3.copy|2372396661078018499[0] + fun copy(anyArrayN: Array?): Test3 + + // CHECK JVM_IR: + // Mangled name: Test3#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Test3.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#equals(kotlin.Any?){} + // Public signature: /Test3.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Test3#hashCode(){}kotlin.Int + // Public signature: /Test3.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#hashCode(){} + // Public signature: /Test3.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Test3#toString(){}kotlin.String + // Public signature: /Test3.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#toString(){} + // Public signature: /Test3.toString|-1522858123163872138[0] + override fun toString(): String + +} + diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClasses.sig.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/dataClasses.sig.kt.txt new file mode 100644 index 00000000000..43a31fe520e --- /dev/null +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClasses.sig.kt.txt @@ -0,0 +1,286 @@ +// CHECK: +// Mangled name: Test1 +// Public signature: /Test1|null[0] +data class Test1 { + // CHECK: + // Mangled name: Test1{}x + // Public signature: /Test1.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: Test1#(){}kotlin.Int + // Public signature: /Test1.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Test1{}y + // Public signature: /Test1.y|3625903257357557171[0] + val y: String + // CHECK JVM_IR: + // Mangled name: Test1#(){}kotlin.String + // Public signature: /Test1.y.|1760775372995524147[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.y.|-7902422373892128922[0] + get + + // CHECK: + // Mangled name: Test1{}z + // Public signature: /Test1.z|7549650372729116193[0] + val z: Any + // CHECK JVM_IR: + // Mangled name: Test1#(){}kotlin.Any + // Public signature: /Test1.z.|3264772919715209875[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.z.|4925813204745917177[0] + get + + // CHECK: + // Mangled name: Test1#(kotlin.Int;kotlin.String;kotlin.Any){} + // Public signature: /Test1.|3237794121889594884[0] + constructor(x: Int, y: String, z: Any) /* primary */ + // CHECK JVM_IR: + // Mangled name: Test1#component1(){}kotlin.Int + // Public signature: /Test1.component1|-8217597213800111288[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#component1(){} + // Public signature: /Test1.component1|162597135895221648[0] + operator fun component1(): Int + + // CHECK JVM_IR: + // Mangled name: Test1#component2(){}kotlin.String + // Public signature: /Test1.component2|1228864375093914597[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#component2(){} + // Public signature: /Test1.component2|3796717572321500973[0] + operator fun component2(): String + + // CHECK JVM_IR: + // Mangled name: Test1#component3(){}kotlin.Any + // Public signature: /Test1.component3|-8402360621236361298[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#component3(){} + // Public signature: /Test1.component3|-7448948688383327918[0] + operator fun component3(): Any + + // CHECK JVM_IR: + // Mangled name: Test1#copy(kotlin.Int;kotlin.String;kotlin.Any){}Test1 + // Public signature: /Test1.copy|9126311422094034907[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#copy(kotlin.Int;kotlin.String;kotlin.Any){} + // Public signature: /Test1.copy|1970049041797344002[0] + fun copy(x: Int, y: String, z: Any): Test1 + + // CHECK JVM_IR: + // Mangled name: Test1#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Test1.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#equals(kotlin.Any?){} + // Public signature: /Test1.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Test1#hashCode(){}kotlin.Int + // Public signature: /Test1.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#hashCode(){} + // Public signature: /Test1.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Test1#toString(){}kotlin.String + // Public signature: /Test1.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#toString(){} + // Public signature: /Test1.toString|-1522858123163872138[0] + override fun toString(): String + +} + +// CHECK: +// Mangled name: Test2 +// Public signature: /Test2|null[0] +data class Test2 { + // CHECK: + // Mangled name: Test2{}x + // Public signature: /Test2.x|-8060530855978347579[0] + val x: Any? + // CHECK JVM_IR: + // Mangled name: Test2#(){}kotlin.Any? + // Public signature: /Test2.x.|4529939993405876842[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#(){} + // Public signature: /Test2.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Test2#(kotlin.Any?){} + // Public signature: /Test2.|-8205545948568413246[0] + constructor(x: Any?) /* primary */ + // CHECK JVM_IR: + // Mangled name: Test2#component1(){}kotlin.Any? + // Public signature: /Test2.component1|-9062417290864755441[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#component1(){} + // Public signature: /Test2.component1|162597135895221648[0] + operator fun component1(): Any? + + // CHECK JVM_IR: + // Mangled name: Test2#copy(kotlin.Any?){}Test2 + // Public signature: /Test2.copy|6930260054694985237[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#copy(kotlin.Any?){} + // Public signature: /Test2.copy|4356513146641810493[0] + fun copy(x: Any?): Test2 + + // CHECK JVM_IR: + // Mangled name: Test2#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Test2.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#equals(kotlin.Any?){} + // Public signature: /Test2.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Test2#hashCode(){}kotlin.Int + // Public signature: /Test2.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#hashCode(){} + // Public signature: /Test2.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Test2#toString(){}kotlin.String + // Public signature: /Test2.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#toString(){} + // Public signature: /Test2.toString|-1522858123163872138[0] + override fun toString(): String + +} + +// CHECK: +// Mangled name: Test3 +// Public signature: /Test3|null[0] +data class Test3 { + // CHECK: + // Mangled name: Test3{}d + // Public signature: /Test3.d|5174763769109925331[0] + val d: Double + // CHECK JVM_IR: + // Mangled name: Test3#(){}kotlin.Double + // Public signature: /Test3.d.|-5403877192080381201[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#(){} + // Public signature: /Test3.d.|-6701718004621354461[0] + get + + // CHECK: + // Mangled name: Test3{}dn + // Public signature: /Test3.dn|-2746901618144580958[0] + val dn: Double? + // CHECK JVM_IR: + // Mangled name: Test3#(){}kotlin.Double? + // Public signature: /Test3.dn.|-6168917619305056925[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#(){} + // Public signature: /Test3.dn.|2804503042141689390[0] + get + + // CHECK: + // Mangled name: Test3{}f + // Public signature: /Test3.f|4026638760133205152[0] + val f: Float + // CHECK JVM_IR: + // Mangled name: Test3#(){}kotlin.Float + // Public signature: /Test3.f.|6014982203170860581[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#(){} + // Public signature: /Test3.f.|2894053160377864677[0] + get + + // CHECK: + // Mangled name: Test3{}df + // Public signature: /Test3.df|8501496894035980235[0] + val df: Float? + // CHECK JVM_IR: + // Mangled name: Test3#(){}kotlin.Float? + // Public signature: /Test3.df.|-3259181884204926150[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#(){} + // Public signature: /Test3.df.|23337897124649238[0] + get + + // CHECK: + // Mangled name: Test3#(kotlin.Double;kotlin.Double?;kotlin.Float;kotlin.Float?){} + // Public signature: /Test3.|8878758829470622568[0] + constructor(d: Double, dn: Double?, f: Float, df: Float?) /* primary */ + // CHECK JVM_IR: + // Mangled name: Test3#component1(){}kotlin.Double + // Public signature: /Test3.component1|2948120330742694173[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#component1(){} + // Public signature: /Test3.component1|162597135895221648[0] + operator fun component1(): Double + + // CHECK JVM_IR: + // Mangled name: Test3#component2(){}kotlin.Double? + // Public signature: /Test3.component2|-4142687720775551365[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#component2(){} + // Public signature: /Test3.component2|3796717572321500973[0] + operator fun component2(): Double? + + // CHECK JVM_IR: + // Mangled name: Test3#component3(){}kotlin.Float + // Public signature: /Test3.component3|-7671183964878043859[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#component3(){} + // Public signature: /Test3.component3|-7448948688383327918[0] + operator fun component3(): Float + + // CHECK JVM_IR: + // Mangled name: Test3#component4(){}kotlin.Float? + // Public signature: /Test3.component4|-5678719099315503302[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#component4(){} + // Public signature: /Test3.component4|-5228865120014592696[0] + operator fun component4(): Float? + + // CHECK JVM_IR: + // Mangled name: Test3#copy(kotlin.Double;kotlin.Double?;kotlin.Float;kotlin.Float?){}Test3 + // Public signature: /Test3.copy|-4127117122996434411[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#copy(kotlin.Double;kotlin.Double?;kotlin.Float;kotlin.Float?){} + // Public signature: /Test3.copy|-125565994452859048[0] + fun copy(d: Double, dn: Double?, f: Float, df: Float?): Test3 + + // CHECK JVM_IR: + // Mangled name: Test3#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Test3.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#equals(kotlin.Any?){} + // Public signature: /Test3.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Test3#hashCode(){}kotlin.Int + // Public signature: /Test3.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#hashCode(){} + // Public signature: /Test3.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Test3#toString(){}kotlin.String + // Public signature: /Test3.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#toString(){} + // Public signature: /Test3.toString|-1522858123163872138[0] + override fun toString(): String + +} + diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.kt b/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.kt index 4e2693ec2d2..0d47797dcac 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.kt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.kt @@ -1,7 +1,10 @@ +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR +// ^ KT-57429 + data class Test1(val x: T) data class Test2(val x: T) data class Test3(val x: List) -data class Test4(val x: List) \ No newline at end of file +data class Test4(val x: List) diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.sig.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.sig.kt.txt new file mode 100644 index 00000000000..e4fbbc30b9f --- /dev/null +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.sig.kt.txt @@ -0,0 +1,248 @@ +// CHECK: +// Mangled name: Test1 +// Public signature: /Test1|null[0] +data class Test1 { + // CHECK: + // Mangled name: Test1{}x + // Public signature: /Test1.x|-8060530855978347579[0] + val x: T + // CHECK JVM_IR: + // Mangled name: Test1#(){}1:0 + // Public signature: /Test1.x.|-8893883356128097563[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Test1#(1:0){} + // Public signature: /Test1.|-8731461708390519279[0] + constructor(x: T) /* primary */ + // CHECK JVM_IR: + // Mangled name: Test1#component1(){}1:0 + // Public signature: /Test1.component1|2393470133763651536[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#component1(){} + // Public signature: /Test1.component1|162597135895221648[0] + operator fun component1(): T + + // CHECK JVM_IR: + // Mangled name: Test1#copy(1:0){}Test1<1:0> + // Public signature: /Test1.copy|-3829390724189512274[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#copy(1:0){} + // Public signature: /Test1.copy|3824555624975687868[0] + fun copy(x: T): Test1 + + // CHECK JVM_IR: + // Mangled name: Test1#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Test1.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#equals(kotlin.Any?){} + // Public signature: /Test1.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Test1#hashCode(){}kotlin.Int + // Public signature: /Test1.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#hashCode(){} + // Public signature: /Test1.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Test1#toString(){}kotlin.String + // Public signature: /Test1.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#toString(){} + // Public signature: /Test1.toString|-1522858123163872138[0] + override fun toString(): String + +} + +// CHECK: +// Mangled name: Test2 +// Public signature: /Test2|null[0] +data class Test2 { + // CHECK: + // Mangled name: Test2{}x + // Public signature: /Test2.x|-8060530855978347579[0] + val x: T + // CHECK JVM_IR: + // Mangled name: Test2#(){}1:0 + // Public signature: /Test2.x.|-8893883356128097563[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#(){} + // Public signature: /Test2.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Test2#(1:0){} + // Public signature: /Test2.|-8731461708390519279[0] + constructor(x: T) /* primary */ + // CHECK JVM_IR: + // Mangled name: Test2#component1(){}1:0 + // Public signature: /Test2.component1|2393470133763651536[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#component1(){} + // Public signature: /Test2.component1|162597135895221648[0] + operator fun component1(): T + + // CHECK JVM_IR: + // Mangled name: Test2#copy(1:0){}Test2<1:0> + // Public signature: /Test2.copy|6320544838333919124[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#copy(1:0){} + // Public signature: /Test2.copy|3824555624975687868[0] + fun copy(x: T): Test2 + + // CHECK JVM_IR: + // Mangled name: Test2#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Test2.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#equals(kotlin.Any?){} + // Public signature: /Test2.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Test2#hashCode(){}kotlin.Int + // Public signature: /Test2.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#hashCode(){} + // Public signature: /Test2.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Test2#toString(){}kotlin.String + // Public signature: /Test2.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#toString(){} + // Public signature: /Test2.toString|-1522858123163872138[0] + override fun toString(): String + +} + +// CHECK: +// Mangled name: Test3 +// Public signature: /Test3|null[0] +data class Test3 { + // CHECK: + // Mangled name: Test3{}x + // Public signature: /Test3.x|-8060530855978347579[0] + val x: List + // CHECK JVM_IR: + // Mangled name: Test3#(){}kotlin.collections.List<1:0> + // Public signature: /Test3.x.|-8777382765774009671[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#(){} + // Public signature: /Test3.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Test3#(kotlin.collections.List<1:0>){} + // Public signature: /Test3.|-6703374673612964420[0] + constructor(x: List) /* primary */ + // CHECK JVM_IR: + // Mangled name: Test3#component1(){}kotlin.collections.List<1:0> + // Public signature: /Test3.component1|-4141154284195946749[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#component1(){} + // Public signature: /Test3.component1|162597135895221648[0] + operator fun component1(): List + + // CHECK JVM_IR: + // Mangled name: Test3#copy(kotlin.collections.List<1:0>){}Test3<1:0> + // Public signature: /Test3.copy|-1250137760207177088[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#copy(kotlin.collections.List<1:0>){} + // Public signature: /Test3.copy|9161286063615545697[0] + fun copy(x: List): Test3 + + // CHECK JVM_IR: + // Mangled name: Test3#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Test3.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#equals(kotlin.Any?){} + // Public signature: /Test3.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Test3#hashCode(){}kotlin.Int + // Public signature: /Test3.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#hashCode(){} + // Public signature: /Test3.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Test3#toString(){}kotlin.String + // Public signature: /Test3.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#toString(){} + // Public signature: /Test3.toString|-1522858123163872138[0] + override fun toString(): String + +} + +// CHECK: +// Mangled name: Test4 +// Public signature: /Test4|null[0] +data class Test4 { + // CHECK: + // Mangled name: Test4{}x + // Public signature: /Test4.x|-8060530855978347579[0] + val x: List + // CHECK JVM_IR: + // Mangled name: Test4#(){}kotlin.collections.List + // Public signature: /Test4.x.|-612381453611729517[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test4#(){} + // Public signature: /Test4.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Test4#(kotlin.collections.List){} + // Public signature: /Test4.|-9211757031347255021[0] + constructor(x: List) /* primary */ + // CHECK JVM_IR: + // Mangled name: Test4#component1(){}kotlin.collections.List + // Public signature: /Test4.component1|-4918334505452908017[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test4#component1(){} + // Public signature: /Test4.component1|162597135895221648[0] + operator fun component1(): List + + // CHECK JVM_IR: + // Mangled name: Test4#copy(kotlin.collections.List){}Test4 + // Public signature: /Test4.copy|8976360980800871723[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test4#copy(kotlin.collections.List){} + // Public signature: /Test4.copy|8294748365935686629[0] + fun copy(x: List): Test4 + + // CHECK JVM_IR: + // Mangled name: Test4#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Test4.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test4#equals(kotlin.Any?){} + // Public signature: /Test4.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Test4#hashCode(){}kotlin.Int + // Public signature: /Test4.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test4#hashCode(){} + // Public signature: /Test4.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Test4#toString(){}kotlin.String + // Public signature: /Test4.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test4#toString(){} + // Public signature: /Test4.toString|-1522858123163872138[0] + override fun toString(): String + +} + diff --git a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.sig.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.sig.kt.txt new file mode 100644 index 00000000000..1d268b5c58b --- /dev/null +++ b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.sig.kt.txt @@ -0,0 +1,129 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +sealed class A : CharSequence { + // CHECK: + // Mangled name: A.B + // Public signature: /A.B|null[0] + data class B : A, CharSequence { + // CHECK: + // Mangled name: A.B{}c + // Public signature: /A.B.c|-4416962153448040627[0] + val c: CharSequence + // CHECK JVM_IR: + // Mangled name: A.B#(){}kotlin.CharSequence + // Public signature: /A.B.c.|7304122790316032774[0] + // CHECK JS_IR NATIVE: + // Mangled name: A.B#(){} + // Public signature: /A.B.c.|2368736057102379596[0] + get + + // CHECK: + // Mangled name: A.B#(kotlin.CharSequence){} + // Public signature: /A.B.|2804354480087813081[0] + constructor(c: CharSequence) /* primary */ + // CHECK JVM_IR: + // Mangled name: A.B#get(kotlin.Int){}kotlin.Char + // Public signature: /A.B.get|6519934306502810002[0] + // CHECK JS_IR NATIVE: + // Mangled name: A.B#get(kotlin.Int){} + // Public signature: /A.B.get|-1406503945102116889[0] + override operator fun get(index: Int): Char + + // CHECK JVM_IR: + // Mangled name: A.B#subSequence(kotlin.Int;kotlin.Int){}kotlin.CharSequence + // Public signature: /A.B.subSequence|7954975239934934955[0] + // CHECK JS_IR NATIVE: + // Mangled name: A.B#subSequence(kotlin.Int;kotlin.Int){} + // Public signature: /A.B.subSequence|-1845048848187925290[0] + override fun subSequence(startIndex: Int, endIndex: Int): CharSequence + + // CHECK JVM_IR: + // Mangled name: A.B#component1(){}kotlin.CharSequence + // Public signature: /A.B.component1|3907327938938556754[0] + // CHECK JS_IR NATIVE: + // Mangled name: A.B#component1(){} + // Public signature: /A.B.component1|162597135895221648[0] + operator fun component1(): CharSequence + + // CHECK JVM_IR: + // Mangled name: A.B#copy(kotlin.CharSequence){}A.B + // Public signature: /A.B.copy|-126682590898406005[0] + // CHECK JS_IR NATIVE: + // Mangled name: A.B#copy(kotlin.CharSequence){} + // Public signature: /A.B.copy|4084600718380071781[0] + fun copy(c: CharSequence): B + + // CHECK JVM_IR: + // Mangled name: A.B#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /A.B.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: A.B#equals(kotlin.Any?){} + // Public signature: /A.B.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: A.B#hashCode(){}kotlin.Int + // Public signature: /A.B.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: A.B#hashCode(){} + // Public signature: /A.B.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: A.B#toString(){}kotlin.String + // Public signature: /A.B.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: A.B#toString(){} + // Public signature: /A.B.toString|-1522858123163872138[0] + override fun toString(): String + + // CHECK: + // Mangled name: A.B{}length + // Public signature: /A.B.length|8693345930578737573[0] + override val length: Int + // CHECK JVM_IR: + // Mangled name: A.B#(){}kotlin.Int + // Public signature: /A.B.length.|2176130084070422186[0] + // CHECK JS_IR NATIVE: + // Mangled name: A.B#(){} + // Public signature: /A.B.length.|-602852775465059526[0] + override get(): Int + + } + + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + protected constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: A#get(kotlin.Int){}kotlin.Char + // Public signature: /A.get|6519934306502810002[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#get(kotlin.Int){} + // Public signature: /A.get|-1406503945102116889[0] + abstract /* fake */ override operator fun get(index: Int): Char + + // CHECK JVM_IR: + // Mangled name: A#subSequence(kotlin.Int;kotlin.Int){}kotlin.CharSequence + // Public signature: /A.subSequence|7954975239934934955[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#subSequence(kotlin.Int;kotlin.Int){} + // Public signature: /A.subSequence|-1845048848187925290[0] + abstract /* fake */ override fun subSequence(startIndex: Int, endIndex: Int): CharSequence + + // CHECK: + // Mangled name: A{}length + // Public signature: /A.length|8693345930578737573[0] + abstract /* fake */ override val length: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.length.|2176130084070422186[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.length.|-602852775465059526[0] + abstract /* fake */ override get(): Int + +} + diff --git a/compiler/testData/ir/irText/classes/dataClasses/kt31649.sig.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/kt31649.sig.kt.txt new file mode 100644 index 00000000000..c68bcbbdb08 --- /dev/null +++ b/compiler/testData/ir/irText/classes/dataClasses/kt31649.sig.kt.txt @@ -0,0 +1,108 @@ +// CHECK: +// Mangled name: TestData +// Public signature: /TestData|null[0] +data class TestData { + // CHECK: + // Mangled name: TestData{}nn + // Public signature: /TestData.nn|4910025065134137180[0] + val nn: Nothing? + // CHECK JVM_IR: + // Mangled name: TestData#(){}kotlin.Nothing? + // Public signature: /TestData.nn.|-7894820649903816930[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestData#(){} + // Public signature: /TestData.nn.|-7268942028409156247[0] + get + + // CHECK: + // Mangled name: TestData#(kotlin.Nothing?){} + // Public signature: /TestData.|-7885966204384349687[0] + constructor(nn: Nothing?) /* primary */ + // CHECK JVM_IR: + // Mangled name: TestData#component1(){}kotlin.Nothing? + // Public signature: /TestData.component1|137173073680766068[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestData#component1(){} + // Public signature: /TestData.component1|162597135895221648[0] + operator fun component1(): Nothing? + + // CHECK JVM_IR: + // Mangled name: TestData#copy(kotlin.Nothing?){}TestData + // Public signature: /TestData.copy|-7161493903224753726[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestData#copy(kotlin.Nothing?){} + // Public signature: /TestData.copy|1980693645743259965[0] + fun copy(nn: Nothing?): TestData + + // CHECK JVM_IR: + // Mangled name: TestData#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestData.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestData#equals(kotlin.Any?){} + // Public signature: /TestData.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: TestData#hashCode(){}kotlin.Int + // Public signature: /TestData.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestData#hashCode(){} + // Public signature: /TestData.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestData#toString(){}kotlin.String + // Public signature: /TestData.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestData#toString(){} + // Public signature: /TestData.toString|-1522858123163872138[0] + override fun toString(): String + +} + +// CHECK: +// Mangled name: TestInline +// Public signature: /TestInline|null[0] +value class TestInline { + // CHECK: + // Mangled name: TestInline{}nn + // Public signature: /TestInline.nn|4910025065134137180[0] + val nn: Nothing? + // CHECK JVM_IR: + // Mangled name: TestInline#(){}kotlin.Nothing? + // Public signature: /TestInline.nn.|-7894820649903816930[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestInline#(){} + // Public signature: /TestInline.nn.|-7268942028409156247[0] + get + + // CHECK: + // Mangled name: TestInline#(kotlin.Nothing?){} + // Public signature: /TestInline.|-7885966204384349687[0] + constructor(nn: Nothing?) /* primary */ + // CHECK JVM_IR: + // Mangled name: TestInline#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestInline.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestInline#equals(kotlin.Any?){} + // Public signature: /TestInline.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: TestInline#hashCode(){}kotlin.Int + // Public signature: /TestInline.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestInline#hashCode(){} + // Public signature: /TestInline.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestInline#toString(){}kotlin.String + // Public signature: /TestInline.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestInline#toString(){} + // Public signature: /TestInline.toString|-1522858123163872138[0] + override fun toString(): String + +} + diff --git a/compiler/testData/ir/irText/classes/dataClasses/kt49936.sig.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/kt49936.sig.kt.txt new file mode 100644 index 00000000000..6f60db3a8d0 --- /dev/null +++ b/compiler/testData/ir/irText/classes/dataClasses/kt49936.sig.kt.txt @@ -0,0 +1,74 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +data class A { + // CHECK: + // Mangled name: A{}x + // Public signature: /A.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: A#(kotlin.Int){} + // Public signature: /A.|-5182794243525578284[0] + constructor(x: Int) /* primary */ + // CHECK JVM_IR: + // Mangled name: A#component1(){}kotlin.Int + // Public signature: /A.component1|-8217597213800111288[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#component1(){} + // Public signature: /A.component1|162597135895221648[0] + operator fun component1(): Int + + // CHECK JVM_IR: + // Mangled name: A#copy(kotlin.Int){}A + // Public signature: /A.copy|6666966860941076951[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#copy(kotlin.Int){} + // Public signature: /A.copy|-6971662324481626298[0] + fun copy(x: Int): A + + // CHECK JVM_IR: + // Mangled name: A#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /A.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#equals(kotlin.Any?){} + // Public signature: /A.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: A#hashCode(){}kotlin.Int + // Public signature: /A.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#hashCode(){} + // Public signature: /A.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: A#toString(){}kotlin.String + // Public signature: /A.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#toString(){} + // Public signature: /A.toString|-1522858123163872138[0] + override fun toString(): String + + // CHECK: + // Mangled name: A@kotlin.String{}x + // Public signature: /A.x|6109279517766514877[0] + val String.x: String + // CHECK JVM_IR: + // Mangled name: A#@kotlin.String(){}kotlin.String + // Public signature: /A.x.|-8476749600808484511[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#@kotlin.String(){} + // Public signature: /A.x.|-862573950154384282[0] + get(): String + +} + diff --git a/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.sig.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.sig.kt.txt new file mode 100644 index 00000000000..6d10c807db3 --- /dev/null +++ b/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.sig.kt.txt @@ -0,0 +1,124 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +data class A { + // CHECK: + // Mangled name: A{}runA + // Public signature: /A.runA|-603860279021396892[0] + val runA: @ExtensionFunctionType Function2 + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Function2 + // Public signature: /A.runA.|-7395660359918443631[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.runA.|4133215680039513885[0] + get + + // CHECK: + // Mangled name: A#(kotlin.Function2){} + // Public signature: /A.|-2423641970729475329[0] + constructor(runA: @ExtensionFunctionType Function2) /* primary */ + // CHECK JVM_IR: + // Mangled name: A#component1(){}kotlin.Function2 + // Public signature: /A.component1|793860828130635274[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#component1(){} + // Public signature: /A.component1|162597135895221648[0] + operator fun component1(): @ExtensionFunctionType Function2 + + // CHECK JVM_IR: + // Mangled name: A#copy(kotlin.Function2){}A + // Public signature: /A.copy|7236950802229760509[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#copy(kotlin.Function2){} + // Public signature: /A.copy|-5890295070137205509[0] + fun copy(runA: @ExtensionFunctionType Function2): A + + // CHECK JVM_IR: + // Mangled name: A#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /A.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#equals(kotlin.Any?){} + // Public signature: /A.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: A#hashCode(){}kotlin.Int + // Public signature: /A.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#hashCode(){} + // Public signature: /A.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: A#toString(){}kotlin.String + // Public signature: /A.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#toString(){} + // Public signature: /A.toString|-1522858123163872138[0] + override fun toString(): String + +} + +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +data class B { + // CHECK: + // Mangled name: B{}x + // Public signature: /B.x|-8060530855978347579[0] + val x: Any + // CHECK JVM_IR: + // Mangled name: B#(){}kotlin.Any + // Public signature: /B.x.|98409022523676208[0] + // CHECK JS_IR NATIVE: + // Mangled name: B#(){} + // Public signature: /B.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: B#(kotlin.Any){} + // Public signature: /B.|4518179880532599055[0] + constructor(x: Any) /* primary */ + // CHECK JVM_IR: + // Mangled name: B#component1(){}kotlin.Any + // Public signature: /B.component1|2325042746135573536[0] + // CHECK JS_IR NATIVE: + // Mangled name: B#component1(){} + // Public signature: /B.component1|162597135895221648[0] + operator fun component1(): Any + + // CHECK JVM_IR: + // Mangled name: B#copy(kotlin.Any){}B + // Public signature: /B.copy|-4210150655908205808[0] + // CHECK JS_IR NATIVE: + // Mangled name: B#copy(kotlin.Any){} + // Public signature: /B.copy|-3313334438653353351[0] + fun copy(x: Any): B + + // CHECK JVM_IR: + // Mangled name: B#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /B.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: B#equals(kotlin.Any?){} + // Public signature: /B.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: B#hashCode(){}kotlin.Int + // Public signature: /B.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: B#hashCode(){} + // Public signature: /B.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: B#toString(){}kotlin.String + // Public signature: /B.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: B#toString(){} + // Public signature: /B.toString|-1522858123163872138[0] + override fun toString(): String + +} + diff --git a/compiler/testData/ir/irText/classes/dataClasses/openDataClass.sig.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/openDataClass.sig.kt.txt new file mode 100644 index 00000000000..e41892c3903 --- /dev/null +++ b/compiler/testData/ir/irText/classes/dataClasses/openDataClass.sig.kt.txt @@ -0,0 +1,82 @@ +// CHECK: +// Mangled name: ValidatedProperties +// Public signature: /ValidatedProperties|null[0] +open data class ValidatedProperties { + // CHECK: + // Mangled name: ValidatedProperties{}test1 + // Public signature: /ValidatedProperties.test1|6005685442305498193[0] + open val test1: String + // CHECK JVM_IR: + // Mangled name: ValidatedProperties#(){}kotlin.String + // Public signature: /ValidatedProperties.test1.|-7403750508378492770[0] + // CHECK JS_IR NATIVE: + // Mangled name: ValidatedProperties#(){} + // Public signature: /ValidatedProperties.test1.|-5735092642142423279[0] + open get + + // CHECK: + // Mangled name: ValidatedProperties{}test2 + // Public signature: /ValidatedProperties.test2|2517758057000911509[0] + open val test2: String + // CHECK JVM_IR: + // Mangled name: ValidatedProperties#(){}kotlin.String + // Public signature: /ValidatedProperties.test2.|-8062412501290172814[0] + // CHECK JS_IR NATIVE: + // Mangled name: ValidatedProperties#(){} + // Public signature: /ValidatedProperties.test2.|-5218942532816206869[0] + open get + + // CHECK: + // Mangled name: ValidatedProperties#(kotlin.String;kotlin.String){} + // Public signature: /ValidatedProperties.|9140439783797628932[0] + constructor(test1: String, test2: String) /* primary */ + // CHECK JVM_IR: + // Mangled name: ValidatedProperties#component1(){}kotlin.String + // Public signature: /ValidatedProperties.component1|-7481405593404337796[0] + // CHECK JS_IR NATIVE: + // Mangled name: ValidatedProperties#component1(){} + // Public signature: /ValidatedProperties.component1|162597135895221648[0] + operator fun component1(): String + + // CHECK JVM_IR: + // Mangled name: ValidatedProperties#component2(){}kotlin.String + // Public signature: /ValidatedProperties.component2|1228864375093914597[0] + // CHECK JS_IR NATIVE: + // Mangled name: ValidatedProperties#component2(){} + // Public signature: /ValidatedProperties.component2|3796717572321500973[0] + operator fun component2(): String + + // CHECK JVM_IR: + // Mangled name: ValidatedProperties#copy(kotlin.String;kotlin.String){}ValidatedProperties + // Public signature: /ValidatedProperties.copy|3682871900302910646[0] + // CHECK JS_IR NATIVE: + // Mangled name: ValidatedProperties#copy(kotlin.String;kotlin.String){} + // Public signature: /ValidatedProperties.copy|-7088139716016046259[0] + fun copy(test1: String, test2: String): ValidatedProperties + + // CHECK JVM_IR: + // Mangled name: ValidatedProperties#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /ValidatedProperties.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: ValidatedProperties#equals(kotlin.Any?){} + // Public signature: /ValidatedProperties.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: ValidatedProperties#hashCode(){}kotlin.Int + // Public signature: /ValidatedProperties.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: ValidatedProperties#hashCode(){} + // Public signature: /ValidatedProperties.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: ValidatedProperties#toString(){}kotlin.String + // Public signature: /ValidatedProperties.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: ValidatedProperties#toString(){} + // Public signature: /ValidatedProperties.toString|-1522858123163872138[0] + override fun toString(): String + +} + diff --git a/compiler/testData/ir/irText/classes/declarationOrder.sig.kt.txt b/compiler/testData/ir/irText/classes/declarationOrder.sig.kt.txt new file mode 100644 index 00000000000..d3fa1ce953d --- /dev/null +++ b/compiler/testData/ir/irText/classes/declarationOrder.sig.kt.txt @@ -0,0 +1,92 @@ +package test + +// CHECK: +// Mangled name: test.A +// Public signature: test/A|null[0] +class A { + // CHECK: + // Mangled name: test.A{}b + // Public signature: test/A.b|772347207915745207[0] + val b: Int + // CHECK JVM_IR: + // Mangled name: test.A#(){}kotlin.Int + // Public signature: test/A.b.|-2902143276921469679[0] + // CHECK JS_IR NATIVE: + // Mangled name: test.A#(){} + // Public signature: test/A.b.|812004636995167743[0] + get + + // CHECK: + // Mangled name: test.A{}a + // Public signature: test/A.a|-1200697420457237799[0] + val a: Int + // CHECK JVM_IR: + // Mangled name: test.A#(){}kotlin.Int + // Public signature: test/A.a.|4232747788241509192[0] + // CHECK JS_IR NATIVE: + // Mangled name: test.A#(){} + // Public signature: test/A.a.|6785176174175479410[0] + get + + // CHECK: + // Mangled name: test.A#(){} + // Public signature: test/A.|-5645683436151566731[0] + constructor() /* primary */ + // CHECK: + // Mangled name: test.A#(kotlin.Double){} + // Public signature: test/A.|575075696928934302[0] + constructor(x: Double) + // CHECK: + // Mangled name: test.A#(kotlin.Int){} + // Public signature: test/A.|-5182794243525578284[0] + constructor(x: Int) + // CHECK: + // Mangled name: test.A#(kotlin.String){} + // Public signature: test/A.|1280618353163213788[0] + constructor(x: String) + + // CHECK: + // Mangled name: test.A#a(){} + // Public signature: test/A.a|-4432112437378250461[0] + fun a(): Unit + + // CHECK: + // Mangled name: test.A#a@kotlin.String(){} + // Public signature: test/A.a|1255254255352403666[0] + fun String.a(): Unit + + // CHECK: + // Mangled name: test.A#b(){} + // Public signature: test/A.b|4789657038926421504[0] + fun b(): Unit + + // CHECK: + // Mangled name: test.A#b@kotlin.String(){} + // Public signature: test/A.b|7551113070366625353[0] + fun String.b(): Unit + + // CHECK: + // Mangled name: test.A@kotlin.Int{}a + // Public signature: test/A.a|6414450735717092429[0] + val Int.a: String + // CHECK JVM_IR: + // Mangled name: test.A#@kotlin.Int(){}kotlin.String + // Public signature: test/A.a.|-8980177656795826496[0] + // CHECK JS_IR NATIVE: + // Mangled name: test.A#@kotlin.Int(){} + // Public signature: test/A.a.|7799474542058666497[0] + get(): String + + // CHECK: + // Mangled name: test.A@kotlin.Int{}b + // Public signature: test/A.b|1728020612396458771[0] + val Int.b: String + // CHECK JVM_IR: + // Mangled name: test.A#@kotlin.Int(){}kotlin.String + // Public signature: test/A.b.|-3427454669423307773[0] + // CHECK JS_IR NATIVE: + // Mangled name: test.A#@kotlin.Int(){} + // Public signature: test/A.b.|1001308148257010945[0] + get(): String + +} diff --git a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.kt b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.kt index 529f811ae3f..20ee470e782 100644 --- a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.kt +++ b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.kt @@ -1,3 +1,6 @@ +// SKIP_SIGNATURE_DUMP +// ^ K1 generates a useless delegate field for the Test2 class, K2 does not + interface IBase { fun foo(a: A, b: B) val C.id: Map? diff --git a/compiler/testData/ir/irText/classes/delegatedImplementation.kt b/compiler/testData/ir/irText/classes/delegatedImplementation.kt index c5c17b1381d..a8c92e0f01c 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementation.kt +++ b/compiler/testData/ir/irText/classes/delegatedImplementation.kt @@ -1,3 +1,6 @@ +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57754 + interface IBase { fun foo(x: Int, s: String) fun bar(): Int @@ -28,4 +31,4 @@ fun otherImpl(x0: String, y0: Int): IOther = object : IOther { class Test1 : IBase by BaseImpl -class Test2 : IBase by BaseImpl, IOther by otherImpl("", 42) \ No newline at end of file +class Test2 : IBase by BaseImpl, IOther by otherImpl("", 42) diff --git a/compiler/testData/ir/irText/classes/delegatedImplementation.sig.kt.txt b/compiler/testData/ir/irText/classes/delegatedImplementation.sig.kt.txt new file mode 100644 index 00000000000..6f208534711 --- /dev/null +++ b/compiler/testData/ir/irText/classes/delegatedImplementation.sig.kt.txt @@ -0,0 +1,249 @@ +// CHECK: +// Mangled name: Test1 +// Public signature: /Test1|null[0] +class Test1 : IBase { + // CHECK: + // Mangled name: Test1#(){} + // Public signature: /Test1.|-5645683436151566731[0] + constructor() /* primary */ + // CHECK: + // Mangled name: Test1.$$delegate_0 + // Public signature: /Test1.$$delegate_0|-7286425919675154353[0] + private /* final field */ val $$delegate_0: BaseImpl + // CHECK JVM_IR: + // Mangled name: Test1#bar(){}kotlin.Int + // Public signature: /Test1.bar|-6436649210114349217[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#bar(){} + // Public signature: /Test1.bar|496682602797471549[0] + override fun bar(): Int + + // CHECK: + // Mangled name: Test1#foo(kotlin.Int;kotlin.String){} + // Public signature: /Test1.foo|2507695683462765192[0] + override fun foo(x: Int, s: String): Unit + + // CHECK: + // Mangled name: Test1#qux@kotlin.String(){} + // Public signature: /Test1.qux|7892261924686331851[0] + override fun String.qux(): Unit + +} + +// CHECK: +// Mangled name: Test2 +// Public signature: /Test2|null[0] +class Test2 : IBase, IOther { + // CHECK: + // Mangled name: Test2#(){} + // Public signature: /Test2.|-5645683436151566731[0] + constructor() /* primary */ + // CHECK: + // Mangled name: Test2.$$delegate_0 + // Public signature: /Test2.$$delegate_0|-7286425919675154353[0] + private /* final field */ val $$delegate_0: BaseImpl + // CHECK: + // Mangled name: Test2.$$delegate_1 + // Public signature: /Test2.$$delegate_1|-7286425919675154353[0] + private /* final field */ val $$delegate_1: IOther + // CHECK JVM_IR: + // Mangled name: Test2#bar(){}kotlin.Int + // Public signature: /Test2.bar|-6436649210114349217[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#bar(){} + // Public signature: /Test2.bar|496682602797471549[0] + override fun bar(): Int + + // CHECK: + // Mangled name: Test2#foo(kotlin.Int;kotlin.String){} + // Public signature: /Test2.foo|2507695683462765192[0] + override fun foo(x: Int, s: String): Unit + + // CHECK: + // Mangled name: Test2#qux@kotlin.String(){} + // Public signature: /Test2.qux|7892261924686331851[0] + override fun String.qux(): Unit + + // CHECK: + // Mangled name: Test2{}x + // Public signature: /Test2.x|-8060530855978347579[0] + override val x: String + // CHECK JVM_IR: + // Mangled name: Test2#(){}kotlin.String + // Public signature: /Test2.x.|316111172223894646[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#(){} + // Public signature: /Test2.x.|1482705010654679335[0] + override get(): String + + // CHECK: + // Mangled name: Test2{}y + // Public signature: /Test2.y|3625903257357557171[0] + override var y: Int + // CHECK JVM_IR: + // Mangled name: Test2#(){}kotlin.Int + // Public signature: /Test2.y.|-6745575372101973707[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#(){} + // Public signature: /Test2.y.|-7902422373892128922[0] + override get(): Int + // CHECK: + // Mangled name: Test2#(kotlin.Int){} + // Public signature: /Test2.y.|2154335559382602722[0] + override set(: Int): Unit + + // CHECK: + // Mangled name: Test2@kotlin.Byte{}z1 + // Public signature: /Test2.z1|-5032678972511317603[0] + override val Byte.z1: Int + // CHECK JVM_IR: + // Mangled name: Test2#@kotlin.Byte(){}kotlin.Int + // Public signature: /Test2.z1.|202969018831811261[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#@kotlin.Byte(){} + // Public signature: /Test2.z1.|1974735559523490070[0] + override get(): Int + + // CHECK: + // Mangled name: Test2@kotlin.Byte{}z2 + // Public signature: /Test2.z2|2525323031525546079[0] + override var Byte.z2: Int + // CHECK JVM_IR: + // Mangled name: Test2#@kotlin.Byte(){}kotlin.Int + // Public signature: /Test2.z2.|7197655500603983642[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#@kotlin.Byte(){} + // Public signature: /Test2.z2.|-8674032209594777706[0] + override get(): Int + // CHECK: + // Mangled name: Test2#@kotlin.Byte(kotlin.Int){} + // Public signature: /Test2.z2.|7245124960540359440[0] + override set(: Int): Unit + +} + +// CHECK: +// Mangled name: IBase +// Public signature: /IBase|null[0] +interface IBase { + + // CHECK JVM_IR: + // Mangled name: IBase#bar(){}kotlin.Int + // Public signature: /IBase.bar|-6436649210114349217[0] + // CHECK JS_IR NATIVE: + // Mangled name: IBase#bar(){} + // Public signature: /IBase.bar|496682602797471549[0] + abstract fun bar(): Int + + // CHECK: + // Mangled name: IBase#foo(kotlin.Int;kotlin.String){} + // Public signature: /IBase.foo|2507695683462765192[0] + abstract fun foo(x: Int, s: String): Unit + + // CHECK: + // Mangled name: IBase#qux@kotlin.String(){} + // Public signature: /IBase.qux|7892261924686331851[0] + abstract fun String.qux(): Unit + +} + +// CHECK: +// Mangled name: IOther +// Public signature: /IOther|null[0] +interface IOther { + + // CHECK: + // Mangled name: IOther{}x + // Public signature: /IOther.x|-8060530855978347579[0] + abstract val x: String + // CHECK JVM_IR: + // Mangled name: IOther#(){}kotlin.String + // Public signature: /IOther.x.|316111172223894646[0] + // CHECK JS_IR NATIVE: + // Mangled name: IOther#(){} + // Public signature: /IOther.x.|1482705010654679335[0] + abstract get + + // CHECK: + // Mangled name: IOther{}y + // Public signature: /IOther.y|3625903257357557171[0] + abstract var y: Int + // CHECK JVM_IR: + // Mangled name: IOther#(){}kotlin.Int + // Public signature: /IOther.y.|-6745575372101973707[0] + // CHECK JS_IR NATIVE: + // Mangled name: IOther#(){} + // Public signature: /IOther.y.|-7902422373892128922[0] + abstract get + // CHECK: + // Mangled name: IOther#(kotlin.Int){} + // Public signature: /IOther.y.|2154335559382602722[0] + abstract set + + // CHECK: + // Mangled name: IOther@kotlin.Byte{}z1 + // Public signature: /IOther.z1|-5032678972511317603[0] + abstract val Byte.z1: Int + // CHECK JVM_IR: + // Mangled name: IOther#@kotlin.Byte(){}kotlin.Int + // Public signature: /IOther.z1.|202969018831811261[0] + // CHECK JS_IR NATIVE: + // Mangled name: IOther#@kotlin.Byte(){} + // Public signature: /IOther.z1.|1974735559523490070[0] + abstract get + + // CHECK: + // Mangled name: IOther@kotlin.Byte{}z2 + // Public signature: /IOther.z2|2525323031525546079[0] + abstract var Byte.z2: Int + // CHECK JVM_IR: + // Mangled name: IOther#@kotlin.Byte(){}kotlin.Int + // Public signature: /IOther.z2.|7197655500603983642[0] + // CHECK JS_IR NATIVE: + // Mangled name: IOther#@kotlin.Byte(){} + // Public signature: /IOther.z2.|-8674032209594777706[0] + abstract get + // CHECK: + // Mangled name: IOther#@kotlin.Byte(kotlin.Int){} + // Public signature: /IOther.z2.|7245124960540359440[0] + abstract set + +} + +// CHECK: +// Mangled name: BaseImpl +// Public signature: /BaseImpl|null[0] +object BaseImpl : IBase { + // CHECK: + // Mangled name: BaseImpl#(){} + // Public signature: /BaseImpl.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: BaseImpl#bar(){}kotlin.Int + // Public signature: /BaseImpl.bar|-6436649210114349217[0] + // CHECK JS_IR NATIVE: + // Mangled name: BaseImpl#bar(){} + // Public signature: /BaseImpl.bar|496682602797471549[0] + override fun bar(): Int + + // CHECK: + // Mangled name: BaseImpl#foo(kotlin.Int;kotlin.String){} + // Public signature: /BaseImpl.foo|2507695683462765192[0] + override fun foo(x: Int, s: String): Unit + + // CHECK: + // Mangled name: BaseImpl#qux@kotlin.String(){} + // Public signature: /BaseImpl.qux|7892261924686331851[0] + override fun String.qux(): Unit + +} + +// CHECK JVM_IR: +// Mangled name: #otherImpl(kotlin.String;kotlin.Int){}IOther +// Public signature: /otherImpl|6303285997838013800[0] +// CHECK JS_IR NATIVE: +// Mangled name: #otherImpl(kotlin.String;kotlin.Int){} +// Public signature: /otherImpl|4856050071539374055[0] +fun otherImpl(x0: String, y0: Int): IOther + diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.kt b/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.kt index d4124290b40..c958050fec7 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.kt +++ b/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.kt @@ -1,4 +1,8 @@ // TARGET_BACKEND: JVM + +// SKIP_SIGNATURE_DUMP +// ^ Fake overrides have divirging @EnhancedNullability in K1 and K2 + // FILE: delegatedImplementationOfJavaInterface.kt class Test(private val j: J) : J by j diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.kt b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.kt index be4947207ed..7a9b3aa3bd7 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.kt +++ b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.kt @@ -1,3 +1,6 @@ +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57754 + interface IFooBar { fun foo() fun bar() @@ -10,4 +13,4 @@ object FooBarImpl : IFooBar { class C : IFooBar by FooBarImpl { override fun bar() {} -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.sig.kt.txt b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.sig.kt.txt new file mode 100644 index 00000000000..525fdae0ec6 --- /dev/null +++ b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.sig.kt.txt @@ -0,0 +1,62 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C : IFooBar { + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() /* primary */ + // CHECK: + // Mangled name: C.$$delegate_0 + // Public signature: /C.$$delegate_0|-7286425919675154353[0] + private /* final field */ val $$delegate_0: FooBarImpl + // CHECK: + // Mangled name: C#foo(){} + // Public signature: /C.foo|-1041209573719867811[0] + override fun foo(): Unit + + // CHECK: + // Mangled name: C#bar(){} + // Public signature: /C.bar|496682602797471549[0] + override fun bar(): Unit + +} + +// CHECK: +// Mangled name: IFooBar +// Public signature: /IFooBar|null[0] +interface IFooBar { + + // CHECK: + // Mangled name: IFooBar#bar(){} + // Public signature: /IFooBar.bar|496682602797471549[0] + abstract fun bar(): Unit + + // CHECK: + // Mangled name: IFooBar#foo(){} + // Public signature: /IFooBar.foo|-1041209573719867811[0] + abstract fun foo(): Unit + +} + +// CHECK: +// Mangled name: FooBarImpl +// Public signature: /FooBarImpl|null[0] +object FooBarImpl : IFooBar { + // CHECK: + // Mangled name: FooBarImpl#(){} + // Public signature: /FooBarImpl.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK: + // Mangled name: FooBarImpl#bar(){} + // Public signature: /FooBarImpl.bar|496682602797471549[0] + override fun bar(): Unit + + // CHECK: + // Mangled name: FooBarImpl#foo(){} + // Public signature: /FooBarImpl.foo|-1041209573719867811[0] + override fun foo(): Unit + +} + diff --git a/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.kt b/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.kt index c5be7be7977..cf4c3dc144a 100644 --- a/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.kt +++ b/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.kt @@ -1,3 +1,6 @@ +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR +// ^ KT-57429 + open class Cell(val value: T) typealias CT = Cell diff --git a/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.sig.kt.txt b/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.sig.kt.txt new file mode 100644 index 00000000000..8f4033b3282 --- /dev/null +++ b/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.sig.kt.txt @@ -0,0 +1,77 @@ +// CHECK: +// Mangled name: C1 +// Public signature: /C1|null[0] +class C1 : Cell { + // CHECK: + // Mangled name: C1#(){} + // Public signature: /C1.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: C1{}value + // Public signature: /C1.value|1987073854177347439[0] + /* fake */ override val value: String + // CHECK JVM_IR: + // Mangled name: C1#(){}kotlin.String + // Public signature: /C1.value.|-7202092821145242726[0] + // CHECK JS_IR NATIVE: + // Mangled name: C1#(){} + // Public signature: /C1.value.|3260093555963109437[0] + /* fake */ override get(): String + +} + +// CHECK: +// Mangled name: C2 +// Public signature: /C2|null[0] +class C2 : Cell { + // CHECK: + // Mangled name: C2#(){} + // Public signature: /C2.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: C2{}value + // Public signature: /C2.value|1987073854177347439[0] + /* fake */ override val value: String + // CHECK JVM_IR: + // Mangled name: C2#(){}kotlin.String + // Public signature: /C2.value.|-7202092821145242726[0] + // CHECK JS_IR NATIVE: + // Mangled name: C2#(){} + // Public signature: /C2.value.|3260093555963109437[0] + /* fake */ override get(): String + +} + +// CHECK: +// Mangled name: Cell +// Public signature: /Cell|null[0] +open class Cell { + // CHECK: + // Mangled name: Cell{}value + // Public signature: /Cell.value|1987073854177347439[0] + val value: T + // CHECK JVM_IR: + // Mangled name: Cell#(){}1:0 + // Public signature: /Cell.value.|3167862337988859752[0] + // CHECK JS_IR NATIVE: + // Mangled name: Cell#(){} + // Public signature: /Cell.value.|3260093555963109437[0] + get + + // CHECK: + // Mangled name: Cell#(1:0){} + // Public signature: /Cell.|-8731461708390519279[0] + constructor(value: T) /* primary */ + +} + +// CHECK: +// Mangled name: CStr +// Public signature: /CStr|null[0] +typealias CStr = Cell +// CHECK: +// Mangled name: CT +// Public signature: /CT|null[0] +typealias CT = Cell diff --git a/compiler/testData/ir/irText/classes/delegatingConstructorCallsInSecondaryConstructors.sig.kt.txt b/compiler/testData/ir/irText/classes/delegatingConstructorCallsInSecondaryConstructors.sig.kt.txt new file mode 100644 index 00000000000..1fcc410715b --- /dev/null +++ b/compiler/testData/ir/irText/classes/delegatingConstructorCallsInSecondaryConstructors.sig.kt.txt @@ -0,0 +1,30 @@ +// CHECK: +// Mangled name: Base +// Public signature: /Base|null[0] +open class Base { + // CHECK: + // Mangled name: Base#(){} + // Public signature: /Base.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: Test +// Public signature: /Test|null[0] +class Test : Base { + // CHECK: + // Mangled name: Test#(){} + // Public signature: /Test.|-5645683436151566731[0] + constructor() + // CHECK: + // Mangled name: Test#(kotlin.Int){} + // Public signature: /Test.|-5182794243525578284[0] + constructor(xx: Int) + // CHECK: + // Mangled name: Test#(kotlin.Short){} + // Public signature: /Test.|-8537285994488541433[0] + constructor(xx: Short) + +} + diff --git a/compiler/testData/ir/irText/classes/enum.kt b/compiler/testData/ir/irText/classes/enum.kt index 8828814e243..684c6a4ac2b 100644 --- a/compiler/testData/ir/irText/classes/enum.kt +++ b/compiler/testData/ir/irText/classes/enum.kt @@ -2,6 +2,9 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57775, KT-57777 + enum class TestEnum1 { TEST1, TEST2 } diff --git a/compiler/testData/ir/irText/classes/enum.sig.kt.txt b/compiler/testData/ir/irText/classes/enum.sig.kt.txt new file mode 100644 index 00000000000..94621c2ed9d --- /dev/null +++ b/compiler/testData/ir/irText/classes/enum.sig.kt.txt @@ -0,0 +1,1005 @@ +// CHECK: +// Mangled name: TestEnum1 +// Public signature: /TestEnum1|null[0] +enum class TestEnum1 : Enum { + // CHECK: + // Mangled name: TestEnum1#(){} + // Public signature: /TestEnum1.|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK: + // Mangled name: TestEnum1.TEST1 + // Public signature: /TestEnum1.TEST1|null[0] + TEST1 + + // CHECK: + // Mangled name: TestEnum1.TEST2 + // Public signature: /TestEnum1.TEST2|null[0] + TEST2 + + // CHECK JVM_IR: + // Mangled name: TestEnum1#valueOf#static(kotlin.String){}TestEnum1 + // Public signature: /TestEnum1.valueOf|-580817076166996450[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum1#valueOf#static(kotlin.String){} + // Public signature: /TestEnum1.valueOf|-4683474617854611729[0] + fun valueOf(value: String): TestEnum1 + + // CHECK JVM_IR: + // Mangled name: TestEnum1#values#static(){}kotlin.Array + // Public signature: /TestEnum1.values|8058701171109769002[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum1#values#static(){} + // Public signature: /TestEnum1.values|-8715569000920726747[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: TestEnum1#clone(){}kotlin.Any + // Public signature: /TestEnum1.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum1#compareTo(TestEnum1){} + // Public signature: /TestEnum1.compareTo|620946564205650373[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: TestEnum1#compareTo(TestEnum1){}kotlin.Int + // Public signature: /TestEnum1.compareTo|2053309372276441830[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum1#equals(kotlin.Any?){} + // Public signature: /TestEnum1.equals|4638265728071529943[0] + /* fake */ override operator fun compareTo(other: TestEnum1): Int + + // CHECK JVM_IR: + // Mangled name: TestEnum1#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestEnum1.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum1#hashCode(){} + // Public signature: /TestEnum1.hashCode|3409210261493131192[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: TestEnum1#hashCode(){}kotlin.Int + // Public signature: /TestEnum1.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum1#toString(){} + // Public signature: /TestEnum1.toString|-1522858123163872138[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestEnum1#toString(){}kotlin.String + // Public signature: /TestEnum1.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum1#static{}entries + // Public signature: /TestEnum1.entries|-5134227801081826149[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: TestEnum1#static{}entries + // Public signature: /TestEnum1.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: TestEnum1##static(){}kotlin.enums.EnumEntries + // Public signature: /TestEnum1.entries.|-834374959367663023[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum1{}name + // Public signature: /TestEnum1.name|4231860309499509769[0] + get(): EnumEntries + + // CHECK: + // Mangled name: TestEnum1{}name + // Public signature: /TestEnum1.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: TestEnum1#(){}kotlin.String + // Public signature: /TestEnum1.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum1{}ordinal + // Public signature: /TestEnum1.ordinal|1912745122988592376[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: TestEnum1{}ordinal + // Public signature: /TestEnum1.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: TestEnum1#(){}kotlin.Int + // Public signature: /TestEnum1.ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum2 + // Public signature: /TestEnum2|null[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: TestEnum2 +// Public signature: /TestEnum2|null[0] +enum class TestEnum2 : Enum { + // CHECK: + // Mangled name: TestEnum2{}x + // Public signature: /TestEnum2.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: TestEnum2#(){}kotlin.Int + // Public signature: /TestEnum2.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum2#(kotlin.Int){} + // Public signature: /TestEnum2.|-5182794243525578284[0] + get + + // CHECK: + // Mangled name: TestEnum2#(kotlin.Int){} + // Public signature: /TestEnum2.|-5182794243525578284[0] + private constructor(x: Int) /* primary */ + // CHECK: + // Mangled name: TestEnum2.TEST1 + // Public signature: /TestEnum2.TEST1|null[0] + TEST1 + + // CHECK: + // Mangled name: TestEnum2.TEST2 + // Public signature: /TestEnum2.TEST2|null[0] + TEST2 + + // CHECK: + // Mangled name: TestEnum2.TEST3 + // Public signature: /TestEnum2.TEST3|null[0] + TEST3 + + // CHECK JVM_IR: + // Mangled name: TestEnum2#valueOf#static(kotlin.String){}TestEnum2 + // Public signature: /TestEnum2.valueOf|-8239244547219711173[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum2#values#static(){} + // Public signature: /TestEnum2.values|-8715569000920726747[0] + fun valueOf(value: String): TestEnum2 + + // CHECK JVM_IR: + // Mangled name: TestEnum2#values#static(){}kotlin.Array + // Public signature: /TestEnum2.values|-8089803756089363016[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum2#compareTo(TestEnum2){} + // Public signature: /TestEnum2.compareTo|-7814829049390923815[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: TestEnum2#clone(){}kotlin.Any + // Public signature: /TestEnum2.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum2#equals(kotlin.Any?){} + // Public signature: /TestEnum2.equals|4638265728071529943[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: TestEnum2#compareTo(TestEnum2){}kotlin.Int + // Public signature: /TestEnum2.compareTo|-5150224806840857090[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum2#hashCode(){} + // Public signature: /TestEnum2.hashCode|3409210261493131192[0] + /* fake */ override operator fun compareTo(other: TestEnum2): Int + + // CHECK JVM_IR: + // Mangled name: TestEnum2#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestEnum2.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum2#toString(){} + // Public signature: /TestEnum2.toString|-1522858123163872138[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: TestEnum2#hashCode(){}kotlin.Int + // Public signature: /TestEnum2.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum2#static{}entries + // Public signature: /TestEnum2.entries|-5134227801081826149[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestEnum2#toString(){}kotlin.String + // Public signature: /TestEnum2.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum2##static(){} + // Public signature: /TestEnum2.entries.|-6068527377476727729[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: TestEnum2#static{}entries + // Public signature: /TestEnum2.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: TestEnum2##static(){}kotlin.enums.EnumEntries + // Public signature: /TestEnum2.entries.|-6243748706014676194[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum2#(){} + // Public signature: /TestEnum2.name.|5879344792307730109[0] + get(): EnumEntries + + // CHECK: + // Mangled name: TestEnum2{}name + // Public signature: /TestEnum2.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: TestEnum2#(){}kotlin.String + // Public signature: /TestEnum2.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum2#(){} + // Public signature: /TestEnum2.ordinal.|8409904226035914023[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: TestEnum2{}ordinal + // Public signature: /TestEnum2.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: TestEnum2#(){}kotlin.Int + // Public signature: /TestEnum2.ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum3#(){} + // Public signature: /TestEnum3.|-5645683436151566731[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: TestEnum3 +// Public signature: /TestEnum3|null[0] +abstract enum class TestEnum3 : Enum { + // CHECK: + // Mangled name: TestEnum3#(){} + // Public signature: /TestEnum3.|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK: + // Mangled name: TestEnum3.TEST + // Public signature: /TestEnum3.TEST|null[0] + + TEST + // CHECK: + // Mangled name: TestEnum3.TEST + // Public signature: /TestEnum3.TEST.|null[0] + private enum entry class TEST : TestEnum3 { + // CHECK: + // Mangled name: TestEnum3.TEST#(){} + // Public signature: /TestEnum3.TEST..|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK JVM_IR: + // Mangled name: TestEnum3.TEST#clone(){}kotlin.Any + // Public signature: /TestEnum3.TEST..clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum3.TEST#hashCode(){} + // Public signature: /TestEnum3.TEST..hashCode|3409210261493131192[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: TestEnum3.TEST#compareTo(TestEnum3){}kotlin.Int + // Public signature: /TestEnum3.TEST..compareTo|3758334100252612666[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum3.TEST#toString(){} + // Public signature: /TestEnum3.TEST..toString|-1522858123163872138[0] + /* fake */ override operator fun compareTo(other: TestEnum3): Int + + // CHECK JVM_IR: + // Mangled name: TestEnum3.TEST#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestEnum3.TEST..equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum3.TEST#foo(){} + // Public signature: /TestEnum3.TEST..foo|-1041209573719867811[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: TestEnum3.TEST#hashCode(){}kotlin.Int + // Public signature: /TestEnum3.TEST..hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum3.TEST{}name + // Public signature: /TestEnum3.TEST..name|4231860309499509769[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestEnum3.TEST#toString(){}kotlin.String + // Public signature: /TestEnum3.TEST..toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum3.TEST#(){} + // Public signature: /TestEnum3.TEST..name.|5879344792307730109[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: TestEnum3.TEST#foo(){} + // Public signature: /TestEnum3.TEST..foo|-1041209573719867811[0] + override fun foo(): Unit + + // CHECK: + // Mangled name: TestEnum3.TEST{}name + // Public signature: /TestEnum3.TEST..name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: TestEnum3.TEST#(){}kotlin.String + // Public signature: /TestEnum3.TEST..name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum3#valueOf#static(kotlin.String){} + // Public signature: /TestEnum3.valueOf|-4683474617854611729[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: TestEnum3.TEST{}ordinal + // Public signature: /TestEnum3.TEST..ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: TestEnum3.TEST#(){}kotlin.Int + // Public signature: /TestEnum3.TEST..ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum3#compareTo(TestEnum3){} + // Public signature: /TestEnum3.compareTo|-8584066847092174536[0] + /* fake */ override get(): Int + + } + + // CHECK JVM_IR: + // Mangled name: TestEnum3#valueOf#static(kotlin.String){}TestEnum3 + // Public signature: /TestEnum3.valueOf|2590925147797279879[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum3#equals(kotlin.Any?){} + // Public signature: /TestEnum3.equals|4638265728071529943[0] + fun valueOf(value: String): TestEnum3 + + // CHECK JVM_IR: + // Mangled name: TestEnum3#values#static(){}kotlin.Array + // Public signature: /TestEnum3.values|-3929439371307377630[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum3#hashCode(){} + // Public signature: /TestEnum3.hashCode|3409210261493131192[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: TestEnum3#clone(){}kotlin.Any + // Public signature: /TestEnum3.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum3#toString(){} + // Public signature: /TestEnum3.toString|-1522858123163872138[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: TestEnum3#compareTo(TestEnum3){}kotlin.Int + // Public signature: /TestEnum3.compareTo|3758334100252612666[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum3#foo(){} + // Public signature: /TestEnum3.foo|-1041209573719867811[0] + /* fake */ override operator fun compareTo(other: TestEnum3): Int + + // CHECK JVM_IR: + // Mangled name: TestEnum3#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestEnum3.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum3#static{}entries + // Public signature: /TestEnum3.entries|-5134227801081826149[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: TestEnum3#hashCode(){}kotlin.Int + // Public signature: /TestEnum3.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum3##static(){} + // Public signature: /TestEnum3.entries.|-6068527377476727729[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestEnum3#toString(){}kotlin.String + // Public signature: /TestEnum3.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum3{}name + // Public signature: /TestEnum3.name|4231860309499509769[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: TestEnum3#foo(){} + // Public signature: /TestEnum3.foo|-1041209573719867811[0] + abstract fun foo(): Unit + + // CHECK: + // Mangled name: TestEnum3#static{}entries + // Public signature: /TestEnum3.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: TestEnum3##static(){}kotlin.enums.EnumEntries + // Public signature: /TestEnum3.entries.|-6780028181727590184[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum3#(){} + // Public signature: /TestEnum3.ordinal.|8409904226035914023[0] + get(): EnumEntries + + // CHECK: + // Mangled name: TestEnum3{}name + // Public signature: /TestEnum3.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: TestEnum3#(){}kotlin.String + // Public signature: /TestEnum3.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4{}x + // Public signature: /TestEnum4.x|-8060530855978347579[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: TestEnum3{}ordinal + // Public signature: /TestEnum3.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: TestEnum3#(){}kotlin.Int + // Public signature: /TestEnum3.ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4#(kotlin.Int){} + // Public signature: /TestEnum4.|-5182794243525578284[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: TestEnum4 +// Public signature: /TestEnum4|null[0] +abstract enum class TestEnum4 : Enum { + // CHECK: + // Mangled name: TestEnum4{}x + // Public signature: /TestEnum4.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: TestEnum4#(){}kotlin.Int + // Public signature: /TestEnum4.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4.TEST1#(){} + // Public signature: /TestEnum4.TEST1..|-5645683436151566731[0] + get + + // CHECK: + // Mangled name: TestEnum4#(kotlin.Int){} + // Public signature: /TestEnum4.|-5182794243525578284[0] + private constructor(x: Int) /* primary */ + // CHECK: + // Mangled name: TestEnum4.TEST1 + // Public signature: /TestEnum4.TEST1|null[0] + + TEST1 + // CHECK: + // Mangled name: TestEnum4.TEST1 + // Public signature: /TestEnum4.TEST1.|null[0] + private enum entry class TEST1 : TestEnum4 { + // CHECK: + // Mangled name: TestEnum4.TEST1#(){} + // Public signature: /TestEnum4.TEST1..|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK JVM_IR: + // Mangled name: TestEnum4.TEST1#clone(){}kotlin.Any + // Public signature: /TestEnum4.TEST1..clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4.TEST1#foo(){} + // Public signature: /TestEnum4.TEST1..foo|-1041209573719867811[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: TestEnum4.TEST1#compareTo(TestEnum4){}kotlin.Int + // Public signature: /TestEnum4.TEST1..compareTo|-8388826051358644820[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4.TEST1{}name + // Public signature: /TestEnum4.TEST1..name|4231860309499509769[0] + /* fake */ override operator fun compareTo(other: TestEnum4): Int + + // CHECK JVM_IR: + // Mangled name: TestEnum4.TEST1#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestEnum4.TEST1..equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4.TEST1#(){} + // Public signature: /TestEnum4.TEST1..name.|5879344792307730109[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: TestEnum4.TEST1#hashCode(){}kotlin.Int + // Public signature: /TestEnum4.TEST1..hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4.TEST1{}ordinal + // Public signature: /TestEnum4.TEST1..ordinal|1912745122988592376[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestEnum4.TEST1#toString(){}kotlin.String + // Public signature: /TestEnum4.TEST1..toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4.TEST1#(){} + // Public signature: /TestEnum4.TEST1..ordinal.|8409904226035914023[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: TestEnum4.TEST1#foo(){} + // Public signature: /TestEnum4.TEST1..foo|-1041209573719867811[0] + override fun foo(): Unit + + // CHECK: + // Mangled name: TestEnum4.TEST1{}name + // Public signature: /TestEnum4.TEST1..name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: TestEnum4.TEST1#(){}kotlin.String + // Public signature: /TestEnum4.TEST1..name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4.TEST2 + // Public signature: /TestEnum4.TEST2|null[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: TestEnum4.TEST1{}ordinal + // Public signature: /TestEnum4.TEST1..ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: TestEnum4.TEST1#(){}kotlin.Int + // Public signature: /TestEnum4.TEST1..ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4.TEST2{}z + // Public signature: /TestEnum4.TEST2..z|7549650372729116193[0] + /* fake */ override get(): Int + + // CHECK: + // Mangled name: TestEnum4.TEST1{}x + // Public signature: /TestEnum4.TEST1..x|-8060530855978347579[0] + /* fake */ override val x: Int + // CHECK JVM_IR: + // Mangled name: TestEnum4.TEST1#(){}kotlin.Int + // Public signature: /TestEnum4.TEST1..x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4.TEST2#(){} + // Public signature: /TestEnum4.TEST2..|-5645683436151566731[0] + /* fake */ override get(): Int + + } + + // CHECK: + // Mangled name: TestEnum4.TEST2 + // Public signature: /TestEnum4.TEST2|null[0] + + TEST2 + // CHECK: + // Mangled name: TestEnum4.TEST2 + // Public signature: /TestEnum4.TEST2.|null[0] + private enum entry class TEST2 : TestEnum4 { + // CHECK: + // Mangled name: TestEnum4.TEST2{}z + // Public signature: /TestEnum4.TEST2..z|7549650372729116193[0] + val z: Int + // CHECK JVM_IR: + // Mangled name: TestEnum4.TEST2#(){}kotlin.Int + // Public signature: /TestEnum4.TEST2..z.|373477940260174794[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4.TEST2#toString(){} + // Public signature: /TestEnum4.TEST2..toString|-1522858123163872138[0] + get + + // CHECK: + // Mangled name: TestEnum4.TEST2#(){} + // Public signature: /TestEnum4.TEST2..|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK JVM_IR: + // Mangled name: TestEnum4.TEST2#clone(){}kotlin.Any + // Public signature: /TestEnum4.TEST2..clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4.TEST2{}name + // Public signature: /TestEnum4.TEST2..name|4231860309499509769[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: TestEnum4.TEST2#compareTo(TestEnum4){}kotlin.Int + // Public signature: /TestEnum4.TEST2..compareTo|-8388826051358644820[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4.TEST2#(){} + // Public signature: /TestEnum4.TEST2..name.|5879344792307730109[0] + /* fake */ override operator fun compareTo(other: TestEnum4): Int + + // CHECK JVM_IR: + // Mangled name: TestEnum4.TEST2#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestEnum4.TEST2..equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4.TEST2{}ordinal + // Public signature: /TestEnum4.TEST2..ordinal|1912745122988592376[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: TestEnum4.TEST2#hashCode(){}kotlin.Int + // Public signature: /TestEnum4.TEST2..hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4.TEST2#(){} + // Public signature: /TestEnum4.TEST2..ordinal.|8409904226035914023[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestEnum4.TEST2#toString(){}kotlin.String + // Public signature: /TestEnum4.TEST2..toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4.TEST2{}x + // Public signature: /TestEnum4.TEST2..x|-8060530855978347579[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: TestEnum4.TEST2#foo(){} + // Public signature: /TestEnum4.TEST2..foo|-1041209573719867811[0] + override fun foo(): Unit + + // CHECK: + // Mangled name: TestEnum4.TEST2{}name + // Public signature: /TestEnum4.TEST2..name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: TestEnum4.TEST2#(){}kotlin.String + // Public signature: /TestEnum4.TEST2..name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4#values#static(){} + // Public signature: /TestEnum4.values|-8715569000920726747[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: TestEnum4.TEST2{}ordinal + // Public signature: /TestEnum4.TEST2..ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: TestEnum4.TEST2#(){}kotlin.Int + // Public signature: /TestEnum4.TEST2..ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4#equals(kotlin.Any?){} + // Public signature: /TestEnum4.equals|4638265728071529943[0] + /* fake */ override get(): Int + + // CHECK: + // Mangled name: TestEnum4.TEST2{}x + // Public signature: /TestEnum4.TEST2..x|-8060530855978347579[0] + /* fake */ override val x: Int + // CHECK JVM_IR: + // Mangled name: TestEnum4.TEST2#(){}kotlin.Int + // Public signature: /TestEnum4.TEST2..x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4#toString(){} + // Public signature: /TestEnum4.toString|-1522858123163872138[0] + /* fake */ override get(): Int + + } + + // CHECK JVM_IR: + // Mangled name: TestEnum4#valueOf#static(kotlin.String){}TestEnum4 + // Public signature: /TestEnum4.valueOf|2423737738768372933[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4#foo(){} + // Public signature: /TestEnum4.foo|-1041209573719867811[0] + fun valueOf(value: String): TestEnum4 + + // CHECK JVM_IR: + // Mangled name: TestEnum4#values#static(){}kotlin.Array + // Public signature: /TestEnum4.values|-3255933436834389837[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4#static{}entries + // Public signature: /TestEnum4.entries|-5134227801081826149[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: TestEnum4#clone(){}kotlin.Any + // Public signature: /TestEnum4.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4##static(){} + // Public signature: /TestEnum4.entries.|-6068527377476727729[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: TestEnum4#compareTo(TestEnum4){}kotlin.Int + // Public signature: /TestEnum4.compareTo|-8388826051358644820[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4{}name + // Public signature: /TestEnum4.name|4231860309499509769[0] + /* fake */ override operator fun compareTo(other: TestEnum4): Int + + // CHECK JVM_IR: + // Mangled name: TestEnum4#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestEnum4.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4#(){} + // Public signature: /TestEnum4.name.|5879344792307730109[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: TestEnum4#hashCode(){}kotlin.Int + // Public signature: /TestEnum4.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4{}ordinal + // Public signature: /TestEnum4.ordinal|1912745122988592376[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestEnum4#toString(){}kotlin.String + // Public signature: /TestEnum4.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum4#(){} + // Public signature: /TestEnum4.ordinal.|8409904226035914023[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: TestEnum4#foo(){} + // Public signature: /TestEnum4.foo|-1041209573719867811[0] + abstract fun foo(): Unit + + // CHECK: + // Mangled name: TestEnum4#static{}entries + // Public signature: /TestEnum4.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: TestEnum4##static(){}kotlin.enums.EnumEntries + // Public signature: /TestEnum4.entries.|-5379266754828508305[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum5#(){} + // Public signature: /TestEnum5.x.|1482705010654679335[0] + get(): EnumEntries + + // CHECK: + // Mangled name: TestEnum4{}name + // Public signature: /TestEnum4.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: TestEnum4#(){}kotlin.String + // Public signature: /TestEnum4.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum5.TEST1 + // Public signature: /TestEnum5.TEST1|null[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: TestEnum4{}ordinal + // Public signature: /TestEnum4.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: TestEnum4#(){}kotlin.Int + // Public signature: /TestEnum4.ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum5.TEST3 + // Public signature: /TestEnum5.TEST3|null[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: TestEnum5 +// Public signature: /TestEnum5|null[0] +enum class TestEnum5 : Enum { + // CHECK: + // Mangled name: TestEnum5{}x + // Public signature: /TestEnum5.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: TestEnum5#(){}kotlin.Int + // Public signature: /TestEnum5.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum5#compareTo(TestEnum5){} + // Public signature: /TestEnum5.compareTo|5363466639006514831[0] + get + + // CHECK: + // Mangled name: TestEnum5#(kotlin.Int){} + // Public signature: /TestEnum5.|-5182794243525578284[0] + private constructor(x: Int) /* primary */ + // CHECK: + // Mangled name: TestEnum5.TEST1 + // Public signature: /TestEnum5.TEST1|null[0] + TEST1 + + // CHECK: + // Mangled name: TestEnum5.TEST2 + // Public signature: /TestEnum5.TEST2|null[0] + TEST2 + + // CHECK: + // Mangled name: TestEnum5.TEST3 + // Public signature: /TestEnum5.TEST3|null[0] + TEST3 + + // CHECK JVM_IR: + // Mangled name: TestEnum5#valueOf#static(kotlin.String){}TestEnum5 + // Public signature: /TestEnum5.valueOf|-5169706962915676486[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum5##static(){} + // Public signature: /TestEnum5.entries.|-6068527377476727729[0] + fun valueOf(value: String): TestEnum5 + + // CHECK JVM_IR: + // Mangled name: TestEnum5#values#static(){}kotlin.Array + // Public signature: /TestEnum5.values|-344605949466928180[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum5{}name + // Public signature: /TestEnum5.name|4231860309499509769[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: TestEnum5#clone(){}kotlin.Any + // Public signature: /TestEnum5.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum5#(){} + // Public signature: /TestEnum5.name.|5879344792307730109[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: TestEnum5#compareTo(TestEnum5){}kotlin.Int + // Public signature: /TestEnum5.compareTo|-2291427915690208293[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum5{}ordinal + // Public signature: /TestEnum5.ordinal|1912745122988592376[0] + /* fake */ override operator fun compareTo(other: TestEnum5): Int + + // CHECK JVM_IR: + // Mangled name: TestEnum5#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestEnum5.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum5#(){} + // Public signature: /TestEnum5.ordinal.|8409904226035914023[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: TestEnum5#hashCode(){}kotlin.Int + // Public signature: /TestEnum5.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum6 + // Public signature: /TestEnum6|null[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestEnum5#toString(){}kotlin.String + // Public signature: /TestEnum5.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum6{}x + // Public signature: /TestEnum6.x|-8060530855978347579[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: TestEnum5#static{}entries + // Public signature: /TestEnum5.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: TestEnum5##static(){}kotlin.enums.EnumEntries + // Public signature: /TestEnum5.entries.|-7808662118823437075[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum6{}y + // Public signature: /TestEnum6.y|3625903257357557171[0] + get(): EnumEntries + + // CHECK: + // Mangled name: TestEnum5{}name + // Public signature: /TestEnum5.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: TestEnum5#(){}kotlin.String + // Public signature: /TestEnum5.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum6#(kotlin.Int;kotlin.Int){} + // Public signature: /TestEnum6.|-7691762014320324121[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: TestEnum5{}ordinal + // Public signature: /TestEnum5.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: TestEnum5#(){}kotlin.Int + // Public signature: /TestEnum5.ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum6#valueOf#static(kotlin.String){} + // Public signature: /TestEnum6.valueOf|-4683474617854611729[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: TestEnum6 +// Public signature: /TestEnum6|null[0] +enum class TestEnum6 : Enum { + // CHECK: + // Mangled name: TestEnum6{}x + // Public signature: /TestEnum6.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: TestEnum6#(){}kotlin.Int + // Public signature: /TestEnum6.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum6#equals(kotlin.Any?){} + // Public signature: /TestEnum6.equals|4638265728071529943[0] + get + + // CHECK: + // Mangled name: TestEnum6{}y + // Public signature: /TestEnum6.y|3625903257357557171[0] + val y: Int + // CHECK JVM_IR: + // Mangled name: TestEnum6#(){}kotlin.Int + // Public signature: /TestEnum6.y.|-6745575372101973707[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum6#toString(){} + // Public signature: /TestEnum6.toString|-1522858123163872138[0] + get + + // CHECK: + // Mangled name: TestEnum6#(kotlin.Int;kotlin.Int){} + // Public signature: /TestEnum6.|-7691762014320324121[0] + private constructor(x: Int, y: Int) /* primary */ + // CHECK: + // Mangled name: TestEnum6.TEST + // Public signature: /TestEnum6.TEST|null[0] + TEST + + // CHECK JVM_IR: + // Mangled name: TestEnum6#valueOf#static(kotlin.String){}TestEnum6 + // Public signature: /TestEnum6.valueOf|4918214435711157814[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum6{}name + // Public signature: /TestEnum6.name|4231860309499509769[0] + fun valueOf(value: String): TestEnum6 + + // CHECK JVM_IR: + // Mangled name: TestEnum6#values#static(){}kotlin.Array + // Public signature: /TestEnum6.values|-3500841970921663207[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum6#(){} + // Public signature: /TestEnum6.name.|5879344792307730109[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: TestEnum6#clone(){}kotlin.Any + // Public signature: /TestEnum6.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum6{}ordinal + // Public signature: /TestEnum6.ordinal|1912745122988592376[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: TestEnum6#compareTo(TestEnum6){}kotlin.Int + // Public signature: /TestEnum6.compareTo|-8618169451141618664[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum6#(){} + // Public signature: /TestEnum6.ordinal.|8409904226035914023[0] + /* fake */ override operator fun compareTo(other: TestEnum6): Int + + // CHECK JVM_IR: + // Mangled name: TestEnum6#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestEnum6.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: #f(){} + // Public signature: /f|5316533450599009716[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: TestEnum6#hashCode(){}kotlin.Int + // Public signature: /TestEnum6.hashCode|-8048879360829830756[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestEnum6#toString(){}kotlin.String + // Public signature: /TestEnum6.toString|6958853723545266802[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: TestEnum6#static{}entries + // Public signature: /TestEnum6.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: TestEnum6##static(){}kotlin.enums.EnumEntries + // Public signature: /TestEnum6.entries.|-6978845766362641693[0] + get(): EnumEntries + + // CHECK: + // Mangled name: TestEnum6{}name + // Public signature: /TestEnum6.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: TestEnum6#(){}kotlin.String + // Public signature: /TestEnum6.name.|-8006111524522882650[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: TestEnum6{}ordinal + // Public signature: /TestEnum6.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: TestEnum6#(){}kotlin.Int + // Public signature: /TestEnum6.ordinal.|-6902664390061762634[0] + /* fake */ override get(): Int + +} + +// CHECK JVM_IR: +// Mangled name: #f(){}kotlin.Int +// Public signature: /f|-2854658745315648608[0] +fun f(): Int + diff --git a/compiler/testData/ir/irText/classes/enumClassModality.kt b/compiler/testData/ir/irText/classes/enumClassModality.kt index 29c3d6749f9..f01e5eb3a6b 100644 --- a/compiler/testData/ir/irText/classes/enumClassModality.kt +++ b/compiler/testData/ir/irText/classes/enumClassModality.kt @@ -1,5 +1,9 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57775, KT-57777 + enum class TestFinalEnum1 { X1 } diff --git a/compiler/testData/ir/irText/classes/enumClassModality.sig.kt.txt b/compiler/testData/ir/irText/classes/enumClassModality.sig.kt.txt new file mode 100644 index 00000000000..c6e03895e74 --- /dev/null +++ b/compiler/testData/ir/irText/classes/enumClassModality.sig.kt.txt @@ -0,0 +1,1089 @@ +// CHECK: +// Mangled name: TestAbstractEnum1 +// Public signature: /TestAbstractEnum1|null[0] +abstract enum class TestAbstractEnum1 : Enum { + // CHECK: + // Mangled name: TestAbstractEnum1#(){} + // Public signature: /TestAbstractEnum1.|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK: + // Mangled name: TestAbstractEnum1.X1 + // Public signature: /TestAbstractEnum1.X1|null[0] + + X1 + // CHECK: + // Mangled name: TestAbstractEnum1.X1 + // Public signature: /TestAbstractEnum1.X1.|null[0] + private enum entry class X1 : TestAbstractEnum1 { + // CHECK: + // Mangled name: TestAbstractEnum1.X1#(){} + // Public signature: /TestAbstractEnum1.X1..|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum1.X1#clone(){}kotlin.Any + // Public signature: /TestAbstractEnum1.X1..clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum1.X1#compareTo(TestAbstractEnum1){} + // Public signature: /TestAbstractEnum1.X1..compareTo|745390484677491369[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum1.X1#compareTo(TestAbstractEnum1){}kotlin.Int + // Public signature: /TestAbstractEnum1.X1..compareTo|4568850831400093628[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum1.X1#equals(kotlin.Any?){} + // Public signature: /TestAbstractEnum1.X1..equals|4638265728071529943[0] + /* fake */ override operator fun compareTo(other: TestAbstractEnum1): Int + + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum1.X1#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestAbstractEnum1.X1..equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum1.X1#hashCode(){} + // Public signature: /TestAbstractEnum1.X1..hashCode|3409210261493131192[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum1.X1#hashCode(){}kotlin.Int + // Public signature: /TestAbstractEnum1.X1..hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum1.X1#toString(){} + // Public signature: /TestAbstractEnum1.X1..toString|-1522858123163872138[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum1.X1#toString(){}kotlin.String + // Public signature: /TestAbstractEnum1.X1..toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum1.X1#foo(){} + // Public signature: /TestAbstractEnum1.X1..foo|-1041209573719867811[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: TestAbstractEnum1.X1#foo(){} + // Public signature: /TestAbstractEnum1.X1..foo|-1041209573719867811[0] + override fun foo(): Unit + + // CHECK: + // Mangled name: TestAbstractEnum1.X1{}name + // Public signature: /TestAbstractEnum1.X1..name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum1.X1#(){}kotlin.String + // Public signature: /TestAbstractEnum1.X1..name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum1.X1{}ordinal + // Public signature: /TestAbstractEnum1.X1..ordinal|1912745122988592376[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: TestAbstractEnum1.X1{}ordinal + // Public signature: /TestAbstractEnum1.X1..ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum1.X1#(){}kotlin.Int + // Public signature: /TestAbstractEnum1.X1..ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum1#valueOf#static(kotlin.String){} + // Public signature: /TestAbstractEnum1.valueOf|-4683474617854611729[0] + /* fake */ override get(): Int + + } + + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum1#valueOf#static(kotlin.String){}TestAbstractEnum1 + // Public signature: /TestAbstractEnum1.valueOf|1031102409939396944[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum1#values#static(){} + // Public signature: /TestAbstractEnum1.values|-8715569000920726747[0] + fun valueOf(value: String): TestAbstractEnum1 + + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum1#values#static(){}kotlin.Array + // Public signature: /TestAbstractEnum1.values|2421071688454673326[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum1#compareTo(TestAbstractEnum1){} + // Public signature: /TestAbstractEnum1.compareTo|745390484677491369[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum1#clone(){}kotlin.Any + // Public signature: /TestAbstractEnum1.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum1#equals(kotlin.Any?){} + // Public signature: /TestAbstractEnum1.equals|4638265728071529943[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum1#compareTo(TestAbstractEnum1){}kotlin.Int + // Public signature: /TestAbstractEnum1.compareTo|4568850831400093628[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum1#hashCode(){} + // Public signature: /TestAbstractEnum1.hashCode|3409210261493131192[0] + /* fake */ override operator fun compareTo(other: TestAbstractEnum1): Int + + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum1#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestAbstractEnum1.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum1#toString(){} + // Public signature: /TestAbstractEnum1.toString|-1522858123163872138[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum1#hashCode(){}kotlin.Int + // Public signature: /TestAbstractEnum1.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum1#foo(){} + // Public signature: /TestAbstractEnum1.foo|-1041209573719867811[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum1#toString(){}kotlin.String + // Public signature: /TestAbstractEnum1.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum1#static{}entries + // Public signature: /TestAbstractEnum1.entries|-5134227801081826149[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: TestAbstractEnum1#foo(){} + // Public signature: /TestAbstractEnum1.foo|-1041209573719867811[0] + abstract fun foo(): Unit + + // CHECK: + // Mangled name: TestAbstractEnum1#static{}entries + // Public signature: /TestAbstractEnum1.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum1##static(){}kotlin.enums.EnumEntries + // Public signature: /TestAbstractEnum1.entries.|-62644859580206762[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum1#(){} + // Public signature: /TestAbstractEnum1.name.|5879344792307730109[0] + get(): EnumEntries + + // CHECK: + // Mangled name: TestAbstractEnum1{}name + // Public signature: /TestAbstractEnum1.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum1#(){}kotlin.String + // Public signature: /TestAbstractEnum1.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum1#(){} + // Public signature: /TestAbstractEnum1.ordinal.|8409904226035914023[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: TestAbstractEnum1{}ordinal + // Public signature: /TestAbstractEnum1.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum1#(){}kotlin.Int + // Public signature: /TestAbstractEnum1.ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum2#(){} + // Public signature: /TestAbstractEnum2.|-5645683436151566731[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: TestAbstractEnum2 +// Public signature: /TestAbstractEnum2|null[0] +abstract enum class TestAbstractEnum2 : Enum, IFoo { + // CHECK: + // Mangled name: TestAbstractEnum2#(){} + // Public signature: /TestAbstractEnum2.|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK: + // Mangled name: TestAbstractEnum2.X1 + // Public signature: /TestAbstractEnum2.X1|null[0] + + X1 + // CHECK: + // Mangled name: TestAbstractEnum2.X1 + // Public signature: /TestAbstractEnum2.X1.|null[0] + private enum entry class X1 : TestAbstractEnum2 { + // CHECK: + // Mangled name: TestAbstractEnum2.X1#(){} + // Public signature: /TestAbstractEnum2.X1..|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum2.X1#clone(){}kotlin.Any + // Public signature: /TestAbstractEnum2.X1..clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum2.X1#hashCode(){} + // Public signature: /TestAbstractEnum2.X1..hashCode|3409210261493131192[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum2.X1#compareTo(TestAbstractEnum2){}kotlin.Int + // Public signature: /TestAbstractEnum2.X1..compareTo|1400147308358154853[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum2.X1#toString(){} + // Public signature: /TestAbstractEnum2.X1..toString|-1522858123163872138[0] + /* fake */ override operator fun compareTo(other: TestAbstractEnum2): Int + + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum2.X1#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestAbstractEnum2.X1..equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum2.X1#foo(){} + // Public signature: /TestAbstractEnum2.X1..foo|-1041209573719867811[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum2.X1#hashCode(){}kotlin.Int + // Public signature: /TestAbstractEnum2.X1..hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum2.X1{}name + // Public signature: /TestAbstractEnum2.X1..name|4231860309499509769[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum2.X1#toString(){}kotlin.String + // Public signature: /TestAbstractEnum2.X1..toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum2.X1#(){} + // Public signature: /TestAbstractEnum2.X1..name.|5879344792307730109[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: TestAbstractEnum2.X1#foo(){} + // Public signature: /TestAbstractEnum2.X1..foo|-1041209573719867811[0] + override fun foo(): Unit + + // CHECK: + // Mangled name: TestAbstractEnum2.X1{}name + // Public signature: /TestAbstractEnum2.X1..name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum2.X1#(){}kotlin.String + // Public signature: /TestAbstractEnum2.X1..name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum2#valueOf#static(kotlin.String){} + // Public signature: /TestAbstractEnum2.valueOf|-4683474617854611729[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: TestAbstractEnum2.X1{}ordinal + // Public signature: /TestAbstractEnum2.X1..ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum2.X1#(){}kotlin.Int + // Public signature: /TestAbstractEnum2.X1..ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum2#compareTo(TestAbstractEnum2){} + // Public signature: /TestAbstractEnum2.compareTo|-5741102265556364706[0] + /* fake */ override get(): Int + + } + + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum2#valueOf#static(kotlin.String){}TestAbstractEnum2 + // Public signature: /TestAbstractEnum2.valueOf|-3718310282234049027[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum2#equals(kotlin.Any?){} + // Public signature: /TestAbstractEnum2.equals|4638265728071529943[0] + fun valueOf(value: String): TestAbstractEnum2 + + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum2#values#static(){}kotlin.Array + // Public signature: /TestAbstractEnum2.values|-1014141399495495627[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum2#foo(){} + // Public signature: /TestAbstractEnum2.foo|-1041209573719867811[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum2#clone(){}kotlin.Any + // Public signature: /TestAbstractEnum2.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum2#hashCode(){} + // Public signature: /TestAbstractEnum2.hashCode|3409210261493131192[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum2#compareTo(TestAbstractEnum2){}kotlin.Int + // Public signature: /TestAbstractEnum2.compareTo|1400147308358154853[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum2#toString(){} + // Public signature: /TestAbstractEnum2.toString|-1522858123163872138[0] + /* fake */ override operator fun compareTo(other: TestAbstractEnum2): Int + + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum2#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestAbstractEnum2.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum2#static{}entries + // Public signature: /TestAbstractEnum2.entries|-5134227801081826149[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK: + // Mangled name: TestAbstractEnum2#foo(){} + // Public signature: /TestAbstractEnum2.foo|-1041209573719867811[0] + abstract /* fake */ override fun foo(): Unit + + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum2#hashCode(){}kotlin.Int + // Public signature: /TestAbstractEnum2.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum2{}name + // Public signature: /TestAbstractEnum2.name|4231860309499509769[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum2#toString(){}kotlin.String + // Public signature: /TestAbstractEnum2.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum2#(){} + // Public signature: /TestAbstractEnum2.name.|5879344792307730109[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: TestAbstractEnum2#static{}entries + // Public signature: /TestAbstractEnum2.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum2##static(){}kotlin.enums.EnumEntries + // Public signature: /TestAbstractEnum2.entries.|8627121999159520047[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAbstractEnum2#(){} + // Public signature: /TestAbstractEnum2.ordinal.|8409904226035914023[0] + get(): EnumEntries + + // CHECK: + // Mangled name: TestAbstractEnum2{}name + // Public signature: /TestAbstractEnum2.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum2#(){}kotlin.String + // Public signature: /TestAbstractEnum2.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum1#(){} + // Public signature: /TestFinalEnum1.|-5645683436151566731[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: TestAbstractEnum2{}ordinal + // Public signature: /TestAbstractEnum2.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: TestAbstractEnum2#(){}kotlin.Int + // Public signature: /TestAbstractEnum2.ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum1#valueOf#static(kotlin.String){} + // Public signature: /TestFinalEnum1.valueOf|-4683474617854611729[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: TestFinalEnum1 +// Public signature: /TestFinalEnum1|null[0] +enum class TestFinalEnum1 : Enum { + // CHECK: + // Mangled name: TestFinalEnum1#(){} + // Public signature: /TestFinalEnum1.|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK: + // Mangled name: TestFinalEnum1.X1 + // Public signature: /TestFinalEnum1.X1|null[0] + X1 + + // CHECK JVM_IR: + // Mangled name: TestFinalEnum1#valueOf#static(kotlin.String){}TestFinalEnum1 + // Public signature: /TestFinalEnum1.valueOf|-6956480038617460042[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum1#hashCode(){} + // Public signature: /TestFinalEnum1.hashCode|3409210261493131192[0] + fun valueOf(value: String): TestFinalEnum1 + + // CHECK JVM_IR: + // Mangled name: TestFinalEnum1#values#static(){}kotlin.Array + // Public signature: /TestFinalEnum1.values|-2181276672467921798[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum1#toString(){} + // Public signature: /TestFinalEnum1.toString|-1522858123163872138[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: TestFinalEnum1#clone(){}kotlin.Any + // Public signature: /TestFinalEnum1.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum1#static{}entries + // Public signature: /TestFinalEnum1.entries|-5134227801081826149[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: TestFinalEnum1#compareTo(TestFinalEnum1){}kotlin.Int + // Public signature: /TestFinalEnum1.compareTo|3720004550586571290[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum1##static(){} + // Public signature: /TestFinalEnum1.entries.|-6068527377476727729[0] + /* fake */ override operator fun compareTo(other: TestFinalEnum1): Int + + // CHECK JVM_IR: + // Mangled name: TestFinalEnum1#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestFinalEnum1.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum1{}name + // Public signature: /TestFinalEnum1.name|4231860309499509769[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: TestFinalEnum1#hashCode(){}kotlin.Int + // Public signature: /TestFinalEnum1.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum1#(){} + // Public signature: /TestFinalEnum1.name.|5879344792307730109[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestFinalEnum1#toString(){}kotlin.String + // Public signature: /TestFinalEnum1.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum1{}ordinal + // Public signature: /TestFinalEnum1.ordinal|1912745122988592376[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: TestFinalEnum1#static{}entries + // Public signature: /TestFinalEnum1.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: TestFinalEnum1##static(){}kotlin.enums.EnumEntries + // Public signature: /TestFinalEnum1.entries.|7793286316162597646[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum2 + // Public signature: /TestFinalEnum2|null[0] + get(): EnumEntries + + // CHECK: + // Mangled name: TestFinalEnum1{}name + // Public signature: /TestFinalEnum1.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: TestFinalEnum1#(){}kotlin.String + // Public signature: /TestFinalEnum1.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum2#(){} + // Public signature: /TestFinalEnum2.x.|1482705010654679335[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: TestFinalEnum1{}ordinal + // Public signature: /TestFinalEnum1.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: TestFinalEnum1#(){}kotlin.Int + // Public signature: /TestFinalEnum1.ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum2.X1 + // Public signature: /TestFinalEnum2.X1|null[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: TestFinalEnum2 +// Public signature: /TestFinalEnum2|null[0] +enum class TestFinalEnum2 : Enum { + // CHECK: + // Mangled name: TestFinalEnum2{}x + // Public signature: /TestFinalEnum2.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: TestFinalEnum2#(){}kotlin.Int + // Public signature: /TestFinalEnum2.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum2#compareTo(TestFinalEnum2){} + // Public signature: /TestFinalEnum2.compareTo|-1005502274053294622[0] + get + + // CHECK: + // Mangled name: TestFinalEnum2#(kotlin.Int){} + // Public signature: /TestFinalEnum2.|-5182794243525578284[0] + private constructor(x: Int) /* primary */ + // CHECK: + // Mangled name: TestFinalEnum2.X1 + // Public signature: /TestFinalEnum2.X1|null[0] + X1 + + // CHECK JVM_IR: + // Mangled name: TestFinalEnum2#valueOf#static(kotlin.String){}TestFinalEnum2 + // Public signature: /TestFinalEnum2.valueOf|-780401890225518867[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum2#toString(){} + // Public signature: /TestFinalEnum2.toString|-1522858123163872138[0] + fun valueOf(value: String): TestFinalEnum2 + + // CHECK JVM_IR: + // Mangled name: TestFinalEnum2#values#static(){}kotlin.Array + // Public signature: /TestFinalEnum2.values|2453561414820060883[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum2#static{}entries + // Public signature: /TestFinalEnum2.entries|-5134227801081826149[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: TestFinalEnum2#clone(){}kotlin.Any + // Public signature: /TestFinalEnum2.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum2##static(){} + // Public signature: /TestFinalEnum2.entries.|-6068527377476727729[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: TestFinalEnum2#compareTo(TestFinalEnum2){}kotlin.Int + // Public signature: /TestFinalEnum2.compareTo|5381880420496293798[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum2{}name + // Public signature: /TestFinalEnum2.name|4231860309499509769[0] + /* fake */ override operator fun compareTo(other: TestFinalEnum2): Int + + // CHECK JVM_IR: + // Mangled name: TestFinalEnum2#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestFinalEnum2.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum2#(){} + // Public signature: /TestFinalEnum2.name.|5879344792307730109[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: TestFinalEnum2#hashCode(){}kotlin.Int + // Public signature: /TestFinalEnum2.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum2{}ordinal + // Public signature: /TestFinalEnum2.ordinal|1912745122988592376[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestFinalEnum2#toString(){}kotlin.String + // Public signature: /TestFinalEnum2.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum2#(){} + // Public signature: /TestFinalEnum2.ordinal.|8409904226035914023[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: TestFinalEnum2#static{}entries + // Public signature: /TestFinalEnum2.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: TestFinalEnum2##static(){}kotlin.enums.EnumEntries + // Public signature: /TestFinalEnum2.entries.|7934736600478259880[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum3#(){} + // Public signature: /TestFinalEnum3.|-5645683436151566731[0] + get(): EnumEntries + + // CHECK: + // Mangled name: TestFinalEnum2{}name + // Public signature: /TestFinalEnum2.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: TestFinalEnum2#(){}kotlin.String + // Public signature: /TestFinalEnum2.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum3#valueOf#static(kotlin.String){} + // Public signature: /TestFinalEnum3.valueOf|-4683474617854611729[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: TestFinalEnum2{}ordinal + // Public signature: /TestFinalEnum2.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: TestFinalEnum2#(){}kotlin.Int + // Public signature: /TestFinalEnum2.ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum3#compareTo(TestFinalEnum3){} + // Public signature: /TestFinalEnum3.compareTo|6918020062090955749[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: TestFinalEnum3 +// Public signature: /TestFinalEnum3|null[0] +enum class TestFinalEnum3 : Enum { + // CHECK: + // Mangled name: TestFinalEnum3#(){} + // Public signature: /TestFinalEnum3.|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK: + // Mangled name: TestFinalEnum3.X1 + // Public signature: /TestFinalEnum3.X1|null[0] + X1 + + // CHECK JVM_IR: + // Mangled name: TestFinalEnum3#valueOf#static(kotlin.String){}TestFinalEnum3 + // Public signature: /TestFinalEnum3.valueOf|-7660458486476045816[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum3#doStuff(){} + // Public signature: /TestFinalEnum3.doStuff|7141990572475111133[0] + fun valueOf(value: String): TestFinalEnum3 + + // CHECK JVM_IR: + // Mangled name: TestFinalEnum3#values#static(){}kotlin.Array + // Public signature: /TestFinalEnum3.values|4010199590602977121[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum3#static{}entries + // Public signature: /TestFinalEnum3.entries|-5134227801081826149[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: TestFinalEnum3#clone(){}kotlin.Any + // Public signature: /TestFinalEnum3.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum3##static(){} + // Public signature: /TestFinalEnum3.entries.|-6068527377476727729[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: TestFinalEnum3#compareTo(TestFinalEnum3){}kotlin.Int + // Public signature: /TestFinalEnum3.compareTo|3973328039045428634[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum3{}name + // Public signature: /TestFinalEnum3.name|4231860309499509769[0] + /* fake */ override operator fun compareTo(other: TestFinalEnum3): Int + + // CHECK JVM_IR: + // Mangled name: TestFinalEnum3#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestFinalEnum3.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum3#(){} + // Public signature: /TestFinalEnum3.name.|5879344792307730109[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: TestFinalEnum3#hashCode(){}kotlin.Int + // Public signature: /TestFinalEnum3.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum3{}ordinal + // Public signature: /TestFinalEnum3.ordinal|1912745122988592376[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestFinalEnum3#toString(){}kotlin.String + // Public signature: /TestFinalEnum3.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestFinalEnum3#(){} + // Public signature: /TestFinalEnum3.ordinal.|8409904226035914023[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: TestFinalEnum3#doStuff(){} + // Public signature: /TestFinalEnum3.doStuff|7141990572475111133[0] + fun doStuff(): Unit + + // CHECK: + // Mangled name: TestFinalEnum3#static{}entries + // Public signature: /TestFinalEnum3.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: TestFinalEnum3##static(){}kotlin.enums.EnumEntries + // Public signature: /TestFinalEnum3.entries.|-3503795261994851998[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum1.X1 + // Public signature: /TestOpenEnum1.X1|null[0] + get(): EnumEntries + + // CHECK: + // Mangled name: TestFinalEnum3{}name + // Public signature: /TestFinalEnum3.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: TestFinalEnum3#(){}kotlin.String + // Public signature: /TestFinalEnum3.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum1.X1#(){} + // Public signature: /TestOpenEnum1.X1..|-5645683436151566731[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: TestFinalEnum3{}ordinal + // Public signature: /TestFinalEnum3.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: TestFinalEnum3#(){}kotlin.Int + // Public signature: /TestFinalEnum3.ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum1.X1#equals(kotlin.Any?){} + // Public signature: /TestOpenEnum1.X1..equals|4638265728071529943[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: TestOpenEnum1 +// Public signature: /TestOpenEnum1|null[0] +open enum class TestOpenEnum1 : Enum { + // CHECK: + // Mangled name: TestOpenEnum1#(){} + // Public signature: /TestOpenEnum1.|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK: + // Mangled name: TestOpenEnum1.X1 + // Public signature: /TestOpenEnum1.X1|null[0] + + X1 + // CHECK: + // Mangled name: TestOpenEnum1.X1 + // Public signature: /TestOpenEnum1.X1.|null[0] + private enum entry class X1 : TestOpenEnum1 { + // CHECK: + // Mangled name: TestOpenEnum1.X1#(){} + // Public signature: /TestOpenEnum1.X1..|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK JVM_IR: + // Mangled name: TestOpenEnum1.X1#clone(){}kotlin.Any + // Public signature: /TestOpenEnum1.X1..clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum1.X1#(){} + // Public signature: /TestOpenEnum1.X1..ordinal.|8409904226035914023[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: TestOpenEnum1.X1#compareTo(TestOpenEnum1){}kotlin.Int + // Public signature: /TestOpenEnum1.X1..compareTo|5969408945777389066[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum1#valueOf#static(kotlin.String){} + // Public signature: /TestOpenEnum1.valueOf|-4683474617854611729[0] + /* fake */ override operator fun compareTo(other: TestOpenEnum1): Int + + // CHECK JVM_IR: + // Mangled name: TestOpenEnum1.X1#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestOpenEnum1.X1..equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum1#values#static(){} + // Public signature: /TestOpenEnum1.values|-8715569000920726747[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: TestOpenEnum1.X1#hashCode(){}kotlin.Int + // Public signature: /TestOpenEnum1.X1..hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum1#compareTo(TestOpenEnum1){} + // Public signature: /TestOpenEnum1.compareTo|1125042758162309284[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestOpenEnum1.X1#toString(){}kotlin.String + // Public signature: /TestOpenEnum1.X1..toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum1#equals(kotlin.Any?){} + // Public signature: /TestOpenEnum1.equals|4638265728071529943[0] + override fun toString(): String + + // CHECK: + // Mangled name: TestOpenEnum1.X1{}name + // Public signature: /TestOpenEnum1.X1..name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: TestOpenEnum1.X1#(){}kotlin.String + // Public signature: /TestOpenEnum1.X1..name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum1#toString(){} + // Public signature: /TestOpenEnum1.toString|-1522858123163872138[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: TestOpenEnum1.X1{}ordinal + // Public signature: /TestOpenEnum1.X1..ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: TestOpenEnum1.X1#(){}kotlin.Int + // Public signature: /TestOpenEnum1.X1..ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum1##static(){} + // Public signature: /TestOpenEnum1.entries.|-6068527377476727729[0] + /* fake */ override get(): Int + + } + + // CHECK JVM_IR: + // Mangled name: TestOpenEnum1#valueOf#static(kotlin.String){}TestOpenEnum1 + // Public signature: /TestOpenEnum1.valueOf|-3895494988240235128[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum1{}name + // Public signature: /TestOpenEnum1.name|4231860309499509769[0] + fun valueOf(value: String): TestOpenEnum1 + + // CHECK JVM_IR: + // Mangled name: TestOpenEnum1#values#static(){}kotlin.Array + // Public signature: /TestOpenEnum1.values|3800638804003217382[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum1#(){} + // Public signature: /TestOpenEnum1.name.|5879344792307730109[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: TestOpenEnum1#clone(){}kotlin.Any + // Public signature: /TestOpenEnum1.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum1{}ordinal + // Public signature: /TestOpenEnum1.ordinal|1912745122988592376[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: TestOpenEnum1#compareTo(TestOpenEnum1){}kotlin.Int + // Public signature: /TestOpenEnum1.compareTo|5969408945777389066[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum1#(){} + // Public signature: /TestOpenEnum1.ordinal.|8409904226035914023[0] + /* fake */ override operator fun compareTo(other: TestOpenEnum1): Int + + // CHECK JVM_IR: + // Mangled name: TestOpenEnum1#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestOpenEnum1.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum2 + // Public signature: /TestOpenEnum2|null[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: TestOpenEnum1#hashCode(){}kotlin.Int + // Public signature: /TestOpenEnum1.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum2#(){} + // Public signature: /TestOpenEnum2.|-5645683436151566731[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestOpenEnum1#toString(){}kotlin.String + // Public signature: /TestOpenEnum1.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum2.X1 + // Public signature: /TestOpenEnum2.X1|null[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: TestOpenEnum1#static{}entries + // Public signature: /TestOpenEnum1.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: TestOpenEnum1##static(){}kotlin.enums.EnumEntries + // Public signature: /TestOpenEnum1.entries.|-4208283468290053503[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum2.X1#(){} + // Public signature: /TestOpenEnum2.X1..|-5645683436151566731[0] + get(): EnumEntries + + // CHECK: + // Mangled name: TestOpenEnum1{}name + // Public signature: /TestOpenEnum1.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: TestOpenEnum1#(){}kotlin.String + // Public signature: /TestOpenEnum1.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum2.X1#equals(kotlin.Any?){} + // Public signature: /TestOpenEnum2.X1..equals|4638265728071529943[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: TestOpenEnum1{}ordinal + // Public signature: /TestOpenEnum1.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: TestOpenEnum1#(){}kotlin.Int + // Public signature: /TestOpenEnum1.ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum2.X1#toString(){} + // Public signature: /TestOpenEnum2.X1..toString|-1522858123163872138[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: TestOpenEnum2 +// Public signature: /TestOpenEnum2|null[0] +open enum class TestOpenEnum2 : Enum { + // CHECK: + // Mangled name: TestOpenEnum2#(){} + // Public signature: /TestOpenEnum2.|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK: + // Mangled name: TestOpenEnum2.X1 + // Public signature: /TestOpenEnum2.X1|null[0] + + X1 + // CHECK: + // Mangled name: TestOpenEnum2.X1 + // Public signature: /TestOpenEnum2.X1.|null[0] + private enum entry class X1 : TestOpenEnum2 { + // CHECK: + // Mangled name: TestOpenEnum2.X1#(){} + // Public signature: /TestOpenEnum2.X1..|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK JVM_IR: + // Mangled name: TestOpenEnum2.X1#clone(){}kotlin.Any + // Public signature: /TestOpenEnum2.X1..clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum2#valueOf#static(kotlin.String){} + // Public signature: /TestOpenEnum2.valueOf|-4683474617854611729[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: TestOpenEnum2.X1#compareTo(TestOpenEnum2){}kotlin.Int + // Public signature: /TestOpenEnum2.X1..compareTo|-5309775767017986668[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum2#values#static(){} + // Public signature: /TestOpenEnum2.values|-8715569000920726747[0] + /* fake */ override operator fun compareTo(other: TestOpenEnum2): Int + + // CHECK JVM_IR: + // Mangled name: TestOpenEnum2.X1#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestOpenEnum2.X1..equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum2#compareTo(TestOpenEnum2){} + // Public signature: /TestOpenEnum2.compareTo|3305950527143248830[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: TestOpenEnum2.X1#hashCode(){}kotlin.Int + // Public signature: /TestOpenEnum2.X1..hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum2#equals(kotlin.Any?){} + // Public signature: /TestOpenEnum2.equals|4638265728071529943[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestOpenEnum2.X1#toString(){}kotlin.String + // Public signature: /TestOpenEnum2.X1..toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum2#hashCode(){} + // Public signature: /TestOpenEnum2.hashCode|3409210261493131192[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: TestOpenEnum2.X1#foo(){} + // Public signature: /TestOpenEnum2.X1..foo|-1041209573719867811[0] + override fun foo(): Unit + + // CHECK: + // Mangled name: TestOpenEnum2.X1{}name + // Public signature: /TestOpenEnum2.X1..name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: TestOpenEnum2.X1#(){}kotlin.String + // Public signature: /TestOpenEnum2.X1..name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum2#static{}entries + // Public signature: /TestOpenEnum2.entries|-5134227801081826149[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: TestOpenEnum2.X1{}ordinal + // Public signature: /TestOpenEnum2.X1..ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: TestOpenEnum2.X1#(){}kotlin.Int + // Public signature: /TestOpenEnum2.X1..ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum2{}name + // Public signature: /TestOpenEnum2.name|4231860309499509769[0] + /* fake */ override get(): Int + + } + + // CHECK JVM_IR: + // Mangled name: TestOpenEnum2#valueOf#static(kotlin.String){}TestOpenEnum2 + // Public signature: /TestOpenEnum2.valueOf|-6277423759061924196[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum2#(){} + // Public signature: /TestOpenEnum2.name.|5879344792307730109[0] + fun valueOf(value: String): TestOpenEnum2 + + // CHECK JVM_IR: + // Mangled name: TestOpenEnum2#values#static(){}kotlin.Array + // Public signature: /TestOpenEnum2.values|8731365896810749322[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum2{}ordinal + // Public signature: /TestOpenEnum2.ordinal|1912745122988592376[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: TestOpenEnum2#clone(){}kotlin.Any + // Public signature: /TestOpenEnum2.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestOpenEnum2#(){} + // Public signature: /TestOpenEnum2.ordinal.|8409904226035914023[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: TestOpenEnum2#compareTo(TestOpenEnum2){}kotlin.Int + // Public signature: /TestOpenEnum2.compareTo|-5309775767017986668[0] + // CHECK JS_IR NATIVE: + // Mangled name: IFoo + // Public signature: /IFoo|null[0] + /* fake */ override operator fun compareTo(other: TestOpenEnum2): Int + + // CHECK JVM_IR: + // Mangled name: TestOpenEnum2#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestOpenEnum2.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: IFoo#foo(){} + // Public signature: /IFoo.foo|-1041209573719867811[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: TestOpenEnum2#hashCode(){}kotlin.Int + // Public signature: /TestOpenEnum2.hashCode|-8048879360829830756[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestOpenEnum2#toString(){}kotlin.String + // Public signature: /TestOpenEnum2.toString|6958853723545266802[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: TestOpenEnum2#foo(){} + // Public signature: /TestOpenEnum2.foo|-1041209573719867811[0] + open fun foo(): Unit + + // CHECK: + // Mangled name: TestOpenEnum2#static{}entries + // Public signature: /TestOpenEnum2.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: TestOpenEnum2##static(){}kotlin.enums.EnumEntries + // Public signature: /TestOpenEnum2.entries.|7144795131978512560[0] + get(): EnumEntries + + // CHECK: + // Mangled name: TestOpenEnum2{}name + // Public signature: /TestOpenEnum2.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: TestOpenEnum2#(){}kotlin.String + // Public signature: /TestOpenEnum2.name.|-8006111524522882650[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: TestOpenEnum2{}ordinal + // Public signature: /TestOpenEnum2.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: TestOpenEnum2#(){}kotlin.Int + // Public signature: /TestOpenEnum2.ordinal.|-6902664390061762634[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: IFoo +// Public signature: /IFoo|null[0] +interface IFoo { + + // CHECK: + // Mangled name: IFoo#foo(){} + // Public signature: /IFoo.foo|-1041209573719867811[0] + abstract fun foo(): Unit + +} + diff --git a/compiler/testData/ir/irText/classes/enumEntries.kt b/compiler/testData/ir/irText/classes/enumEntries.kt index 211eef071b1..1a71cc6cae1 100644 --- a/compiler/testData/ir/irText/classes/enumEntries.kt +++ b/compiler/testData/ir/irText/classes/enumEntries.kt @@ -3,6 +3,9 @@ // 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/enumEntries.sig.kt.txt b/compiler/testData/ir/irText/classes/enumEntries.sig.kt.txt new file mode 100644 index 00000000000..00b82e8cadd --- /dev/null +++ b/compiler/testData/ir/irText/classes/enumEntries.sig.kt.txt @@ -0,0 +1,88 @@ +// CHECK: +// Mangled name: MyEnum +// Public signature: /MyEnum|null[0] +enum class MyEnum : Enum { + // CHECK: + // Mangled name: MyEnum#(){} + // Public signature: /MyEnum.|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK: + // Mangled name: MyEnum.Nope + // Public signature: /MyEnum.Nope|null[0] + Nope + + // CHECK: + // Mangled name: MyEnum.Ok + // Public signature: /MyEnum.Ok|null[0] + Ok + + // CHECK JVM_IR: + // Mangled name: MyEnum#valueOf#static(kotlin.String){}MyEnum + // Public signature: /MyEnum.valueOf|4316550590519800984[0] + fun valueOf(value: String): MyEnum + + // CHECK JVM_IR: + // Mangled name: MyEnum#values#static(){}kotlin.Array + // Public signature: /MyEnum.values|3097625172661156808[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: MyEnum#clone(){}kotlin.Any + // Public signature: /MyEnum.clone|-6903128697527593263[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: MyEnum#compareTo(MyEnum){}kotlin.Int + // Public signature: /MyEnum.compareTo|2015858924903177055[0] + /* fake */ override operator fun compareTo(other: MyEnum): Int + + // CHECK JVM_IR: + // Mangled name: MyEnum#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /MyEnum.equals|722809408929142791[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: MyEnum#hashCode(){}kotlin.Int + // Public signature: /MyEnum.hashCode|-8048879360829830756[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: MyEnum#toString(){}kotlin.String + // Public signature: /MyEnum.toString|6958853723545266802[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: MyEnum#static{}entries + // Public signature: /MyEnum.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: MyEnum##static(){}kotlin.enums.EnumEntries + // Public signature: /MyEnum.entries.|-3922959509726908718[0] + get(): EnumEntries + + // CHECK: + // Mangled name: MyEnum{}name + // Public signature: /MyEnum.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: MyEnum#(){}kotlin.String + // Public signature: /MyEnum.name.|-8006111524522882650[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: MyEnum{}ordinal + // Public signature: /MyEnum.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: MyEnum#(){}kotlin.Int + // Public signature: /MyEnum.ordinal.|-6902664390061762634[0] + /* fake */ override get(): Int + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.enums.EnumEntries +// Public signature: /box|700999420470824741[0] +@OptIn(markerClass = [ExperimentalStdlibApi::class]) +fun box(): EnumEntries + diff --git a/compiler/testData/ir/irText/classes/enumWithMultipleCtors.kt b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.kt index 1eaa4eb189f..51551c51877 100644 --- a/compiler/testData/ir/irText/classes/enumWithMultipleCtors.kt +++ b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.kt @@ -1,5 +1,9 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57775, KT-57777 + enum class A { X("asd"), Y() { diff --git a/compiler/testData/ir/irText/classes/enumWithMultipleCtors.sig.kt.txt b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.sig.kt.txt new file mode 100644 index 00000000000..67d5a357ebd --- /dev/null +++ b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.sig.kt.txt @@ -0,0 +1,292 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +open enum class A : Enum { + // CHECK: + // Mangled name: A{}prop1 + // Public signature: /A.prop1|-8329482664683066904[0] + val prop1: String + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.String + // Public signature: /A.prop1.|-4492148362286235808[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.prop1.|-5264940751743936228[0] + get + + // CHECK: + // Mangled name: A{}prop2 + // Public signature: /A.prop2|4028676822563871521[0] + val prop2: String + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.String + // Public signature: /A.prop2.|-8475233937604972170[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.prop2.|-7428780384219162019[0] + get + + // CHECK: + // Mangled name: A{}prop3 + // Public signature: /A.prop3|-8425624005164692994[0] + var prop3: String + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.String + // Public signature: /A.prop3.|-7199457926449641523[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.prop3.|-2432765917107722645[0] + get + // CHECK: + // Mangled name: A#(kotlin.String){} + // Public signature: /A.prop3.|-8957114365133646196[0] + set + + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + private constructor() + // CHECK: + // Mangled name: A#(kotlin.String){} + // Public signature: /A.|1280618353163213788[0] + private constructor(arg: String) + // CHECK: + // Mangled name: A#(kotlin.Int){} + // Public signature: /A.|-5182794243525578284[0] + private constructor(x: Int) + // CHECK: + // Mangled name: A.X + // Public signature: /A.X|null[0] + X + + // CHECK: + // Mangled name: A.Y + // Public signature: /A.Y|null[0] + + Y + // CHECK: + // Mangled name: A.Y + // Public signature: /A.Y.|null[0] + private enum entry class Y : A { + // CHECK: + // Mangled name: A.Y#(){} + // Public signature: /A.Y..|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK JVM_IR: + // Mangled name: A.Y#clone(){}kotlin.Any + // Public signature: /A.Y..clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: A.Y#compareTo(A){} + // Public signature: /A.Y..compareTo|5303387127644845713[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: A.Y#compareTo(A){}kotlin.Int + // Public signature: /A.Y..compareTo|-315052537630360750[0] + // CHECK JS_IR NATIVE: + // Mangled name: A.Y#equals(kotlin.Any?){} + // Public signature: /A.Y..equals|4638265728071529943[0] + /* fake */ override operator fun compareTo(other: A): Int + + // CHECK JVM_IR: + // Mangled name: A.Y#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /A.Y..equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: A.Y#hashCode(){} + // Public signature: /A.Y..hashCode|3409210261493131192[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: A.Y#hashCode(){}kotlin.Int + // Public signature: /A.Y..hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: A.Y#toString(){} + // Public signature: /A.Y..toString|-1522858123163872138[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: A.Y#toString(){}kotlin.String + // Public signature: /A.Y..toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: A.Y#f(){} + // Public signature: /A.Y..f|5316533450599009716[0] + /* fake */ override fun toString(): String + + // CHECK JVM_IR: + // Mangled name: A.Y#f(){}kotlin.String + // Public signature: /A.Y..f|9098388873611041001[0] + // CHECK JS_IR NATIVE: + // Mangled name: A.Y{}name + // Public signature: /A.Y..name|4231860309499509769[0] + override fun f(): String + + // CHECK: + // Mangled name: A.Y{}name + // Public signature: /A.Y..name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: A.Y#(){}kotlin.String + // Public signature: /A.Y..name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: A.Y{}ordinal + // Public signature: /A.Y..ordinal|1912745122988592376[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: A.Y{}ordinal + // Public signature: /A.Y..ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: A.Y#(){}kotlin.Int + // Public signature: /A.Y..ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: A.Y{}prop1 + // Public signature: /A.Y..prop1|-8329482664683066904[0] + /* fake */ override get(): Int + + // CHECK: + // Mangled name: A.Y{}prop1 + // Public signature: /A.Y..prop1|-8329482664683066904[0] + /* fake */ override val prop1: String + // CHECK JVM_IR: + // Mangled name: A.Y#(){}kotlin.String + // Public signature: /A.Y..prop1.|-4492148362286235808[0] + // CHECK JS_IR NATIVE: + // Mangled name: A.Y{}prop2 + // Public signature: /A.Y..prop2|4028676822563871521[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: A.Y{}prop2 + // Public signature: /A.Y..prop2|4028676822563871521[0] + /* fake */ override val prop2: String + // CHECK JVM_IR: + // Mangled name: A.Y#(){}kotlin.String + // Public signature: /A.Y..prop2.|-8475233937604972170[0] + // CHECK JS_IR NATIVE: + // Mangled name: A.Y{}prop3 + // Public signature: /A.Y..prop3|-8425624005164692994[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: A.Y{}prop3 + // Public signature: /A.Y..prop3|-8425624005164692994[0] + /* fake */ override var prop3: String + // CHECK JVM_IR: + // Mangled name: A.Y#(){}kotlin.String + // Public signature: /A.Y..prop3.|-7199457926449641523[0] + // CHECK JS_IR NATIVE: + // Mangled name: A.Y#(kotlin.String){} + // Public signature: /A.Y..prop3.|-8957114365133646196[0] + /* fake */ override get(): String + // CHECK: + // Mangled name: A.Y#(kotlin.String){} + // Public signature: /A.Y..prop3.|-8957114365133646196[0] + /* fake */ override set(: String): Unit + + } + + // CHECK: + // Mangled name: A.Z + // Public signature: /A.Z|null[0] + Z + + // CHECK JVM_IR: + // Mangled name: A#valueOf#static(kotlin.String){}A + // Public signature: /A.valueOf|8636923007498802918[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#values#static(){} + // Public signature: /A.values|-8715569000920726747[0] + fun valueOf(value: String): A + + // CHECK JVM_IR: + // Mangled name: A#values#static(){}kotlin.Array + // Public signature: /A.values|5753238680897834936[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#compareTo(A){} + // Public signature: /A.compareTo|5303387127644845713[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: A#clone(){}kotlin.Any + // Public signature: /A.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#equals(kotlin.Any?){} + // Public signature: /A.equals|4638265728071529943[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: A#compareTo(A){}kotlin.Int + // Public signature: /A.compareTo|-315052537630360750[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#hashCode(){} + // Public signature: /A.hashCode|3409210261493131192[0] + /* fake */ override operator fun compareTo(other: A): Int + + // CHECK JVM_IR: + // Mangled name: A#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /A.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#toString(){} + // Public signature: /A.toString|-1522858123163872138[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: A#hashCode(){}kotlin.Int + // Public signature: /A.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#f(){} + // Public signature: /A.f|5316533450599009716[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: A#toString(){}kotlin.String + // Public signature: /A.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#static{}entries + // Public signature: /A.entries|-5134227801081826149[0] + /* fake */ override fun toString(): String + + // CHECK JVM_IR: + // Mangled name: A#f(){}kotlin.String + // Public signature: /A.f|9098388873611041001[0] + // CHECK JS_IR NATIVE: + // Mangled name: A##static(){} + // Public signature: /A.entries.|-6068527377476727729[0] + open fun f(): String + + // CHECK: + // Mangled name: A#static{}entries + // Public signature: /A.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: A##static(){}kotlin.enums.EnumEntries + // Public signature: /A.entries.|3279885591622842062[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.name.|5879344792307730109[0] + get(): EnumEntries + + // CHECK: + // Mangled name: A{}name + // Public signature: /A.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.String + // Public signature: /A.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.ordinal.|8409904226035914023[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: A{}ordinal + // Public signature: /A.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.ordinal.|-6902664390061762634[0] + /* fake */ override get(): Int + +} + diff --git a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.kt b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.kt index 0aa402785a1..07b732a3c24 100644 --- a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.kt +++ b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.kt @@ -2,6 +2,9 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57775, KT-57777 + enum class Test0(val x: Int) { ZERO; constructor() : this(0) diff --git a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.sig.kt.txt b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.sig.kt.txt new file mode 100644 index 00000000000..a0fa62666dd --- /dev/null +++ b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.sig.kt.txt @@ -0,0 +1,557 @@ +// CHECK: +// Mangled name: Test0 +// Public signature: /Test0|null[0] +enum class Test0 : Enum { + // CHECK: + // Mangled name: Test0{}x + // Public signature: /Test0.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: Test0#(){}kotlin.Int + // Public signature: /Test0.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test0#(){} + // Public signature: /Test0.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Test0#(){} + // Public signature: /Test0.|-5645683436151566731[0] + private constructor() + // CHECK: + // Mangled name: Test0#(kotlin.Int){} + // Public signature: /Test0.|-5182794243525578284[0] + private constructor(x: Int) /* primary */ + // CHECK: + // Mangled name: Test0.ZERO + // Public signature: /Test0.ZERO|null[0] + ZERO + + // CHECK JVM_IR: + // Mangled name: Test0#valueOf#static(kotlin.String){}Test0 + // Public signature: /Test0.valueOf|2435631791442896277[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test0#valueOf#static(kotlin.String){} + // Public signature: /Test0.valueOf|-4683474617854611729[0] + fun valueOf(value: String): Test0 + + // CHECK JVM_IR: + // Mangled name: Test0#values#static(){}kotlin.Array + // Public signature: /Test0.values|5003914817845036921[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test0#values#static(){} + // Public signature: /Test0.values|-8715569000920726747[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: Test0#clone(){}kotlin.Any + // Public signature: /Test0.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test0#compareTo(Test0){} + // Public signature: /Test0.compareTo|204856484322831463[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: Test0#compareTo(Test0){}kotlin.Int + // Public signature: /Test0.compareTo|3359014647054499559[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test0#equals(kotlin.Any?){} + // Public signature: /Test0.equals|4638265728071529943[0] + /* fake */ override operator fun compareTo(other: Test0): Int + + // CHECK JVM_IR: + // Mangled name: Test0#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Test0.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test0#hashCode(){} + // Public signature: /Test0.hashCode|3409210261493131192[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Test0#hashCode(){}kotlin.Int + // Public signature: /Test0.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test0#toString(){} + // Public signature: /Test0.toString|-1522858123163872138[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Test0#toString(){}kotlin.String + // Public signature: /Test0.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test0#static{}entries + // Public signature: /Test0.entries|-5134227801081826149[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: Test0#static{}entries + // Public signature: /Test0.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: Test0##static(){}kotlin.enums.EnumEntries + // Public signature: /Test0.entries.|-2219920410598886791[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test0{}name + // Public signature: /Test0.name|4231860309499509769[0] + get(): EnumEntries + + // CHECK: + // Mangled name: Test0{}name + // Public signature: /Test0.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: Test0#(){}kotlin.String + // Public signature: /Test0.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test0{}ordinal + // Public signature: /Test0.ordinal|1912745122988592376[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Test0{}ordinal + // Public signature: /Test0.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: Test0#(){}kotlin.Int + // Public signature: /Test0.ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1 + // Public signature: /Test1|null[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: Test1 +// Public signature: /Test1|null[0] +enum class Test1 : Enum { + // CHECK: + // Mangled name: Test1{}x + // Public signature: /Test1.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: Test1#(){}kotlin.Int + // Public signature: /Test1.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.|-5645683436151566731[0] + get + + // CHECK: + // Mangled name: Test1#(){} + // Public signature: /Test1.|-5645683436151566731[0] + private constructor() + // CHECK: + // Mangled name: Test1#(kotlin.Int){} + // Public signature: /Test1.|-5182794243525578284[0] + private constructor(x: Int) /* primary */ + // CHECK: + // Mangled name: Test1.ONE + // Public signature: /Test1.ONE|null[0] + ONE + + // CHECK: + // Mangled name: Test1.ZERO + // Public signature: /Test1.ZERO|null[0] + ZERO + + // CHECK JVM_IR: + // Mangled name: Test1#valueOf#static(kotlin.String){}Test1 + // Public signature: /Test1.valueOf|7465772014771661384[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#values#static(){} + // Public signature: /Test1.values|-8715569000920726747[0] + fun valueOf(value: String): Test1 + + // CHECK JVM_IR: + // Mangled name: Test1#values#static(){}kotlin.Array + // Public signature: /Test1.values|1411653061731083303[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#compareTo(Test1){} + // Public signature: /Test1.compareTo|-311238387817104902[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: Test1#clone(){}kotlin.Any + // Public signature: /Test1.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#equals(kotlin.Any?){} + // Public signature: /Test1.equals|4638265728071529943[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: Test1#compareTo(Test1){}kotlin.Int + // Public signature: /Test1.compareTo|851560667494191433[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#hashCode(){} + // Public signature: /Test1.hashCode|3409210261493131192[0] + /* fake */ override operator fun compareTo(other: Test1): Int + + // CHECK JVM_IR: + // Mangled name: Test1#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Test1.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#toString(){} + // Public signature: /Test1.toString|-1522858123163872138[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Test1#hashCode(){}kotlin.Int + // Public signature: /Test1.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#static{}entries + // Public signature: /Test1.entries|-5134227801081826149[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Test1#toString(){}kotlin.String + // Public signature: /Test1.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1##static(){} + // Public signature: /Test1.entries.|-6068527377476727729[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: Test1#static{}entries + // Public signature: /Test1.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: Test1##static(){}kotlin.enums.EnumEntries + // Public signature: /Test1.entries.|-7972344572232634128[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.name.|5879344792307730109[0] + get(): EnumEntries + + // CHECK: + // Mangled name: Test1{}name + // Public signature: /Test1.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: Test1#(){}kotlin.String + // Public signature: /Test1.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.ordinal.|8409904226035914023[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Test1{}ordinal + // Public signature: /Test1.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: Test1#(){}kotlin.Int + // Public signature: /Test1.ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2{}x + // Public signature: /Test2.x|-8060530855978347579[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: Test2 +// Public signature: /Test2|null[0] +abstract enum class Test2 : Enum { + // CHECK: + // Mangled name: Test2{}x + // Public signature: /Test2.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: Test2#(){}kotlin.Int + // Public signature: /Test2.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#(kotlin.Int){} + // Public signature: /Test2.|-5182794243525578284[0] + get + + // CHECK: + // Mangled name: Test2#(){} + // Public signature: /Test2.|-5645683436151566731[0] + private constructor() + // CHECK: + // Mangled name: Test2#(kotlin.Int){} + // Public signature: /Test2.|-5182794243525578284[0] + private constructor(x: Int) /* primary */ + // CHECK: + // Mangled name: Test2.ONE + // Public signature: /Test2.ONE|null[0] + + ONE + // CHECK: + // Mangled name: Test2.ONE + // Public signature: /Test2.ONE.|null[0] + private enum entry class ONE : Test2 { + // CHECK: + // Mangled name: Test2.ONE#(){} + // Public signature: /Test2.ONE..|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK JVM_IR: + // Mangled name: Test2.ONE#clone(){}kotlin.Any + // Public signature: /Test2.ONE..clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2.ONE#hashCode(){} + // Public signature: /Test2.ONE..hashCode|3409210261493131192[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: Test2.ONE#compareTo(Test2){}kotlin.Int + // Public signature: /Test2.ONE..compareTo|-4058923296557042542[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2.ONE#toString(){} + // Public signature: /Test2.ONE..toString|-1522858123163872138[0] + /* fake */ override operator fun compareTo(other: Test2): Int + + // CHECK JVM_IR: + // Mangled name: Test2.ONE#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Test2.ONE..equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2.ONE#foo(){} + // Public signature: /Test2.ONE..foo|-1041209573719867811[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Test2.ONE#hashCode(){}kotlin.Int + // Public signature: /Test2.ONE..hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2.ONE{}name + // Public signature: /Test2.ONE..name|4231860309499509769[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Test2.ONE#toString(){}kotlin.String + // Public signature: /Test2.ONE..toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2.ONE#(){} + // Public signature: /Test2.ONE..name.|5879344792307730109[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: Test2.ONE#foo(){} + // Public signature: /Test2.ONE..foo|-1041209573719867811[0] + override fun foo(): Unit + + // CHECK: + // Mangled name: Test2.ONE{}name + // Public signature: /Test2.ONE..name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: Test2.ONE#(){}kotlin.String + // Public signature: /Test2.ONE..name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2.ONE{}x + // Public signature: /Test2.ONE..x|-8060530855978347579[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Test2.ONE{}ordinal + // Public signature: /Test2.ONE..ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: Test2.ONE#(){}kotlin.Int + // Public signature: /Test2.ONE..ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2.ZERO + // Public signature: /Test2.ZERO|null[0] + /* fake */ override get(): Int + + // CHECK: + // Mangled name: Test2.ONE{}x + // Public signature: /Test2.ONE..x|-8060530855978347579[0] + /* fake */ override val x: Int + // CHECK JVM_IR: + // Mangled name: Test2.ONE#(){}kotlin.Int + // Public signature: /Test2.ONE..x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2.ZERO#(){} + // Public signature: /Test2.ZERO..|-5645683436151566731[0] + /* fake */ override get(): Int + + } + + // CHECK: + // Mangled name: Test2.ZERO + // Public signature: /Test2.ZERO|null[0] + + ZERO + // CHECK: + // Mangled name: Test2.ZERO + // Public signature: /Test2.ZERO.|null[0] + private enum entry class ZERO : Test2 { + // CHECK: + // Mangled name: Test2.ZERO#(){} + // Public signature: /Test2.ZERO..|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK JVM_IR: + // Mangled name: Test2.ZERO#clone(){}kotlin.Any + // Public signature: /Test2.ZERO..clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2.ZERO#toString(){} + // Public signature: /Test2.ZERO..toString|-1522858123163872138[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: Test2.ZERO#compareTo(Test2){}kotlin.Int + // Public signature: /Test2.ZERO..compareTo|-4058923296557042542[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2.ZERO#foo(){} + // Public signature: /Test2.ZERO..foo|-1041209573719867811[0] + /* fake */ override operator fun compareTo(other: Test2): Int + + // CHECK JVM_IR: + // Mangled name: Test2.ZERO#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Test2.ZERO..equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2.ZERO{}name + // Public signature: /Test2.ZERO..name|4231860309499509769[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Test2.ZERO#hashCode(){}kotlin.Int + // Public signature: /Test2.ZERO..hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2.ZERO#(){} + // Public signature: /Test2.ZERO..name.|5879344792307730109[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Test2.ZERO#toString(){}kotlin.String + // Public signature: /Test2.ZERO..toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2.ZERO{}ordinal + // Public signature: /Test2.ZERO..ordinal|1912745122988592376[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: Test2.ZERO#foo(){} + // Public signature: /Test2.ZERO..foo|-1041209573719867811[0] + override fun foo(): Unit + + // CHECK: + // Mangled name: Test2.ZERO{}name + // Public signature: /Test2.ZERO..name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: Test2.ZERO#(){}kotlin.String + // Public signature: /Test2.ZERO..name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2.ZERO#(){} + // Public signature: /Test2.ZERO..x.|1482705010654679335[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Test2.ZERO{}ordinal + // Public signature: /Test2.ZERO..ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: Test2.ZERO#(){}kotlin.Int + // Public signature: /Test2.ZERO..ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#values#static(){} + // Public signature: /Test2.values|-8715569000920726747[0] + /* fake */ override get(): Int + + // CHECK: + // Mangled name: Test2.ZERO{}x + // Public signature: /Test2.ZERO..x|-8060530855978347579[0] + /* fake */ override val x: Int + // CHECK JVM_IR: + // Mangled name: Test2.ZERO#(){}kotlin.Int + // Public signature: /Test2.ZERO..x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#equals(kotlin.Any?){} + // Public signature: /Test2.equals|4638265728071529943[0] + /* fake */ override get(): Int + + } + + // CHECK JVM_IR: + // Mangled name: Test2#valueOf#static(kotlin.String){}Test2 + // Public signature: /Test2.valueOf|-8667399781449349710[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#hashCode(){} + // Public signature: /Test2.hashCode|3409210261493131192[0] + fun valueOf(value: String): Test2 + + // CHECK JVM_IR: + // Mangled name: Test2#values#static(){}kotlin.Array + // Public signature: /Test2.values|-1286825984033907824[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#toString(){} + // Public signature: /Test2.toString|-1522858123163872138[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: Test2#clone(){}kotlin.Any + // Public signature: /Test2.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#foo(){} + // Public signature: /Test2.foo|-1041209573719867811[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: Test2#compareTo(Test2){}kotlin.Int + // Public signature: /Test2.compareTo|-4058923296557042542[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#static{}entries + // Public signature: /Test2.entries|-5134227801081826149[0] + /* fake */ override operator fun compareTo(other: Test2): Int + + // CHECK JVM_IR: + // Mangled name: Test2#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Test2.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2##static(){} + // Public signature: /Test2.entries.|-6068527377476727729[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Test2#hashCode(){}kotlin.Int + // Public signature: /Test2.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2{}name + // Public signature: /Test2.name|4231860309499509769[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Test2#toString(){}kotlin.String + // Public signature: /Test2.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#(){} + // Public signature: /Test2.name.|5879344792307730109[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: Test2#foo(){} + // Public signature: /Test2.foo|-1041209573719867811[0] + abstract fun foo(): Unit + + // CHECK: + // Mangled name: Test2#static{}entries + // Public signature: /Test2.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: Test2##static(){}kotlin.enums.EnumEntries + // Public signature: /Test2.entries.|2374563375183991273[0] + get(): EnumEntries + + // CHECK: + // Mangled name: Test2{}name + // Public signature: /Test2.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: Test2#(){}kotlin.String + // Public signature: /Test2.name.|-8006111524522882650[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Test2{}ordinal + // Public signature: /Test2.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: Test2#(){}kotlin.Int + // Public signature: /Test2.ordinal.|-6902664390061762634[0] + /* fake */ override get(): Int + +} + diff --git a/compiler/testData/ir/irText/classes/fakeOverridesForJavaNonStaticMembers.sig.kt.txt b/compiler/testData/ir/irText/classes/fakeOverridesForJavaNonStaticMembers.sig.kt.txt new file mode 100644 index 00000000000..90fa7b316ea --- /dev/null +++ b/compiler/testData/ir/irText/classes/fakeOverridesForJavaNonStaticMembers.sig.kt.txt @@ -0,0 +1,52 @@ +// FILE: fakeOverridesForJavaNonStaticMembers.kt +package a + +// CHECK: +// Mangled name: a.Test +// Public signature: a/Test|null[0] +class Test : Base { + // CHECK: + // Mangled name: a.Test#(){} + // Public signature: a/Test.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: a.Test#packagePrivateMethod(){} + // Public signature: a/Test.packagePrivateMethod|-6626321591774137652[0] + package /* fake */ override fun packagePrivateMethod(): Unit + + // CHECK: + // Mangled name: a.Test#protectedMethod(){} + // Public signature: a/Test.protectedMethod|5447082645647771455[0] + protected_and_package /* fake */ override fun protectedMethod(): Unit + + // CHECK: + // Mangled name: a.Test#publicMethod(){} + // Public signature: a/Test.publicMethod|-3952535363739900962[0] + /* fake */ override fun publicMethod(): Unit + +} + +// FILE: fakeOverridesForJavaNonStaticMembers2.kt + +// CHECK: +// Mangled name: Test2 +// Public signature: /Test2|null[0] +class Test2 : Base { + // CHECK: + // Mangled name: Test2#(){} + // Public signature: /Test2.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Test2#protectedMethod(){} + // Public signature: /Test2.protectedMethod|5447082645647771455[0] + protected_and_package /* fake */ override fun protectedMethod(): Unit + + // CHECK: + // Mangled name: Test2#publicMethod(){} + // Public signature: /Test2.publicMethod|-3952535363739900962[0] + /* fake */ override fun publicMethod(): Unit + +} + diff --git a/compiler/testData/ir/irText/classes/fakeOverridesForJavaStaticMembers.sig.kt.txt b/compiler/testData/ir/irText/classes/fakeOverridesForJavaStaticMembers.sig.kt.txt new file mode 100644 index 00000000000..7edf4f04431 --- /dev/null +++ b/compiler/testData/ir/irText/classes/fakeOverridesForJavaStaticMembers.sig.kt.txt @@ -0,0 +1,11 @@ +// CHECK: +// Mangled name: Test +// Public signature: /Test|null[0] +class Test : Base { + // CHECK: + // Mangled name: Test#(){} + // Public signature: /Test.|-5645683436151566731[0] + constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.kt b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.kt index 7d239e6dff7..6b193d0d9f7 100644 --- a/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.kt +++ b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.kt @@ -1,4 +1,8 @@ // TARGET_BACKEND: JVM + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57788 + // FILE: implicitNotNullOnDelegatedImplementation.kt interface IFoo { fun foo(): String @@ -45,4 +49,4 @@ public class JFoo implements IFoo { // FILE: JUnrelatedFoo.java public class JUnrelatedFoo { public String foo() { return null; } -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.sig.kt.txt b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.sig.kt.txt new file mode 100644 index 00000000000..59b4fcf8705 --- /dev/null +++ b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.sig.kt.txt @@ -0,0 +1,171 @@ +// CHECK: +// Mangled name: K1 +// Public signature: /K1|null[0] +class K1 : JFoo { + // CHECK: + // Mangled name: K1#(){} + // Public signature: /K1.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: K1#foo(){}kotlin.String{EnhancedNullability} + // Public signature: /K1.foo|7566064415059097436[0] + /* fake */ override fun foo(): @EnhancedNullability String + +} + +// CHECK: +// Mangled name: K2 +// Public signature: /K2|null[0] +class K2 : JFoo { + // CHECK: + // Mangled name: K2#(){} + // Public signature: /K2.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: K2#foo(){}kotlin.String + // Public signature: /K2.foo|485335955883620819[0] + override fun foo(): String + +} + +// CHECK: +// Mangled name: K3 +// Public signature: /K3|null[0] +class K3 : JUnrelatedFoo, IFoo { + // CHECK: + // Mangled name: K3#(){} + // Public signature: /K3.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: K3#foo(){}kotlin.String + // Public signature: /K3.foo|485335955883620819[0] + /* fake */ override fun foo(): String + +} + +// CHECK: +// Mangled name: K4 +// Public signature: /K4|null[0] +class K4 : JUnrelatedFoo, IFoo { + // CHECK: + // Mangled name: K4#(){} + // Public signature: /K4.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: K4#foo(){}kotlin.String? + // Public signature: /K4.foo|4483044608789364619[0] + override fun foo(): String? + +} + +// CHECK: +// Mangled name: TestJFoo +// Public signature: /TestJFoo|null[0] +class TestJFoo : IFoo { + // CHECK: + // Mangled name: TestJFoo#(){} + // Public signature: /TestJFoo.|-5645683436151566731[0] + constructor() /* primary */ + // CHECK: + // Mangled name: TestJFoo.$$delegate_0 + // Public signature: /TestJFoo.$$delegate_0|-7286425919675154353[0] + private /* final field */ val $$delegate_0: JFoo + // CHECK JVM_IR: + // Mangled name: TestJFoo#foo(){}kotlin.String + // Public signature: /TestJFoo.foo|485335955883620819[0] + override fun foo(): String + +} + +// CHECK: +// Mangled name: TestK1 +// Public signature: /TestK1|null[0] +class TestK1 : IFoo { + // CHECK: + // Mangled name: TestK1#(){} + // Public signature: /TestK1.|-5645683436151566731[0] + constructor() /* primary */ + // CHECK: + // Mangled name: TestK1.$$delegate_0 + // Public signature: /TestK1.$$delegate_0|-7286425919675154353[0] + private /* final field */ val $$delegate_0: K1 + // CHECK JVM_IR: + // Mangled name: TestK1#foo(){}kotlin.String + // Public signature: /TestK1.foo|485335955883620819[0] + override fun foo(): String + +} + +// CHECK: +// Mangled name: TestK2 +// Public signature: /TestK2|null[0] +class TestK2 : IFoo { + // CHECK: + // Mangled name: TestK2#(){} + // Public signature: /TestK2.|-5645683436151566731[0] + constructor() /* primary */ + // CHECK: + // Mangled name: TestK2.$$delegate_0 + // Public signature: /TestK2.$$delegate_0|-7286425919675154353[0] + private /* final field */ val $$delegate_0: K2 + // CHECK JVM_IR: + // Mangled name: TestK2#foo(){}kotlin.String + // Public signature: /TestK2.foo|485335955883620819[0] + override fun foo(): String + +} + +// CHECK: +// Mangled name: TestK3 +// Public signature: /TestK3|null[0] +class TestK3 : IFoo { + // CHECK: + // Mangled name: TestK3#(){} + // Public signature: /TestK3.|-5645683436151566731[0] + constructor() /* primary */ + // CHECK: + // Mangled name: TestK3.$$delegate_0 + // Public signature: /TestK3.$$delegate_0|-7286425919675154353[0] + private /* final field */ val $$delegate_0: K3 + // CHECK JVM_IR: + // Mangled name: TestK3#foo(){}kotlin.String + // Public signature: /TestK3.foo|485335955883620819[0] + override fun foo(): String + +} + +// CHECK: +// Mangled name: TestK4 +// Public signature: /TestK4|null[0] +class TestK4 : IFoo { + // CHECK: + // Mangled name: TestK4#(){} + // Public signature: /TestK4.|-5645683436151566731[0] + constructor() /* primary */ + // CHECK: + // Mangled name: TestK4.$$delegate_0 + // Public signature: /TestK4.$$delegate_0|-7286425919675154353[0] + private /* final field */ val $$delegate_0: K4 + // CHECK JVM_IR: + // Mangled name: TestK4#foo(){}kotlin.String + // Public signature: /TestK4.foo|485335955883620819[0] + override fun foo(): String + +} + +// CHECK: +// Mangled name: IFoo +// Public signature: /IFoo|null[0] +interface IFoo { + + // CHECK JVM_IR: + // Mangled name: IFoo#foo(){}kotlin.String + // Public signature: /IFoo.foo|485335955883620819[0] + abstract fun foo(): String + +} + diff --git a/compiler/testData/ir/irText/classes/initBlock.sig.kt.txt b/compiler/testData/ir/irText/classes/initBlock.sig.kt.txt new file mode 100644 index 00000000000..92d4d085ced --- /dev/null +++ b/compiler/testData/ir/irText/classes/initBlock.sig.kt.txt @@ -0,0 +1,78 @@ +// CHECK: +// Mangled name: Test1 +// Public signature: /Test1|null[0] +class Test1 { + // CHECK: + // Mangled name: Test1#(){} + // Public signature: /Test1.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: Test2 +// Public signature: /Test2|null[0] +class Test2 { + // CHECK: + // Mangled name: Test2{}x + // Public signature: /Test2.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: Test2#(){}kotlin.Int + // Public signature: /Test2.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#(){} + // Public signature: /Test2.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Test2#(kotlin.Int){} + // Public signature: /Test2.|-5182794243525578284[0] + constructor(x: Int) /* primary */ + +} + +// CHECK: +// Mangled name: Test3 +// Public signature: /Test3|null[0] +class Test3 { + // CHECK: + // Mangled name: Test3#(){} + // Public signature: /Test3.|-5645683436151566731[0] + constructor() + +} + +// CHECK: +// Mangled name: Test4 +// Public signature: /Test4|null[0] +class Test4 { + // CHECK: + // Mangled name: Test4#(){} + // Public signature: /Test4.|-5645683436151566731[0] + constructor() + +} + +// CHECK: +// Mangled name: Test5 +// Public signature: /Test5|null[0] +class Test5 { + // CHECK: + // Mangled name: Test5.TestInner + // Public signature: /Test5.TestInner|null[0] + inner class TestInner { + // CHECK: + // Mangled name: Test5.TestInner#(){} + // Public signature: /Test5.TestInner.|-5645683436151566731[0] + constructor() /* primary */ + + } + + // CHECK: + // Mangled name: Test5#(){} + // Public signature: /Test5.|-5645683436151566731[0] + constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/classes/initVal.sig.kt.txt b/compiler/testData/ir/irText/classes/initVal.sig.kt.txt new file mode 100644 index 00000000000..e4b92c1537d --- /dev/null +++ b/compiler/testData/ir/irText/classes/initVal.sig.kt.txt @@ -0,0 +1,69 @@ +// CHECK: +// Mangled name: TestInitValFromParameter +// Public signature: /TestInitValFromParameter|null[0] +class TestInitValFromParameter { + // CHECK: + // Mangled name: TestInitValFromParameter{}x + // Public signature: /TestInitValFromParameter.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: TestInitValFromParameter#(){}kotlin.Int + // Public signature: /TestInitValFromParameter.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestInitValFromParameter#(){} + // Public signature: /TestInitValFromParameter.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: TestInitValFromParameter#(kotlin.Int){} + // Public signature: /TestInitValFromParameter.|-5182794243525578284[0] + constructor(x: Int) /* primary */ + +} + +// CHECK: +// Mangled name: TestInitValInClass +// Public signature: /TestInitValInClass|null[0] +class TestInitValInClass { + // CHECK: + // Mangled name: TestInitValInClass{}x + // Public signature: /TestInitValInClass.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: TestInitValInClass#(){}kotlin.Int + // Public signature: /TestInitValInClass.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestInitValInClass#(){} + // Public signature: /TestInitValInClass.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: TestInitValInClass#(){} + // Public signature: /TestInitValInClass.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: TestInitValInInitBlock +// Public signature: /TestInitValInInitBlock|null[0] +class TestInitValInInitBlock { + // CHECK: + // Mangled name: TestInitValInInitBlock{}x + // Public signature: /TestInitValInInitBlock.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: TestInitValInInitBlock#(){}kotlin.Int + // Public signature: /TestInitValInInitBlock.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestInitValInInitBlock#(){} + // Public signature: /TestInitValInInitBlock.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: TestInitValInInitBlock#(){} + // Public signature: /TestInitValInInitBlock.|-5645683436151566731[0] + constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/classes/initValInLambda.kt b/compiler/testData/ir/irText/classes/initValInLambda.kt index bfbde0ac1a6..5350f8e8b88 100644 --- a/compiler/testData/ir/irText/classes/initValInLambda.kt +++ b/compiler/testData/ir/irText/classes/initValInLambda.kt @@ -1,6 +1,7 @@ // FIR_IDENTICAL // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 + class TestInitValInLambdaCalledOnce { val x: Int init { diff --git a/compiler/testData/ir/irText/classes/initValInLambda.sig.kt.txt b/compiler/testData/ir/irText/classes/initValInLambda.sig.kt.txt new file mode 100644 index 00000000000..6e87648a4e0 --- /dev/null +++ b/compiler/testData/ir/irText/classes/initValInLambda.sig.kt.txt @@ -0,0 +1,23 @@ +// CHECK: +// Mangled name: TestInitValInLambdaCalledOnce +// Public signature: /TestInitValInLambdaCalledOnce|null[0] +class TestInitValInLambdaCalledOnce { + // CHECK: + // Mangled name: TestInitValInLambdaCalledOnce{}x + // Public signature: /TestInitValInLambdaCalledOnce.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: TestInitValInLambdaCalledOnce#(){}kotlin.Int + // Public signature: /TestInitValInLambdaCalledOnce.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestInitValInLambdaCalledOnce#(){} + // Public signature: /TestInitValInLambdaCalledOnce.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: TestInitValInLambdaCalledOnce#(){} + // Public signature: /TestInitValInLambdaCalledOnce.|-5645683436151566731[0] + constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/classes/initVar.sig.kt.txt b/compiler/testData/ir/irText/classes/initVar.sig.kt.txt new file mode 100644 index 00000000000..eb68ac0122b --- /dev/null +++ b/compiler/testData/ir/irText/classes/initVar.sig.kt.txt @@ -0,0 +1,162 @@ +// CHECK: +// Mangled name: TestInitVarFromParameter +// Public signature: /TestInitVarFromParameter|null[0] +class TestInitVarFromParameter { + // CHECK: + // Mangled name: TestInitVarFromParameter{}x + // Public signature: /TestInitVarFromParameter.x|-8060530855978347579[0] + var x: Int + // CHECK JVM_IR: + // Mangled name: TestInitVarFromParameter#(){}kotlin.Int + // Public signature: /TestInitVarFromParameter.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestInitVarFromParameter#(){} + // Public signature: /TestInitVarFromParameter.x.|1482705010654679335[0] + get + // CHECK: + // Mangled name: TestInitVarFromParameter#(kotlin.Int){} + // Public signature: /TestInitVarFromParameter.x.|-740209739415615559[0] + set + + // CHECK: + // Mangled name: TestInitVarFromParameter#(kotlin.Int){} + // Public signature: /TestInitVarFromParameter.|-5182794243525578284[0] + constructor(x: Int) /* primary */ + +} + +// CHECK: +// Mangled name: TestInitVarInClass +// Public signature: /TestInitVarInClass|null[0] +class TestInitVarInClass { + // CHECK: + // Mangled name: TestInitVarInClass{}x + // Public signature: /TestInitVarInClass.x|-8060530855978347579[0] + var x: Int + // CHECK JVM_IR: + // Mangled name: TestInitVarInClass#(){}kotlin.Int + // Public signature: /TestInitVarInClass.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestInitVarInClass#(){} + // Public signature: /TestInitVarInClass.x.|1482705010654679335[0] + get + // CHECK: + // Mangled name: TestInitVarInClass#(kotlin.Int){} + // Public signature: /TestInitVarInClass.x.|-740209739415615559[0] + set + + // CHECK: + // Mangled name: TestInitVarInClass#(){} + // Public signature: /TestInitVarInClass.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: TestInitVarInInitBlock +// Public signature: /TestInitVarInInitBlock|null[0] +class TestInitVarInInitBlock { + // CHECK: + // Mangled name: TestInitVarInInitBlock{}x + // Public signature: /TestInitVarInInitBlock.x|-8060530855978347579[0] + var x: Int + // CHECK JVM_IR: + // Mangled name: TestInitVarInInitBlock#(){}kotlin.Int + // Public signature: /TestInitVarInInitBlock.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestInitVarInInitBlock#(){} + // Public signature: /TestInitVarInInitBlock.x.|1482705010654679335[0] + get + // CHECK: + // Mangled name: TestInitVarInInitBlock#(kotlin.Int){} + // Public signature: /TestInitVarInInitBlock.x.|-740209739415615559[0] + set + + // CHECK: + // Mangled name: TestInitVarInInitBlock#(){} + // Public signature: /TestInitVarInInitBlock.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: TestInitVarWithCustomSetter +// Public signature: /TestInitVarWithCustomSetter|null[0] +class TestInitVarWithCustomSetter { + // CHECK: + // Mangled name: TestInitVarWithCustomSetter{}x + // Public signature: /TestInitVarWithCustomSetter.x|-8060530855978347579[0] + var x: Int + // CHECK JVM_IR: + // Mangled name: TestInitVarWithCustomSetter#(){}kotlin.Int + // Public signature: /TestInitVarWithCustomSetter.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestInitVarWithCustomSetter#(){} + // Public signature: /TestInitVarWithCustomSetter.x.|1482705010654679335[0] + get + // CHECK: + // Mangled name: TestInitVarWithCustomSetter#(kotlin.Int){} + // Public signature: /TestInitVarWithCustomSetter.x.|-740209739415615559[0] + set(value: Int): Unit + + // CHECK: + // Mangled name: TestInitVarWithCustomSetter#(){} + // Public signature: /TestInitVarWithCustomSetter.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: TestInitVarWithCustomSetterInCtor +// Public signature: /TestInitVarWithCustomSetterInCtor|null[0] +class TestInitVarWithCustomSetterInCtor { + // CHECK: + // Mangled name: TestInitVarWithCustomSetterInCtor{}x + // Public signature: /TestInitVarWithCustomSetterInCtor.x|-8060530855978347579[0] + var x: Int + // CHECK JVM_IR: + // Mangled name: TestInitVarWithCustomSetterInCtor#(){}kotlin.Int + // Public signature: /TestInitVarWithCustomSetterInCtor.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestInitVarWithCustomSetterInCtor#(){} + // Public signature: /TestInitVarWithCustomSetterInCtor.x.|1482705010654679335[0] + get + // CHECK: + // Mangled name: TestInitVarWithCustomSetterInCtor#(kotlin.Int){} + // Public signature: /TestInitVarWithCustomSetterInCtor.x.|-740209739415615559[0] + set(value: Int): Unit + + // CHECK: + // Mangled name: TestInitVarWithCustomSetterInCtor#(){} + // Public signature: /TestInitVarWithCustomSetterInCtor.|-5645683436151566731[0] + constructor() + +} + +// CHECK: +// Mangled name: TestInitVarWithCustomSetterWithExplicitCtor +// Public signature: /TestInitVarWithCustomSetterWithExplicitCtor|null[0] +class TestInitVarWithCustomSetterWithExplicitCtor { + // CHECK: + // Mangled name: TestInitVarWithCustomSetterWithExplicitCtor{}x + // Public signature: /TestInitVarWithCustomSetterWithExplicitCtor.x|-8060530855978347579[0] + var x: Int + // CHECK JVM_IR: + // Mangled name: TestInitVarWithCustomSetterWithExplicitCtor#(){}kotlin.Int + // Public signature: /TestInitVarWithCustomSetterWithExplicitCtor.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestInitVarWithCustomSetterWithExplicitCtor#(){} + // Public signature: /TestInitVarWithCustomSetterWithExplicitCtor.x.|1482705010654679335[0] + get + // CHECK: + // Mangled name: TestInitVarWithCustomSetterWithExplicitCtor#(kotlin.Int){} + // Public signature: /TestInitVarWithCustomSetterWithExplicitCtor.x.|-740209739415615559[0] + set(value: Int): Unit + + // CHECK: + // Mangled name: TestInitVarWithCustomSetterWithExplicitCtor#(){} + // Public signature: /TestInitVarWithCustomSetterWithExplicitCtor.|-5645683436151566731[0] + constructor() + +} + diff --git a/compiler/testData/ir/irText/classes/inlineClass.sig.kt.txt b/compiler/testData/ir/irText/classes/inlineClass.sig.kt.txt new file mode 100644 index 00000000000..63c2e8f6a54 --- /dev/null +++ b/compiler/testData/ir/irText/classes/inlineClass.sig.kt.txt @@ -0,0 +1,46 @@ +// CHECK: +// Mangled name: Test +// Public signature: /Test|null[0] +value class Test { + // CHECK: + // Mangled name: Test{}x + // Public signature: /Test.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: Test#(){}kotlin.Int + // Public signature: /Test.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test#(){} + // Public signature: /Test.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Test#(kotlin.Int){} + // Public signature: /Test.|-5182794243525578284[0] + constructor(x: Int) /* primary */ + // CHECK JVM_IR: + // Mangled name: Test#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Test.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test#equals(kotlin.Any?){} + // Public signature: /Test.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Test#hashCode(){}kotlin.Int + // Public signature: /Test.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test#hashCode(){} + // Public signature: /Test.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Test#toString(){}kotlin.String + // Public signature: /Test.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test#toString(){} + // Public signature: /Test.toString|-1522858123163872138[0] + override fun toString(): String + +} + diff --git a/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.kt b/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.kt index 2df1de559e0..ab8dd9e7fa8 100644 --- a/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.kt +++ b/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.kt @@ -1,5 +1,8 @@ // !LANGUAGE: +InlineClasses +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR +// ^ KT-57429 + class C(val t: T) { override fun hashCode(): Int = t as Int } diff --git a/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.sig.kt.txt b/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.sig.kt.txt new file mode 100644 index 00000000000..11164588f04 --- /dev/null +++ b/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.sig.kt.txt @@ -0,0 +1,93 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C{}t + // Public signature: /C.t|-8767999791664836944[0] + val t: T + // CHECK JVM_IR: + // Mangled name: C#(){}1:0 + // Public signature: /C.t.|5296523675281381766[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.t.|7061140872129253552[0] + get + + // CHECK: + // Mangled name: C#(1:0){} + // Public signature: /C.|-8731461708390519279[0] + constructor(t: T) /* primary */ + + // CHECK JVM_IR: + // Mangled name: C#hashCode(){}kotlin.Int + // Public signature: /C.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#hashCode(){} + // Public signature: /C.hashCode|3409210261493131192[0] + override fun hashCode(): Int + +} + +// CHECK: +// Mangled name: IC +// Public signature: /IC|null[0] +value class IC { + // CHECK: + // Mangled name: IC{}c + // Public signature: /IC.c|-4416962153448040627[0] + val c: C + // CHECK JVM_IR: + // Mangled name: IC#(){}C<1:0> + // Public signature: /IC.c.|-6707667902688835915[0] + // CHECK JS_IR NATIVE: + // Mangled name: IC#(){} + // Public signature: /IC.c.|2368736057102379596[0] + get + + // CHECK: + // Mangled name: IC#(C<1:0>){} + // Public signature: /IC.|-2549303465575104617[0] + constructor(c: C) /* primary */ + // CHECK JVM_IR: + // Mangled name: IC#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /IC.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: IC#equals(kotlin.Any?){} + // Public signature: /IC.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: IC#hashCode(){}kotlin.Int + // Public signature: /IC.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: IC#hashCode(){} + // Public signature: /IC.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: IC#toString(){}kotlin.String + // Public signature: /IC.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: IC#toString(){} + // Public signature: /IC.toString|-1522858123163872138[0] + override fun toString(): String + + // CHECK JVM_IR: + // Mangled name: IC#foo(){}kotlin.Int + // Public signature: /IC.foo|-1256155405684507276[0] + // CHECK JS_IR NATIVE: + // Mangled name: IC#foo(){} + // Public signature: /IC.foo|-1041209573719867811[0] + fun foo(): Int + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +// CHECK JS_IR NATIVE: +// Mangled name: #box(){} +// Public signature: /box|2173511048851971368[0] +fun box(): String + diff --git a/compiler/testData/ir/irText/classes/innerClass.sig.kt.txt b/compiler/testData/ir/irText/classes/innerClass.sig.kt.txt new file mode 100644 index 00000000000..13f833b8588 --- /dev/null +++ b/compiler/testData/ir/irText/classes/innerClass.sig.kt.txt @@ -0,0 +1,33 @@ +// CHECK: +// Mangled name: Outer +// Public signature: /Outer|null[0] +class Outer { + // CHECK: + // Mangled name: Outer.DerivedInnerClass + // Public signature: /Outer.DerivedInnerClass|null[0] + inner class DerivedInnerClass : TestInnerClass { + // CHECK: + // Mangled name: Outer.DerivedInnerClass#(){} + // Public signature: /Outer.DerivedInnerClass.|-5645683436151566731[0] + constructor() /* primary */ + + } + + // CHECK: + // Mangled name: Outer.TestInnerClass + // Public signature: /Outer.TestInnerClass|null[0] + open inner class TestInnerClass { + // CHECK: + // Mangled name: Outer.TestInnerClass#(){} + // Public signature: /Outer.TestInnerClass.|-5645683436151566731[0] + constructor() /* primary */ + + } + + // CHECK: + // Mangled name: Outer#(){} + // Public signature: /Outer.|-5645683436151566731[0] + constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.sig.kt.txt b/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.sig.kt.txt new file mode 100644 index 00000000000..8c214654843 --- /dev/null +++ b/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.sig.kt.txt @@ -0,0 +1,38 @@ +// CHECK: +// Mangled name: Outer +// Public signature: /Outer|null[0] +class Outer { + // CHECK: + // Mangled name: Outer.Inner + // Public signature: /Outer.Inner|null[0] + inner class Inner { + // CHECK: + // Mangled name: Outer.Inner{}x + // Public signature: /Outer.Inner.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: Outer.Inner#(){}kotlin.Int + // Public signature: /Outer.Inner.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Outer.Inner#(){} + // Public signature: /Outer.Inner.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Outer.Inner#(){} + // Public signature: /Outer.Inner.|-5645683436151566731[0] + constructor() + // CHECK: + // Mangled name: Outer.Inner#(kotlin.Int){} + // Public signature: /Outer.Inner.|-5182794243525578284[0] + constructor(x: Int) /* primary */ + + } + + // CHECK: + // Mangled name: Outer#(){} + // Public signature: /Outer.|-5645683436151566731[0] + constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/classes/kt19306.sig.kt.txt b/compiler/testData/ir/irText/classes/kt19306.sig.kt.txt new file mode 100644 index 00000000000..3d7ead03655 --- /dev/null +++ b/compiler/testData/ir/irText/classes/kt19306.sig.kt.txt @@ -0,0 +1,64 @@ +// FILE: kt19306_test1.kt +package test1 + +// CHECK: +// Mangled name: test1.A +// Public signature: test1/A|null[0] +abstract class A { + // CHECK: + // Mangled name: test1.A{}p + // Public signature: test1/A.p|6715504260787941082[0] + protected var p: String + // CHECK JVM_IR: + // Mangled name: test1.A#(){}kotlin.String + // Public signature: test1/A.p.|-7630602400384289276[0] + // CHECK JS_IR NATIVE: + // Mangled name: test1.A#(){} + // Public signature: test1/A.p.|-1162552463316289847[0] + protected get + // CHECK: + // Mangled name: test1.A#(kotlin.String){} + // Public signature: test1/A.p.|1896329871380024517[0] + private set + + // CHECK: + // Mangled name: test1.A#(){} + // Public signature: test1/A.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// FILE: kt19306_test2.kt +package test2 + +// CHECK: +// Mangled name: test2.B +// Public signature: test2/B|null[0] +class B : A { + // CHECK: + // Mangled name: test2.B#(){} + // Public signature: test2/B.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: test2.B#test(){}kotlin.Function0 + // Public signature: test2/B.test|4450727485295834919[0] + // CHECK JS_IR NATIVE: + // Mangled name: test2.B#test(){} + // Public signature: test2/B.test|6620506149988718649[0] + fun test(): Function0 + + // CHECK: + // Mangled name: test2.B{}p + // Public signature: test2/B.p|6715504260787941082[0] + protected /* fake */ override var p: String + // CHECK JVM_IR: + // Mangled name: test2.B#(){}kotlin.String + // Public signature: test2/B.p.|-7630602400384289276[0] + // CHECK JS_IR NATIVE: + // Mangled name: test2.B#(){} + // Public signature: test2/B.p.|-1162552463316289847[0] + protected /* fake */ override get(): String + +} + diff --git a/compiler/testData/ir/irText/classes/kt43217.kt b/compiler/testData/ir/irText/classes/kt43217.kt index cdb6c4d67ef..25264e1e87b 100644 --- a/compiler/testData/ir/irText/classes/kt43217.kt +++ b/compiler/testData/ir/irText/classes/kt43217.kt @@ -1,4 +1,9 @@ // TARGET_BACKEND: JVM +// DUMP_LOCAL_DECLARATION_SIGNATURES + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57430, KT-57788 + // FILE: kt43217.kt class A { private val b = diff --git a/compiler/testData/ir/irText/classes/kt43217.sig.kt.txt b/compiler/testData/ir/irText/classes/kt43217.sig.kt.txt new file mode 100644 index 00000000000..0941b4281a1 --- /dev/null +++ b/compiler/testData/ir/irText/classes/kt43217.sig.kt.txt @@ -0,0 +1,76 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A { + // CHECK: + // Mangled name: A{}b + // Public signature: /A.b|772347207915745207[0] + private val b: + field + // CHECK JVM_IR: + // Mangled name (compatible mode: false): A{}b. + // Mangled name (compatible mode: true): A.b. + local class : DoubleExpression { + // CHECK: + // Mangled name (compatible mode: false): A{}b.#(){} + // Mangled name (compatible mode: true): A.b.#(){} + constructor() /* primary */ + + // CHECK: + // Mangled name (compatible mode: false): A{}b.#isEqualTo(kotlin.Double){}kotlin.Any{EnhancedNullability} + // Mangled name (compatible mode: true): A.b.#isEqualTo(kotlin.Double){}kotlin.Any{EnhancedNullability} + @Override + /* fake */ override fun isEqualTo(value: Double): @EnhancedNullability Any + + // CHECK JVM_IR: + // Mangled name (compatible mode: false): A{}b.#isEqualTo(kotlin.Double{EnhancedNullability}){}kotlin.Any{EnhancedNullability} + // Mangled name (compatible mode: true): A.b.#isEqualTo(kotlin.Double{EnhancedNullability}){}kotlin.Any{EnhancedNullability} + /* fake */ override fun isEqualTo(value: @EnhancedNullability Double): @EnhancedNullability Any + + // CHECK JVM_IR: + // Mangled name (compatible mode: false): A{}b.#get(){}kotlin.Double + // Mangled name (compatible mode: true): A.b.#get(){}kotlin.Double + override fun get(): Double + + } + + // CHECK JVM_IR: + // Mangled name (compatible mode: false): A#(){}A{}b. + // Mangled name (compatible mode: true): A#(){}A.b. + // Public signature: /A.b.|-6508357397455690228[0] + private get + + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C : DoubleExpression { + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: C#isEqualTo(kotlin.Double){}kotlin.Any{EnhancedNullability} + // Public signature: /C.isEqualTo|6549516741996743028[0] + @Override + /* fake */ override fun isEqualTo(value: Double): @EnhancedNullability Any + + // CHECK JVM_IR: + // Mangled name: C#isEqualTo(kotlin.Double{EnhancedNullability}){}kotlin.Any{EnhancedNullability} + // Public signature: /C.isEqualTo|3976283770497294654[0] + /* fake */ override fun isEqualTo(value: @EnhancedNullability Double): @EnhancedNullability Any + + // CHECK JVM_IR: + // Mangled name: C#get(){}kotlin.Double + // Public signature: /C.get|-8276149070669614990[0] + override fun get(): Double + +} + diff --git a/compiler/testData/ir/irText/classes/kt45853.kt b/compiler/testData/ir/irText/classes/kt45853.kt index d56f3664e5d..f7b178dada9 100644 --- a/compiler/testData/ir/irText/classes/kt45853.kt +++ b/compiler/testData/ir/irText/classes/kt45853.kt @@ -2,6 +2,10 @@ // SKIP_KT_DUMP // DUMP_EXTERNAL_CLASS: X // DUMP_EXTERNAL_CLASS: AX + +// SKIP_SIGNATURE_DUMP +// ^ Fake overrides have divirging @EnhancedNullability in K1 and K2 + // FILE: kt45853.kt abstract class A { diff --git a/compiler/testData/ir/irText/classes/kt45934.kt b/compiler/testData/ir/irText/classes/kt45934.kt index 7838d30a109..db68e5acf6d 100644 --- a/compiler/testData/ir/irText/classes/kt45934.kt +++ b/compiler/testData/ir/irText/classes/kt45934.kt @@ -1,6 +1,9 @@ // TARGET_BACKEND: JVM // SKIP_KT_DUMP +// SKIP_SIGNATURE_DUMP +// ^ K2 generates an override for foo in C, K1 does not + // FILE: kt45934.kt class C(client: J) : I by client diff --git a/compiler/testData/ir/irText/classes/localClasses.kt b/compiler/testData/ir/irText/classes/localClasses.kt index 5fe0b5e7793..8eb753612a3 100644 --- a/compiler/testData/ir/irText/classes/localClasses.kt +++ b/compiler/testData/ir/irText/classes/localClasses.kt @@ -1,7 +1,12 @@ // FIR_IDENTICAL +// DUMP_LOCAL_DECLARATION_SIGNATURES + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57430 + fun outer() { class LocalClass { fun foo() {} } LocalClass().foo() -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/classes/localClasses.sig.kt.txt b/compiler/testData/ir/irText/classes/localClasses.sig.kt.txt new file mode 100644 index 00000000000..ce4a294b242 --- /dev/null +++ b/compiler/testData/ir/irText/classes/localClasses.sig.kt.txt @@ -0,0 +1,17 @@ +// CHECK: +// Mangled name: #outer(){} +// Public signature: /outer|1607449560170809066[0] +fun outer(): Unit + // CHECK: + // Mangled name: #outer(){}.LocalClass + local class LocalClass { + // CHECK: + // Mangled name: #outer(){}.LocalClass#(){} + constructor() /* primary */ + + // CHECK: + // Mangled name: #outer(){}.LocalClass#foo(){} + fun foo(): Unit + + } + diff --git a/compiler/testData/ir/irText/classes/objectLiteralExpressions.kt b/compiler/testData/ir/irText/classes/objectLiteralExpressions.kt index 34de26d4f4e..a87cde4a256 100644 --- a/compiler/testData/ir/irText/classes/objectLiteralExpressions.kt +++ b/compiler/testData/ir/irText/classes/objectLiteralExpressions.kt @@ -1,8 +1,12 @@ // FIR_IDENTICAL // WITH_STDLIB +// DUMP_LOCAL_DECLARATION_SIGNATURES // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57430 + interface IFoo { fun foo() } diff --git a/compiler/testData/ir/irText/classes/objectLiteralExpressions.sig.kt.txt b/compiler/testData/ir/irText/classes/objectLiteralExpressions.sig.kt.txt new file mode 100644 index 00000000000..818e8bcb1c8 --- /dev/null +++ b/compiler/testData/ir/irText/classes/objectLiteralExpressions.sig.kt.txt @@ -0,0 +1,132 @@ +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: Any + field + // CHECK JVM_IR: + // Mangled name (compatible mode: false): {}test1. + // Mangled name (compatible mode: true): test1. + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test1.|-5735092642142423279[0] + local class { + // CHECK: + // Mangled name (compatible mode: false): {}test1.#(){} + // Mangled name (compatible mode: true): test1.#(){} + constructor() /* primary */ + + } + + // CHECK: + // Mangled name: #(){}kotlin.Any + // Public signature: /test1.|-6000098324399857556[0] + get + +// CHECK: +// Mangled name: {}test2 +// Public signature: /test2|2517758057000911509[0] +val test2: IFoo + field + // CHECK JVM_IR: + // Mangled name (compatible mode: false): {}test2. + // Mangled name (compatible mode: true): test2. + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test2.|-5218942532816206869[0] + local class : IFoo { + // CHECK: + // Mangled name (compatible mode: false): {}test2.#(){} + // Mangled name (compatible mode: true): test2.#(){} + constructor() /* primary */ + + // CHECK: + // Mangled name (compatible mode: false): {}test2.#foo(){} + // Mangled name (compatible mode: true): test2.#foo(){} + override fun foo(): Unit + + } + + // CHECK: + // Mangled name: #(){}IFoo + // Public signature: /test2.|8558399082919905120[0] + get + +// CHECK: +// Mangled name: Outer +// Public signature: /Outer|null[0] +class Outer { + // CHECK: + // Mangled name: Outer.Inner + // Public signature: /Outer.Inner|null[0] + abstract inner class Inner : IFoo { + // CHECK: + // Mangled name: Outer.Inner#(){} + // Public signature: /Outer.Inner.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Outer.Inner#foo(){} + // Public signature: /Outer.Inner.foo|-1041209573719867811[0] + abstract /* fake */ override fun foo(): Unit + + } + + // CHECK: + // Mangled name: Outer#(){} + // Public signature: /Outer.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Outer#test3(){}Outer.Inner + // Public signature: /Outer.test3|6083507929198720424[0] + // CHECK JS_IR NATIVE: + // Mangled name: Outer#test3(){} + // Public signature: /Outer.test3|-3759735065270951803[0] + fun test3(): Inner + // CHECK: + // Mangled name: Outer#test3(){}Outer.Inner. + local class : Inner { + // CHECK: + // Mangled name: Outer#test3(){}Outer.Inner.#(){} + constructor() /* primary */ + + // CHECK: + // Mangled name: Outer#test3(){}Outer.Inner.#foo(){} + override fun foo(): Unit + + } + +} + +// CHECK: +// Mangled name: IFoo +// Public signature: /IFoo|null[0] +interface IFoo { + + // CHECK: + // Mangled name: IFoo#foo(){} + // Public signature: /IFoo.foo|-1041209573719867811[0] + abstract fun foo(): Unit + +} + +// CHECK JVM_IR: +// Mangled name: #test4@Outer(){}Outer.Inner +// Public signature: /test4|-5948342138475838209[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test4@Outer(){} +// Public signature: /test4|5715080467126173402[0] +fun Outer.test4(): Inner + // CHECK: + // Mangled name: #test4@Outer(){}Outer.Inner. + local class : Inner { + // CHECK: + // Mangled name: #test4@Outer(){}Outer.Inner.#(){} + constructor() /* primary */ + + // CHECK: + // Mangled name: #test4@Outer(){}Outer.Inner.#foo(){} + override fun foo(): Unit + + } + diff --git a/compiler/testData/ir/irText/classes/objectWithInitializers.sig.kt.txt b/compiler/testData/ir/irText/classes/objectWithInitializers.sig.kt.txt new file mode 100644 index 00000000000..064c081c1a4 --- /dev/null +++ b/compiler/testData/ir/irText/classes/objectWithInitializers.sig.kt.txt @@ -0,0 +1,46 @@ +// CHECK: +// Mangled name: Base +// Public signature: /Base|null[0] +abstract class Base { + // CHECK: + // Mangled name: Base#(){} + // Public signature: /Base.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: Test +// Public signature: /Test|null[0] +object Test : Base { + // CHECK: + // Mangled name: Test{}x + // Public signature: /Test.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: Test#(){}kotlin.Int + // Public signature: /Test.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test#(){} + // Public signature: /Test.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Test{}y + // Public signature: /Test.y|3625903257357557171[0] + val y: Int + // CHECK JVM_IR: + // Mangled name: Test#(){}kotlin.Int + // Public signature: /Test.y.|-6745575372101973707[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test#(){} + // Public signature: /Test.y.|-7902422373892128922[0] + get + + // CHECK: + // Mangled name: Test#(){} + // Public signature: /Test.|-5645683436151566731[0] + private constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/classes/outerClassAccess.sig.kt.txt b/compiler/testData/ir/irText/classes/outerClassAccess.sig.kt.txt new file mode 100644 index 00000000000..44f5beb3f8b --- /dev/null +++ b/compiler/testData/ir/irText/classes/outerClassAccess.sig.kt.txt @@ -0,0 +1,53 @@ +// CHECK: +// Mangled name: Outer +// Public signature: /Outer|null[0] +class Outer { + // CHECK: + // Mangled name: Outer.Inner + // Public signature: /Outer.Inner|null[0] + inner class Inner { + // CHECK: + // Mangled name: Outer.Inner.Inner2 + // Public signature: /Outer.Inner.Inner2|null[0] + inner class Inner2 { + // CHECK: + // Mangled name: Outer.Inner.Inner2#(){} + // Public signature: /Outer.Inner.Inner2.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Outer.Inner.Inner2#test2(){} + // Public signature: /Outer.Inner.Inner2.test2|4279114864133353152[0] + fun test2(): Unit + + // CHECK: + // Mangled name: Outer.Inner.Inner2#test3@Outer(){} + // Public signature: /Outer.Inner.Inner2.test3|-491537560312526926[0] + fun Outer.test3(): Unit + + } + + // CHECK: + // Mangled name: Outer.Inner#(){} + // Public signature: /Outer.Inner.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Outer.Inner#test(){} + // Public signature: /Outer.Inner.test|6620506149988718649[0] + fun test(): Unit + + } + + // CHECK: + // Mangled name: Outer#(){} + // Public signature: /Outer.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Outer#foo(){} + // Public signature: /Outer.foo|-1041209573719867811[0] + fun foo(): Unit + +} + diff --git a/compiler/testData/ir/irText/classes/primaryConstructor.sig.kt.txt b/compiler/testData/ir/irText/classes/primaryConstructor.sig.kt.txt new file mode 100644 index 00000000000..da693c33c6f --- /dev/null +++ b/compiler/testData/ir/irText/classes/primaryConstructor.sig.kt.txt @@ -0,0 +1,105 @@ +// CHECK: +// Mangled name: Test1 +// Public signature: /Test1|null[0] +class Test1 { + // CHECK: + // Mangled name: Test1{}x + // Public signature: /Test1.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: Test1#(){}kotlin.Int + // Public signature: /Test1.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Test1{}y + // Public signature: /Test1.y|3625903257357557171[0] + val y: Int + // CHECK JVM_IR: + // Mangled name: Test1#(){}kotlin.Int + // Public signature: /Test1.y.|-6745575372101973707[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.y.|-7902422373892128922[0] + get + + // CHECK: + // Mangled name: Test1#(kotlin.Int;kotlin.Int){} + // Public signature: /Test1.|-7691762014320324121[0] + constructor(x: Int, y: Int) /* primary */ + +} + +// CHECK: +// Mangled name: Test2 +// Public signature: /Test2|null[0] +class Test2 { + // CHECK: + // Mangled name: Test2{}y + // Public signature: /Test2.y|3625903257357557171[0] + val y: Int + // CHECK JVM_IR: + // Mangled name: Test2#(){}kotlin.Int + // Public signature: /Test2.y.|-6745575372101973707[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#(){} + // Public signature: /Test2.y.|-7902422373892128922[0] + get + + // CHECK: + // Mangled name: Test2{}x + // Public signature: /Test2.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: Test2#(){}kotlin.Int + // Public signature: /Test2.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#(){} + // Public signature: /Test2.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Test2#(kotlin.Int;kotlin.Int){} + // Public signature: /Test2.|-7691762014320324121[0] + constructor(x: Int, y: Int) /* primary */ + +} + +// CHECK: +// Mangled name: Test3 +// Public signature: /Test3|null[0] +class Test3 { + // CHECK: + // Mangled name: Test3{}y + // Public signature: /Test3.y|3625903257357557171[0] + val y: Int + // CHECK JVM_IR: + // Mangled name: Test3#(){}kotlin.Int + // Public signature: /Test3.y.|-6745575372101973707[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#(){} + // Public signature: /Test3.y.|-7902422373892128922[0] + get + + // CHECK: + // Mangled name: Test3{}x + // Public signature: /Test3.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: Test3#(){}kotlin.Int + // Public signature: /Test3.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#(){} + // Public signature: /Test3.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Test3#(kotlin.Int;kotlin.Int){} + // Public signature: /Test3.|-7691762014320324121[0] + constructor(x: Int, y: Int) /* primary */ + +} + diff --git a/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.sig.kt.txt b/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.sig.kt.txt new file mode 100644 index 00000000000..ca7c743a27e --- /dev/null +++ b/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.sig.kt.txt @@ -0,0 +1,72 @@ +// CHECK: +// Mangled name: Base +// Public signature: /Base|null[0] +open class Base { + // CHECK: + // Mangled name: Base#(){} + // Public signature: /Base.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: TestExplicitPrimaryConstructor +// Public signature: /TestExplicitPrimaryConstructor|null[0] +class TestExplicitPrimaryConstructor : Base { + // CHECK: + // Mangled name: TestExplicitPrimaryConstructor#(){} + // Public signature: /TestExplicitPrimaryConstructor.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: TestImplicitPrimaryConstructor +// Public signature: /TestImplicitPrimaryConstructor|null[0] +class TestImplicitPrimaryConstructor : Base { + // CHECK: + // Mangled name: TestImplicitPrimaryConstructor#(){} + // Public signature: /TestImplicitPrimaryConstructor.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: TestWithDelegatingConstructor +// Public signature: /TestWithDelegatingConstructor|null[0] +class TestWithDelegatingConstructor : Base { + // CHECK: + // Mangled name: TestWithDelegatingConstructor{}x + // Public signature: /TestWithDelegatingConstructor.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: TestWithDelegatingConstructor#(){}kotlin.Int + // Public signature: /TestWithDelegatingConstructor.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestWithDelegatingConstructor#(){} + // Public signature: /TestWithDelegatingConstructor.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: TestWithDelegatingConstructor{}y + // Public signature: /TestWithDelegatingConstructor.y|3625903257357557171[0] + val y: Int + // CHECK JVM_IR: + // Mangled name: TestWithDelegatingConstructor#(){}kotlin.Int + // Public signature: /TestWithDelegatingConstructor.y.|-6745575372101973707[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestWithDelegatingConstructor#(){} + // Public signature: /TestWithDelegatingConstructor.y.|-7902422373892128922[0] + get + + // CHECK: + // Mangled name: TestWithDelegatingConstructor#(kotlin.Int){} + // Public signature: /TestWithDelegatingConstructor.|-5182794243525578284[0] + constructor(x: Int) + // CHECK: + // Mangled name: TestWithDelegatingConstructor#(kotlin.Int;kotlin.Int){} + // Public signature: /TestWithDelegatingConstructor.|-7691762014320324121[0] + constructor(x: Int, y: Int) /* primary */ + +} + diff --git a/compiler/testData/ir/irText/classes/qualifiedSuperCalls.sig.kt.txt b/compiler/testData/ir/irText/classes/qualifiedSuperCalls.sig.kt.txt new file mode 100644 index 00000000000..2cbd0d42144 --- /dev/null +++ b/compiler/testData/ir/irText/classes/qualifiedSuperCalls.sig.kt.txt @@ -0,0 +1,76 @@ +// CHECK: +// Mangled name: CBoth +// Public signature: /CBoth|null[0] +class CBoth : ILeft, IRight { + // CHECK: + // Mangled name: CBoth#(){} + // Public signature: /CBoth.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: CBoth#foo(){} + // Public signature: /CBoth.foo|-1041209573719867811[0] + override fun foo(): Unit + + // CHECK: + // Mangled name: CBoth{}bar + // Public signature: /CBoth.bar|-7864284097863469857[0] + override val bar: Int + // CHECK JVM_IR: + // Mangled name: CBoth#(){}kotlin.Int + // Public signature: /CBoth.bar.|-7403724005139201014[0] + // CHECK JS_IR NATIVE: + // Mangled name: CBoth#(){} + // Public signature: /CBoth.bar.|6880642144337645699[0] + override get(): Int + +} + +// CHECK: +// Mangled name: ILeft +// Public signature: /ILeft|null[0] +interface ILeft { + + // CHECK: + // Mangled name: ILeft#foo(){} + // Public signature: /ILeft.foo|-1041209573719867811[0] + fun foo(): Unit + + // CHECK: + // Mangled name: ILeft{}bar + // Public signature: /ILeft.bar|-7864284097863469857[0] + val bar: Int + // CHECK JVM_IR: + // Mangled name: ILeft#(){}kotlin.Int + // Public signature: /ILeft.bar.|-7403724005139201014[0] + // CHECK JS_IR NATIVE: + // Mangled name: ILeft#(){} + // Public signature: /ILeft.bar.|6880642144337645699[0] + get(): Int + +} + +// CHECK: +// Mangled name: IRight +// Public signature: /IRight|null[0] +interface IRight { + + // CHECK: + // Mangled name: IRight#foo(){} + // Public signature: /IRight.foo|-1041209573719867811[0] + fun foo(): Unit + + // CHECK: + // Mangled name: IRight{}bar + // Public signature: /IRight.bar|-7864284097863469857[0] + val bar: Int + // CHECK JVM_IR: + // Mangled name: IRight#(){}kotlin.Int + // Public signature: /IRight.bar.|-7403724005139201014[0] + // CHECK JS_IR NATIVE: + // Mangled name: IRight#(){} + // Public signature: /IRight.bar.|6880642144337645699[0] + get(): Int + +} + diff --git a/compiler/testData/ir/irText/classes/sealedClasses.sig.kt.txt b/compiler/testData/ir/irText/classes/sealedClasses.sig.kt.txt new file mode 100644 index 00000000000..6531cfcdfe2 --- /dev/null +++ b/compiler/testData/ir/irText/classes/sealedClasses.sig.kt.txt @@ -0,0 +1,80 @@ +// CHECK: +// Mangled name: Expr +// Public signature: /Expr|null[0] +sealed class Expr { + // CHECK: + // Mangled name: Expr.Const + // Public signature: /Expr.Const|null[0] + class Const : Expr { + // CHECK: + // Mangled name: Expr.Const{}number + // Public signature: /Expr.Const.number|-3213756739435629896[0] + val number: Double + // CHECK JVM_IR: + // Mangled name: Expr.Const#(){}kotlin.Double + // Public signature: /Expr.Const.number.|5647242881292479325[0] + // CHECK JS_IR NATIVE: + // Mangled name: Expr.Const#(){} + // Public signature: /Expr.Const.number.|-7703103523096162843[0] + get + + // CHECK: + // Mangled name: Expr.Const#(kotlin.Double){} + // Public signature: /Expr.Const.|575075696928934302[0] + constructor(number: Double) /* primary */ + + } + + // CHECK: + // Mangled name: Expr.Sum + // Public signature: /Expr.Sum|null[0] + class Sum : Expr { + // CHECK: + // Mangled name: Expr.Sum{}e1 + // Public signature: /Expr.Sum.e1|3620889417967928691[0] + val e1: Expr + // CHECK JVM_IR: + // Mangled name: Expr.Sum#(){}Expr + // Public signature: /Expr.Sum.e1.|-1591404437553568512[0] + // CHECK JS_IR NATIVE: + // Mangled name: Expr.Sum#(){} + // Public signature: /Expr.Sum.e1.|-5200592901549843691[0] + get + + // CHECK: + // Mangled name: Expr.Sum{}e2 + // Public signature: /Expr.Sum.e2|6967693203503644767[0] + val e2: Expr + // CHECK JVM_IR: + // Mangled name: Expr.Sum#(){}Expr + // Public signature: /Expr.Sum.e2.|3855595078682840918[0] + // CHECK JS_IR NATIVE: + // Mangled name: Expr.Sum#(){} + // Public signature: /Expr.Sum.e2.|-59208052664646912[0] + get + + // CHECK: + // Mangled name: Expr.Sum#(Expr;Expr){} + // Public signature: /Expr.Sum.|-2872031821614483406[0] + constructor(e1: Expr, e2: Expr) /* primary */ + + } + + // CHECK: + // Mangled name: Expr.NotANumber + // Public signature: /Expr.NotANumber|null[0] + object NotANumber : Expr { + // CHECK: + // Mangled name: Expr.NotANumber#(){} + // Public signature: /Expr.NotANumber.|-5645683436151566731[0] + private constructor() /* primary */ + + } + + // CHECK: + // Mangled name: Expr#(){} + // Public signature: /Expr.|-5645683436151566731[0] + protected constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.sig.kt.txt b/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.sig.kt.txt new file mode 100644 index 00000000000..285029fe412 --- /dev/null +++ b/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.sig.kt.txt @@ -0,0 +1,65 @@ +// CHECK: +// Mangled name: Base +// Public signature: /Base|null[0] +open class Base { + // CHECK: + // Mangled name: Base#(){} + // Public signature: /Base.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: TestInitBlock +// Public signature: /TestInitBlock|null[0] +class TestInitBlock : Base { + // CHECK: + // Mangled name: TestInitBlock{}x + // Public signature: /TestInitBlock.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: TestInitBlock#(){}kotlin.Int + // Public signature: /TestInitBlock.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestInitBlock#(){} + // Public signature: /TestInitBlock.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: TestInitBlock#(){} + // Public signature: /TestInitBlock.|-5645683436151566731[0] + constructor() + // CHECK: + // Mangled name: TestInitBlock#(kotlin.Int){} + // Public signature: /TestInitBlock.|-5182794243525578284[0] + constructor(y: Int) + // CHECK: + // Mangled name: TestInitBlock#(kotlin.Any){} + // Public signature: /TestInitBlock.|4518179880532599055[0] + constructor(z: Any) + +} + +// CHECK: +// Mangled name: TestProperty +// Public signature: /TestProperty|null[0] +class TestProperty : Base { + // CHECK: + // Mangled name: TestProperty{}x + // Public signature: /TestProperty.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: TestProperty#(){}kotlin.Int + // Public signature: /TestProperty.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestProperty#(){} + // Public signature: /TestProperty.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: TestProperty#(){} + // Public signature: /TestProperty.|-5645683436151566731[0] + constructor() + +} + diff --git a/compiler/testData/ir/irText/classes/secondaryConstructors.sig.kt.txt b/compiler/testData/ir/irText/classes/secondaryConstructors.sig.kt.txt new file mode 100644 index 00000000000..fc8324b1db3 --- /dev/null +++ b/compiler/testData/ir/irText/classes/secondaryConstructors.sig.kt.txt @@ -0,0 +1,15 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() + // CHECK: + // Mangled name: C#(kotlin.Int){} + // Public signature: /C.|-5182794243525578284[0] + constructor(x: Int) + +} + diff --git a/compiler/testData/ir/irText/classes/smartCastInValInitialization.sig.kt.txt b/compiler/testData/ir/irText/classes/smartCastInValInitialization.sig.kt.txt new file mode 100644 index 00000000000..849ee8184c6 --- /dev/null +++ b/compiler/testData/ir/irText/classes/smartCastInValInitialization.sig.kt.txt @@ -0,0 +1,46 @@ +// CHECK: +// Mangled name: MessageBusImpl +// Public signature: /MessageBusImpl|null[0] +open class MessageBusImpl { + // CHECK: + // Mangled name: MessageBusImpl{}parentBus + // Public signature: /MessageBusImpl.parentBus|4372009635220349355[0] + val parentBus: Any? + // CHECK JVM_IR: + // Mangled name: MessageBusImpl#(){}kotlin.Any? + // Public signature: /MessageBusImpl.parentBus.|-5686140196600425134[0] + // CHECK JS_IR NATIVE: + // Mangled name: MessageBusImpl#(){} + // Public signature: /MessageBusImpl.parentBus.|-4473545730438591287[0] + get + + // CHECK: + // Mangled name: MessageBusImpl#(){} + // Public signature: /MessageBusImpl.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: RootBus +// Public signature: /RootBus|null[0] +class RootBus : MessageBusImpl { + // CHECK: + // Mangled name: RootBus#(){} + // Public signature: /RootBus.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: RootBus{}parentBus + // Public signature: /RootBus.parentBus|4372009635220349355[0] + /* fake */ override val parentBus: Any? + // CHECK JVM_IR: + // Mangled name: RootBus#(){}kotlin.Any? + // Public signature: /RootBus.parentBus.|-5686140196600425134[0] + // CHECK JS_IR NATIVE: + // Mangled name: RootBus#(){} + // Public signature: /RootBus.parentBus.|-4473545730438591287[0] + /* fake */ override get(): Any? + +} + diff --git a/compiler/testData/ir/irText/classes/superCalls.sig.kt.txt b/compiler/testData/ir/irText/classes/superCalls.sig.kt.txt new file mode 100644 index 00000000000..b568a1d3349 --- /dev/null +++ b/compiler/testData/ir/irText/classes/superCalls.sig.kt.txt @@ -0,0 +1,72 @@ +// CHECK: +// Mangled name: Base +// Public signature: /Base|null[0] +open class Base { + // CHECK: + // Mangled name: Base{}bar + // Public signature: /Base.bar|-7864284097863469857[0] + open val bar: String + // CHECK JVM_IR: + // Mangled name: Base#(){}kotlin.String + // Public signature: /Base.bar.|3423724227669014303[0] + // CHECK JS_IR NATIVE: + // Mangled name: Base#(){} + // Public signature: /Base.bar.|6880642144337645699[0] + open get + + // CHECK: + // Mangled name: Base#(){} + // Public signature: /Base.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Base#foo(){} + // Public signature: /Base.foo|-1041209573719867811[0] + open fun foo(): Unit + + // CHECK JVM_IR: + // Mangled name: Base#hashCode(){}kotlin.Int + // Public signature: /Base.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: Base#hashCode(){} + // Public signature: /Base.hashCode|3409210261493131192[0] + override fun hashCode(): Int + +} + +// CHECK: +// Mangled name: Derived +// Public signature: /Derived|null[0] +class Derived : Base { + // CHECK: + // Mangled name: Derived#(){} + // Public signature: /Derived.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Derived#hashCode(){}kotlin.Int + // Public signature: /Derived.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: Derived#hashCode(){} + // Public signature: /Derived.hashCode|3409210261493131192[0] + /* fake */ override fun hashCode(): Int + + // CHECK: + // Mangled name: Derived#foo(){} + // Public signature: /Derived.foo|-1041209573719867811[0] + override fun foo(): Unit + + // CHECK: + // Mangled name: Derived{}bar + // Public signature: /Derived.bar|-7864284097863469857[0] + override val bar: String + // CHECK JVM_IR: + // Mangled name: Derived#(){}kotlin.String + // Public signature: /Derived.bar.|3423724227669014303[0] + // CHECK JS_IR NATIVE: + // Mangled name: Derived#(){} + // Public signature: /Derived.bar.|6880642144337645699[0] + override get(): String + +} + diff --git a/compiler/testData/ir/irText/classes/superCallsComposed.sig.kt.txt b/compiler/testData/ir/irText/classes/superCallsComposed.sig.kt.txt new file mode 100644 index 00000000000..24e6809bc98 --- /dev/null +++ b/compiler/testData/ir/irText/classes/superCallsComposed.sig.kt.txt @@ -0,0 +1,80 @@ +// CHECK: +// Mangled name: Base +// Public signature: /Base|null[0] +open class Base { + // CHECK: + // Mangled name: Base{}bar + // Public signature: /Base.bar|-7864284097863469857[0] + open val bar: String + // CHECK JVM_IR: + // Mangled name: Base#(){}kotlin.String + // Public signature: /Base.bar.|3423724227669014303[0] + // CHECK JS_IR NATIVE: + // Mangled name: Base#(){} + // Public signature: /Base.bar.|6880642144337645699[0] + open get + + // CHECK: + // Mangled name: Base#(){} + // Public signature: /Base.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Base#foo(){} + // Public signature: /Base.foo|-1041209573719867811[0] + open fun foo(): Unit + +} + +// CHECK: +// Mangled name: Derived +// Public signature: /Derived|null[0] +class Derived : Base, BaseI { + // CHECK: + // Mangled name: Derived#(){} + // Public signature: /Derived.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Derived#foo(){} + // Public signature: /Derived.foo|-1041209573719867811[0] + override fun foo(): Unit + + // CHECK: + // Mangled name: Derived{}bar + // Public signature: /Derived.bar|-7864284097863469857[0] + override val bar: String + // CHECK JVM_IR: + // Mangled name: Derived#(){}kotlin.String + // Public signature: /Derived.bar.|3423724227669014303[0] + // CHECK JS_IR NATIVE: + // Mangled name: Derived#(){} + // Public signature: /Derived.bar.|6880642144337645699[0] + override get(): String + +} + +// CHECK: +// Mangled name: BaseI +// Public signature: /BaseI|null[0] +interface BaseI { + + // CHECK: + // Mangled name: BaseI#foo(){} + // Public signature: /BaseI.foo|-1041209573719867811[0] + abstract fun foo(): Unit + + // CHECK: + // Mangled name: BaseI{}bar + // Public signature: /BaseI.bar|-7864284097863469857[0] + abstract val bar: String + // CHECK JVM_IR: + // Mangled name: BaseI#(){}kotlin.String + // Public signature: /BaseI.bar.|3423724227669014303[0] + // CHECK JS_IR NATIVE: + // Mangled name: BaseI#(){} + // Public signature: /BaseI.bar.|6880642144337645699[0] + abstract get + +} + diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationOnClassWithInitializer.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/annotationOnClassWithInitializer.sig.kt.txt new file mode 100644 index 00000000000..d5b524112a6 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/annotationOnClassWithInitializer.sig.kt.txt @@ -0,0 +1,23 @@ +// CHECK: +// Mangled name: SomeAnn +// Public signature: /SomeAnn|null[0] +open annotation class SomeAnn : Annotation { + // CHECK: + // Mangled name: SomeAnn#(){} + // Public signature: /SomeAnn.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: My +// Public signature: /My|null[0] +@SomeAnn +class My { + // CHECK: + // Mangled name: My#(){} + // Public signature: /My.|-5645683436151566731[0] + constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsInAnnotationArguments.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/annotationsInAnnotationArguments.sig.kt.txt new file mode 100644 index 00000000000..12e69f044fb --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsInAnnotationArguments.sig.kt.txt @@ -0,0 +1,76 @@ +// CHECK: +// Mangled name: A1 +// Public signature: /A1|null[0] +open annotation class A1 : Annotation { + // CHECK: + // Mangled name: A1{}x + // Public signature: /A1.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: A1#(){}kotlin.Int + // Public signature: /A1.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: A1#(){} + // Public signature: /A1.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: A1#(kotlin.Int){} + // Public signature: /A1.|-5182794243525578284[0] + constructor(x: Int) /* primary */ + +} + +// CHECK: +// Mangled name: A2 +// Public signature: /A2|null[0] +open annotation class A2 : Annotation { + // CHECK: + // Mangled name: A2{}a + // Public signature: /A2.a|-1200697420457237799[0] + val a: A1 + // CHECK JVM_IR: + // Mangled name: A2#(){}A1 + // Public signature: /A2.a.|7276890167111587032[0] + // CHECK JS_IR NATIVE: + // Mangled name: A2#(){} + // Public signature: /A2.a.|6785176174175479410[0] + get + + // CHECK: + // Mangled name: A2#(A1){} + // Public signature: /A2.|1733910541133145704[0] + constructor(a: A1) /* primary */ + +} + +// CHECK: +// Mangled name: AA +// Public signature: /AA|null[0] +open annotation class AA : Annotation { + // CHECK: + // Mangled name: AA{}xs + // Public signature: /AA.xs|1063330853857063704[0] + val xs: Array + // CHECK JVM_IR: + // Mangled name: AA#(){}kotlin.Array + // Public signature: /AA.xs.|466319571514416331[0] + // CHECK JS_IR NATIVE: + // Mangled name: AA#(){} + // Public signature: /AA.xs.|-6958094100501701183[0] + get + + // CHECK: + // Mangled name: AA#(kotlin.Array){} + // Public signature: /AA.|-748301654061855634[0] + constructor(xs: Array) /* primary */ + +} + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +@A2(a = A1(x = 42)) +@AA(xs = [A1(x = 1), A1(x = 2)]) +fun test(): Unit + diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.kt b/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.kt index 807a2746c15..8548fb4a23b 100644 --- a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.kt +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.kt @@ -1,3 +1,6 @@ +// SKIP_SIGNATURE_DUMP +// ^ Difference in annotations generated by K1 and K2 + annotation class Ann interface IFoo { @@ -7,4 +10,4 @@ interface IFoo { @Ann fun String.testExtFun() } -class DFoo(d: IFoo) : IFoo by d \ No newline at end of file +class DFoo(d: IFoo) : IFoo by d diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsWithDefaultParameterValues.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/annotationsWithDefaultParameterValues.sig.kt.txt new file mode 100644 index 00000000000..50826b3afca --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsWithDefaultParameterValues.sig.kt.txt @@ -0,0 +1,65 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +open annotation class A : Annotation { + // CHECK: + // Mangled name: A{}x + // Public signature: /A.x|-8060530855978347579[0] + val x: String + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.String + // Public signature: /A.x.|316111172223894646[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: A{}y + // Public signature: /A.y|3625903257357557171[0] + val y: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.y.|-6745575372101973707[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.y.|-7902422373892128922[0] + get + + // CHECK: + // Mangled name: A#(kotlin.String;kotlin.Int){} + // Public signature: /A.|-2457917570611619111[0] + constructor(x: String, y: Int) /* primary */ + +} + +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +@A(x = "abc", y = 123) +fun test1(): Unit + +// CHECK: +// Mangled name: #test2(){} +// Public signature: /test2|4279114864133353152[0] +@A(x = "def") +fun test2(): Unit + +// CHECK: +// Mangled name: #test3(){} +// Public signature: /test3|-3759735065270951803[0] +@A(x = "ghi") +fun test3(): Unit + +// CHECK: +// Mangled name: #test4(){} +// Public signature: /test4|5588455914500386239[0] +@A(, y = 456) +fun test4(): Unit + +// CHECK: +// Mangled name: #test5(){} +// Public signature: /test5|-2461239215881954159[0] +@A +fun test5(): Unit + diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsWithVarargParameters.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/annotationsWithVarargParameters.sig.kt.txt new file mode 100644 index 00000000000..b05e4d2d0da --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsWithVarargParameters.sig.kt.txt @@ -0,0 +1,41 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +open annotation class A : Annotation { + // CHECK: + // Mangled name: A{}xs + // Public signature: /A.xs|1063330853857063704[0] + val xs: Array + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Array + // Public signature: /A.xs.|9188548163055185324[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.xs.|-6958094100501701183[0] + get + + // CHECK: + // Mangled name: A#(kotlin.Array...){} + // Public signature: /A.|-6780234697714860085[0] + constructor(vararg xs: String) /* primary */ + +} + +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +@A(xs = ["abc", "def"]) +fun test1(): Unit + +// CHECK: +// Mangled name: #test2(){} +// Public signature: /test2|4279114864133353152[0] +@A(xs = ["abc"]) +fun test2(): Unit + +// CHECK: +// Mangled name: #test3(){} +// Public signature: /test3|-3759735065270951803[0] +@A(xs = []) +fun test3(): Unit + diff --git a/compiler/testData/ir/irText/declarations/annotations/argWithDefaultValueInAnnotationClass.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/argWithDefaultValueInAnnotationClass.sig.kt.txt new file mode 100644 index 00000000000..3a4aaa0de42 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/argWithDefaultValueInAnnotationClass.sig.kt.txt @@ -0,0 +1,20 @@ +// CHECK: +// Mangled name: ModuleInfo +// Public signature: /ModuleInfo|null[0] +open annotation class ModuleInfo : Annotation { + // CHECK: + // Mangled name: ModuleInfo{}keyBind + // Public signature: /ModuleInfo.keyBind|-3946407517690370511[0] + val keyBind: Int + // CHECK JVM_IR: + // Mangled name: ModuleInfo#(){}kotlin.Int + // Public signature: /ModuleInfo.keyBind.|-5105783608349623557[0] + get + + // CHECK: + // Mangled name: ModuleInfo#(kotlin.Int){} + // Public signature: /ModuleInfo.|-5182794243525578284[0] + constructor(keyBind: Int) /* primary */ + +} + diff --git a/compiler/testData/ir/irText/declarations/annotations/arrayInAnnotationArguments.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/arrayInAnnotationArguments.sig.kt.txt new file mode 100644 index 00000000000..18f9bff1263 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/arrayInAnnotationArguments.sig.kt.txt @@ -0,0 +1,60 @@ +// CHECK: +// Mangled name: TestAnnWithIntArray +// Public signature: /TestAnnWithIntArray|null[0] +open annotation class TestAnnWithIntArray : Annotation { + // CHECK: + // Mangled name: TestAnnWithIntArray{}x + // Public signature: /TestAnnWithIntArray.x|-8060530855978347579[0] + val x: IntArray + // CHECK JVM_IR: + // Mangled name: TestAnnWithIntArray#(){}kotlin.IntArray + // Public signature: /TestAnnWithIntArray.x.|-5699461780158713262[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAnnWithIntArray#(){} + // Public signature: /TestAnnWithIntArray.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: TestAnnWithIntArray#(kotlin.IntArray){} + // Public signature: /TestAnnWithIntArray.|6811679238332965682[0] + constructor(x: IntArray) /* primary */ + +} + +// CHECK: +// Mangled name: TestAnnWithStringArray +// Public signature: /TestAnnWithStringArray|null[0] +open annotation class TestAnnWithStringArray : Annotation { + // CHECK: + // Mangled name: TestAnnWithStringArray{}x + // Public signature: /TestAnnWithStringArray.x|-8060530855978347579[0] + val x: Array + // CHECK JVM_IR: + // Mangled name: TestAnnWithStringArray#(){}kotlin.Array + // Public signature: /TestAnnWithStringArray.x.|-709321774523398734[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAnnWithStringArray#(){} + // Public signature: /TestAnnWithStringArray.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: TestAnnWithStringArray#(kotlin.Array){} + // Public signature: /TestAnnWithStringArray.|5393043463829665764[0] + constructor(x: Array) /* primary */ + +} + +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +@TestAnnWithIntArray(x = [1, 2, 3]) +@TestAnnWithStringArray(x = ["a", "b", "c"]) +fun test1(): Unit + +// CHECK: +// Mangled name: #test2(){} +// Public signature: /test2|4279114864133353152[0] +@TestAnnWithIntArray(x = [4, 5, 6]) +@TestAnnWithStringArray(x = ["d", "e", "f"]) +fun test2(): Unit + diff --git a/compiler/testData/ir/irText/declarations/annotations/classLiteralInAnnotation.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/classLiteralInAnnotation.sig.kt.txt new file mode 100644 index 00000000000..5cf38b4fa4a --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/classLiteralInAnnotation.sig.kt.txt @@ -0,0 +1,40 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +open annotation class A : Annotation { + // CHECK: + // Mangled name: A{}klass + // Public signature: /A.klass|6015918431206184939[0] + val klass: KClass<*> + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.reflect.KClass<*> + // Public signature: /A.klass.|5739372350059323846[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.klass.|4259458871347467473[0] + get + + // CHECK: + // Mangled name: A#(kotlin.reflect.KClass<*>){} + // Public signature: /A.|5783844857148764471[0] + constructor(klass: KClass<*>) /* primary */ + +} + +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +@A(klass = C::class) +fun test1(): Unit + diff --git a/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.kt b/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.kt index 81e5baa3dcd..11125acad62 100644 --- a/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.kt +++ b/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.kt @@ -1,6 +1,9 @@ // 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/classesWithAnnotations.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.sig.kt.txt new file mode 100644 index 00000000000..0e2ae75ce72 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.sig.kt.txt @@ -0,0 +1,193 @@ +// CHECK: +// Mangled name: TestAnn +// Public signature: /TestAnn|null[0] +open annotation class TestAnn : Annotation { + // CHECK: + // Mangled name: TestAnn{}x + // Public signature: /TestAnn.x|-8060530855978347579[0] + val x: String + // CHECK JVM_IR: + // Mangled name: TestAnn#(){}kotlin.String + // Public signature: /TestAnn.x.|316111172223894646[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAnn#(){} + // Public signature: /TestAnn.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: TestAnn#(kotlin.String){} + // Public signature: /TestAnn.|1280618353163213788[0] + constructor(x: String) /* primary */ + +} + +// CHECK: +// Mangled name: TestAnnotation +// Public signature: /TestAnnotation|null[0] +@TestAnn(x = "annotation") +open annotation class TestAnnotation : Annotation { + // CHECK: + // Mangled name: TestAnnotation#(){} + // Public signature: /TestAnnotation.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: Host +// Public signature: /Host|null[0] +class Host { + // CHECK: + // Mangled name: Host.TestCompanion + // Public signature: /Host.TestCompanion|null[0] + @TestAnn(x = "companion") + companion object TestCompanion { + // CHECK: + // Mangled name: Host.TestCompanion#(){} + // Public signature: /Host.TestCompanion.|-5645683436151566731[0] + private constructor() /* primary */ + + } + + // CHECK: + // Mangled name: Host#(){} + // Public signature: /Host.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: TestClass +// Public signature: /TestClass|null[0] +@TestAnn(x = "class") +class TestClass { + // CHECK: + // Mangled name: TestClass#(){} + // Public signature: /TestClass.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: TestEnum +// Public signature: /TestEnum|null[0] +@TestAnn(x = "enum") +enum class TestEnum : Enum { + // CHECK: + // Mangled name: TestEnum#(){} + // Public signature: /TestEnum.|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK JVM_IR: + // Mangled name: TestEnum#valueOf#static(kotlin.String){}TestEnum + // Public signature: /TestEnum.valueOf|1811575739170804829[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum#valueOf#static(kotlin.String){} + // Public signature: /TestEnum.valueOf|-4683474617854611729[0] + fun valueOf(value: String): TestEnum + + // CHECK JVM_IR: + // Mangled name: TestEnum#values#static(){}kotlin.Array + // Public signature: /TestEnum.values|-4299804782350326897[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum#values#static(){} + // Public signature: /TestEnum.values|-8715569000920726747[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: TestEnum#clone(){}kotlin.Any + // Public signature: /TestEnum.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum#compareTo(TestEnum){} + // Public signature: /TestEnum.compareTo|7350720606720122863[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: TestEnum#compareTo(TestEnum){}kotlin.Int + // Public signature: /TestEnum.compareTo|7559751212169934687[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum#equals(kotlin.Any?){} + // Public signature: /TestEnum.equals|4638265728071529943[0] + /* fake */ override operator fun compareTo(other: TestEnum): Int + + // CHECK JVM_IR: + // Mangled name: TestEnum#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /TestEnum.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum#hashCode(){} + // Public signature: /TestEnum.hashCode|3409210261493131192[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: TestEnum#hashCode(){}kotlin.Int + // Public signature: /TestEnum.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum#toString(){} + // Public signature: /TestEnum.toString|-1522858123163872138[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: TestEnum#toString(){}kotlin.String + // Public signature: /TestEnum.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum#static{}entries + // Public signature: /TestEnum.entries|-5134227801081826149[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: TestEnum#static{}entries + // Public signature: /TestEnum.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: TestEnum##static(){}kotlin.enums.EnumEntries + // Public signature: /TestEnum.entries.|6962221716588245012[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum{}name + // Public signature: /TestEnum.name|4231860309499509769[0] + get(): EnumEntries + + // CHECK: + // Mangled name: TestEnum{}name + // Public signature: /TestEnum.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: TestEnum#(){}kotlin.String + // Public signature: /TestEnum.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestEnum{}ordinal + // Public signature: /TestEnum.ordinal|1912745122988592376[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: TestEnum{}ordinal + // Public signature: /TestEnum.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: TestEnum#(){}kotlin.Int + // Public signature: /TestEnum.ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestInterface + // Public signature: /TestInterface|null[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: TestInterface +// Public signature: /TestInterface|null[0] +@TestAnn(x = "interface") +interface TestInterface { + +} + +// CHECK: +// Mangled name: TestObject +// Public signature: /TestObject|null[0] +@TestAnn(x = "object") +object TestObject { + // CHECK: + // Mangled name: TestObject#(){} + // Public signature: /TestObject.|-5645683436151566731[0] + private constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.kt b/compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.kt index 05cdf5f4189..b327c8edbe9 100644 --- a/compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.kt +++ b/compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.kt @@ -1,5 +1,9 @@ // 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/constExpressionsInAnnotationArguments.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.sig.kt.txt new file mode 100644 index 00000000000..27ccedae457 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.sig.kt.txt @@ -0,0 +1,47 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +open annotation class A : Annotation { + // CHECK: + // Mangled name: A{}x + // Public signature: /A.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: A#(kotlin.Int){} + // Public signature: /A.|-5182794243525578284[0] + constructor(x: Int) /* primary */ + +} + +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +@A(x = 1) +fun test1(): Unit + +// CHECK: +// Mangled name: #test2(){} +// Public signature: /test2|4279114864133353152[0] +@A(x = 2) +fun test2(): Unit + +// CHECK: +// Mangled name: {}ONE +// Public signature: /ONE|5698484753436154102[0] +const val ONE: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /ONE.|7844388037784691246[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /ONE.|6594203029520379115[0] + get + diff --git a/compiler/testData/ir/irText/declarations/annotations/constructorsWithAnnotations.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/constructorsWithAnnotations.sig.kt.txt new file mode 100644 index 00000000000..38c0fc03fd4 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/constructorsWithAnnotations.sig.kt.txt @@ -0,0 +1,40 @@ +// CHECK: +// Mangled name: TestAnn +// Public signature: /TestAnn|null[0] +open annotation class TestAnn : Annotation { + // CHECK: + // Mangled name: TestAnn{}x + // Public signature: /TestAnn.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: TestAnn#(){}kotlin.Int + // Public signature: /TestAnn.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAnn#(){} + // Public signature: /TestAnn.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: TestAnn#(kotlin.Int){} + // Public signature: /TestAnn.|-5182794243525578284[0] + constructor(x: Int) /* primary */ + +} + +// CHECK: +// Mangled name: TestClass +// Public signature: /TestClass|null[0] +class TestClass { + // CHECK: + // Mangled name: TestClass#(){} + // Public signature: /TestClass.|-5645683436151566731[0] + @TestAnn(x = 1) + constructor() /* primary */ + // CHECK: + // Mangled name: TestClass#(kotlin.Int){} + // Public signature: /TestClass.|-5182794243525578284[0] + @TestAnn(x = 2) + constructor(x: Int) + +} + diff --git a/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.kt b/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.kt index 20446565c20..28fae1b0895 100644 --- a/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.kt +++ b/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.kt @@ -1,8 +1,12 @@ // FIR_IDENTICAL // WITH_STDLIB +// DUMP_LOCAL_DECLARATION_SIGNATURES // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57428 + annotation class Ann @delegate:Ann diff --git a/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.sig.kt.txt new file mode 100644 index 00000000000..ee8f8eec022 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.sig.kt.txt @@ -0,0 +1,32 @@ +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: Int /* by */ + field + // CHECK JVM_IR: + // Mangled name (compatible mode: false): {}test1##static(){}kotlin.Int + // Mangled name (compatible mode: true): test1$delegate##static(){}kotlin.Int + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test1.|-5735092642142423279[0] + local fun (): Int + + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test1.|3978508226793108919[0] + // CHECK JS_IR NATIVE: + // Mangled name (compatible mode: false): {}test1##static(){} + // Mangled name (compatible mode: true): test1$delegate##static(){} + get(): Int + +// CHECK: +// Mangled name: Ann +// Public signature: /Ann|null[0] +open annotation class Ann : Annotation { + // CHECK: + // Mangled name: Ann#(){} + // Public signature: /Ann.|-5645683436151566731[0] + constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.kt b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.kt index 6c6b2bd429f..f8a9839006f 100644 --- a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.kt +++ b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.kt @@ -1,3 +1,7 @@ +// MUTE_SIGNATURE_COMPARISON_K2: JS_IR +// MUTE_SIGNATURE_COMPARISON_K2: NATIVE +// ^ KT-57818 + annotation class A(val x: String) class Cell(var value: Int) { @@ -14,4 +18,4 @@ val test1 by Cell(1) @get:A("test2.get") @set:A("test2.set") @setparam:A("test2.set.param") -var test2 by Cell(2) \ No newline at end of file +var test2 by Cell(2) diff --git a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.sig.kt.txt new file mode 100644 index 00000000000..ad1b7289727 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.sig.kt.txt @@ -0,0 +1,94 @@ +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: Int /* by */ + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test1.|3978508226793108919[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test1.|-5735092642142423279[0] + @A(x = "test1.get") + get(): Int + +// CHECK: +// Mangled name: {}test2 +// Public signature: /test2|2517758057000911509[0] +var test2: Int /* by */ + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test2.|-8779933517717592707[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test2.|-5218942532816206869[0] + @A(x = "test2.get") + get(): Int + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /test2.|1925150309265265312[0] + @A(x = "test2.set") + set(@A(x = "test2.set.param") : Int): Unit + +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +open annotation class A : Annotation { + // CHECK: + // Mangled name: A{}x + // Public signature: /A.x|-8060530855978347579[0] + val x: String + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.String + // Public signature: /A.x.|316111172223894646[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: A#(kotlin.String){} + // Public signature: /A.|1280618353163213788[0] + constructor(x: String) /* primary */ + +} + +// CHECK: +// Mangled name: Cell +// Public signature: /Cell|null[0] +class Cell { + // CHECK: + // Mangled name: Cell{}value + // Public signature: /Cell.value|1987073854177347439[0] + var value: Int + // CHECK JVM_IR: + // Mangled name: Cell#(){}kotlin.Int + // Public signature: /Cell.value.|-5900028706170996[0] + // CHECK JS_IR NATIVE: + // Mangled name: Cell#(){} + // Public signature: /Cell.value.|3260093555963109437[0] + get + // CHECK: + // Mangled name: Cell#(kotlin.Int){} + // Public signature: /Cell.value.|-195057410739577239[0] + set + + // CHECK: + // Mangled name: Cell#(kotlin.Int){} + // Public signature: /Cell.|-5182794243525578284[0] + constructor(value: Int) /* primary */ + + // CHECK JVM_IR: + // Mangled name: Cell#getValue(kotlin.Any?;kotlin.Any?){}kotlin.Int + // Public signature: /Cell.getValue|-3377375928534350672[0] + // CHECK JS_IR NATIVE: + // Mangled name: Cell#getValue(kotlin.Any?;kotlin.Any?){} + // Public signature: /Cell.getValue|-9077843357189755365[0] + operator fun getValue(thisRef: Any?, kProp: Any?): Int + + // CHECK: + // Mangled name: Cell#setValue(kotlin.Any?;kotlin.Any?;kotlin.Int){} + // Public signature: /Cell.setValue|6795912344196649599[0] + operator fun setValue(thisRef: Any?, kProp: Any?, newValue: Int): Unit + +} + diff --git a/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.kt b/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.kt index 9a5c379d83d..74bc53f5983 100644 --- a/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.kt +++ b/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.kt @@ -1,6 +1,9 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// SKIP_SIGNATURE_DUMP +// ^ Difference in annotations generated by K1 and K2 + annotation class TestAnn(val x: String) enum class TestEnum { diff --git a/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.kt b/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.kt index 3af7753f09e..1c0df345332 100644 --- a/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.kt +++ b/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.kt @@ -1,6 +1,9 @@ // 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/enumsInAnnotationArguments.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.sig.kt.txt new file mode 100644 index 00000000000..fb3d7b34f56 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.sig.kt.txt @@ -0,0 +1,151 @@ +// CHECK: +// Mangled name: TestAnn +// Public signature: /TestAnn|null[0] +open annotation class TestAnn : Annotation { + // CHECK: + // Mangled name: TestAnn{}x + // Public signature: /TestAnn.x|-8060530855978347579[0] + val x: En + // CHECK JVM_IR: + // Mangled name: TestAnn#(){}En + // Public signature: /TestAnn.x.|-9017037183382597029[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAnn#(){} + // Public signature: /TestAnn.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: TestAnn#(En){} + // Public signature: /TestAnn.|2681758674480694769[0] + constructor(x: En) /* primary */ + +} + +// CHECK: +// Mangled name: En +// Public signature: /En|null[0] +enum class En : Enum { + // CHECK: + // Mangled name: En#(){} + // Public signature: /En.|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK: + // Mangled name: En.A + // Public signature: /En.A|null[0] + A + + // CHECK: + // Mangled name: En.B + // Public signature: /En.B|null[0] + B + + // CHECK: + // Mangled name: En.C + // Public signature: /En.C|null[0] + C + + // CHECK: + // Mangled name: En.D + // Public signature: /En.D|null[0] + D + + // CHECK JVM_IR: + // Mangled name: En#valueOf#static(kotlin.String){}En + // Public signature: /En.valueOf|-1047188124757226812[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#valueOf#static(kotlin.String){} + // Public signature: /En.valueOf|-4683474617854611729[0] + fun valueOf(value: String): En + + // CHECK JVM_IR: + // Mangled name: En#values#static(){}kotlin.Array + // Public signature: /En.values|-6442868649398371099[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#values#static(){} + // Public signature: /En.values|-8715569000920726747[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: En#clone(){}kotlin.Any + // Public signature: /En.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#compareTo(En){} + // Public signature: /En.compareTo|3555292261046836181[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: En#compareTo(En){}kotlin.Int + // Public signature: /En.compareTo|7450321438177070471[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#equals(kotlin.Any?){} + // Public signature: /En.equals|4638265728071529943[0] + /* fake */ override operator fun compareTo(other: En): Int + + // CHECK JVM_IR: + // Mangled name: En#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /En.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#hashCode(){} + // Public signature: /En.hashCode|3409210261493131192[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: En#hashCode(){}kotlin.Int + // Public signature: /En.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#toString(){} + // Public signature: /En.toString|-1522858123163872138[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: En#toString(){}kotlin.String + // Public signature: /En.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#static{}entries + // Public signature: /En.entries|-5134227801081826149[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: En#static{}entries + // Public signature: /En.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: En##static(){}kotlin.enums.EnumEntries + // Public signature: /En.entries.|7832995474718587298[0] + // CHECK JS_IR NATIVE: + // Mangled name: En{}name + // Public signature: /En.name|4231860309499509769[0] + get(): EnumEntries + + // CHECK: + // Mangled name: En{}name + // Public signature: /En.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: En#(){}kotlin.String + // Public signature: /En.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: En{}ordinal + // Public signature: /En.ordinal|1912745122988592376[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: En{}ordinal + // Public signature: /En.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: En#(){}kotlin.Int + // Public signature: /En.ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: #test1(){} + // Public signature: /test1|4297044443957252634[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +@TestAnn(x = En.A) +fun test1(): Unit + diff --git a/compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.kt b/compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.kt index 89ccd96d306..dc7768a5e33 100644 --- a/compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.kt +++ b/compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.kt @@ -1,8 +1,13 @@ // 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") val testVal = "a val" @field:TestAnn("testVar.field") -var testVar = "a var" \ No newline at end of file +var testVar = "a var" diff --git a/compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.sig.kt.txt new file mode 100644 index 00000000000..8ec50c2ae97 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.sig.kt.txt @@ -0,0 +1,51 @@ +// CHECK: +// Mangled name: {}testVal +// Public signature: /testVal|2839078120601828782[0] +val testVal: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /testVal.|-8940261368877498423[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testVal.|-3119877793352707332[0] + get + +// CHECK: +// Mangled name: {}testVar +// Public signature: /testVar|8413087277002944883[0] +var testVar: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /testVar.|7475404540439630194[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testVar.|-6235253478789807887[0] + get + // CHECK: + // Mangled name: #(kotlin.String){} + // Public signature: /testVar.|4717402140198696174[0] + set + +// CHECK: +// Mangled name: TestAnn +// Public signature: /TestAnn|null[0] +open annotation class TestAnn : Annotation { + // CHECK: + // Mangled name: TestAnn{}x + // Public signature: /TestAnn.x|-8060530855978347579[0] + val x: String + // CHECK JVM_IR: + // Mangled name: TestAnn#(){}kotlin.String + // Public signature: /TestAnn.x.|316111172223894646[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAnn#(){} + // Public signature: /TestAnn.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: TestAnn#(kotlin.String){} + // Public signature: /TestAnn.|1280618353163213788[0] + constructor(x: String) /* primary */ + +} + diff --git a/compiler/testData/ir/irText/declarations/annotations/fileAnnotations.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/fileAnnotations.sig.kt.txt new file mode 100644 index 00000000000..5aafc902152 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/fileAnnotations.sig.kt.txt @@ -0,0 +1,27 @@ +@file:A(x = "File annotation") +package test + +// CHECK: +// Mangled name: test.A +// Public signature: test/A|null[0] +@Target(allowedTargets = [AnnotationTarget.FILE]) +open annotation class A : Annotation { + // CHECK: + // Mangled name: test.A{}x + // Public signature: test/A.x|-8060530855978347579[0] + val x: String + // CHECK JVM_IR: + // Mangled name: test.A#(){}kotlin.String + // Public signature: test/A.x.|316111172223894646[0] + // CHECK JS_IR NATIVE: + // Mangled name: test.A#(){} + // Public signature: test/A.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: test.A#(kotlin.String){} + // Public signature: test/A.|1280618353163213788[0] + constructor(x: String) /* primary */ + +} + diff --git a/compiler/testData/ir/irText/declarations/annotations/functionsWithAnnotations.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/functionsWithAnnotations.sig.kt.txt new file mode 100644 index 00000000000..7768aea0b67 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/functionsWithAnnotations.sig.kt.txt @@ -0,0 +1,29 @@ +// CHECK: +// Mangled name: TestAnn +// Public signature: /TestAnn|null[0] +open annotation class TestAnn : Annotation { + // CHECK: + // Mangled name: TestAnn{}x + // Public signature: /TestAnn.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: TestAnn#(){}kotlin.Int + // Public signature: /TestAnn.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAnn#(){} + // Public signature: /TestAnn.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: TestAnn#(kotlin.Int){} + // Public signature: /TestAnn.|-5182794243525578284[0] + constructor(x: Int) /* primary */ + +} + +// CHECK: +// Mangled name: #testSimpleFunction(){} +// Public signature: /testSimpleFunction|-5790063669455148045[0] +@TestAnn(x = 42) +fun testSimpleFunction(): Unit + diff --git a/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.kt b/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.kt index 6299b96baf5..7aa6eeaf007 100644 --- a/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.kt +++ b/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.kt @@ -1,3 +1,6 @@ +// SKIP_SIGNATURE_DUMP +// ^ KT-57429, different types in annotations generated by K1 and K2 + package ann annotation class Test1(val x: Int) @@ -22,4 +25,4 @@ annotation class Test5(vararg val xs: Test3>) @Test3>(Test1(39)) @Test4([Test3(Test1(40)), Test3(Test1(50)), Test3(Test1(60))]) @Test5(*arrayOf(Test3(Test1(70))), *arrayOf(Test3(Test1(80)))) -class CC \ No newline at end of file +class CC diff --git a/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.kt b/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.kt index f52f5112821..104a6444de1 100644 --- a/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.kt +++ b/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.kt @@ -1,3 +1,6 @@ +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57754 + interface IFoo { @Deprecated("") val prop: String get() = "" @@ -13,4 +16,4 @@ class DefaultImpl : IFoo class ExplicitOverride : IFoo { override val prop: String get() = "" override val String.extProp: String get() = "" -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.sig.kt.txt new file mode 100644 index 00000000000..1b021a9c266 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.sig.kt.txt @@ -0,0 +1,140 @@ +// CHECK: +// Mangled name: DefaultImpl +// Public signature: /DefaultImpl|null[0] +class DefaultImpl : IFoo { + // CHECK: + // Mangled name: DefaultImpl#(){} + // Public signature: /DefaultImpl.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: DefaultImpl@kotlin.String{}extProp + // Public signature: /DefaultImpl.extProp|9137761441129982647[0] + /* fake */ override val String.extProp: String + // CHECK JVM_IR: + // Mangled name: DefaultImpl#@kotlin.String(){}kotlin.String + // Public signature: /DefaultImpl.extProp.|-8732758648969586151[0] + // CHECK JS_IR NATIVE: + // Mangled name: DefaultImpl#@kotlin.String(){} + // Public signature: /DefaultImpl.extProp.|-2957953481772901234[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: DefaultImpl{}prop + // Public signature: /DefaultImpl.prop|3598315380056892812[0] + /* fake */ override val prop: String + // CHECK JVM_IR: + // Mangled name: DefaultImpl#(){}kotlin.String + // Public signature: /DefaultImpl.prop.|-4077144726618700772[0] + // CHECK JS_IR NATIVE: + // Mangled name: DefaultImpl#(){} + // Public signature: /DefaultImpl.prop.|-5734736374948136327[0] + /* fake */ override get(): String + +} + +// CHECK: +// Mangled name: Delegated +// Public signature: /Delegated|null[0] +class Delegated : IFoo { + // CHECK: + // Mangled name: Delegated#(IFoo){} + // Public signature: /Delegated.|-657369904845510135[0] + constructor(foo: IFoo) /* primary */ + // CHECK: + // Mangled name: Delegated.$$delegate_0 + // Public signature: /Delegated.$$delegate_0|-7286425919675154353[0] + private /* final field */ val $$delegate_0: IFoo + + // CHECK: + // Mangled name: Delegated@kotlin.String{}extProp + // Public signature: /Delegated.extProp|9137761441129982647[0] + override val String.extProp: String + // CHECK JVM_IR: + // Mangled name: Delegated#@kotlin.String(){}kotlin.String + // Public signature: /Delegated.extProp.|-8732758648969586151[0] + // CHECK JS_IR NATIVE: + // Mangled name: Delegated#@kotlin.String(){} + // Public signature: /Delegated.extProp.|-2957953481772901234[0] + override get(): String + + // CHECK: + // Mangled name: Delegated{}prop + // Public signature: /Delegated.prop|3598315380056892812[0] + override val prop: String + // CHECK JVM_IR: + // Mangled name: Delegated#(){}kotlin.String + // Public signature: /Delegated.prop.|-4077144726618700772[0] + // CHECK JS_IR NATIVE: + // Mangled name: Delegated#(){} + // Public signature: /Delegated.prop.|-5734736374948136327[0] + override get(): String + +} + +// CHECK: +// Mangled name: ExplicitOverride +// Public signature: /ExplicitOverride|null[0] +class ExplicitOverride : IFoo { + // CHECK: + // Mangled name: ExplicitOverride#(){} + // Public signature: /ExplicitOverride.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: ExplicitOverride@kotlin.String{}extProp + // Public signature: /ExplicitOverride.extProp|9137761441129982647[0] + override val String.extProp: String + // CHECK JVM_IR: + // Mangled name: ExplicitOverride#@kotlin.String(){}kotlin.String + // Public signature: /ExplicitOverride.extProp.|-8732758648969586151[0] + // CHECK JS_IR NATIVE: + // Mangled name: ExplicitOverride#@kotlin.String(){} + // Public signature: /ExplicitOverride.extProp.|-2957953481772901234[0] + override get(): String + + // CHECK: + // Mangled name: ExplicitOverride{}prop + // Public signature: /ExplicitOverride.prop|3598315380056892812[0] + override val prop: String + // CHECK JVM_IR: + // Mangled name: ExplicitOverride#(){}kotlin.String + // Public signature: /ExplicitOverride.prop.|-4077144726618700772[0] + // CHECK JS_IR NATIVE: + // Mangled name: ExplicitOverride#(){} + // Public signature: /ExplicitOverride.prop.|-5734736374948136327[0] + override get(): String + +} + +// CHECK: +// Mangled name: IFoo +// Public signature: /IFoo|null[0] +interface IFoo { + + // CHECK: + // Mangled name: IFoo@kotlin.String{}extProp + // Public signature: /IFoo.extProp|9137761441129982647[0] + val String.extProp: String + // CHECK JVM_IR: + // Mangled name: IFoo#@kotlin.String(){}kotlin.String + // Public signature: /IFoo.extProp.|-8732758648969586151[0] + // CHECK JS_IR NATIVE: + // Mangled name: IFoo#@kotlin.String(){} + // Public signature: /IFoo.extProp.|-2957953481772901234[0] + get(): String + + // CHECK: + // Mangled name: IFoo{}prop + // Public signature: /IFoo.prop|3598315380056892812[0] + val prop: String + // CHECK JVM_IR: + // Mangled name: IFoo#(){}kotlin.String + // Public signature: /IFoo.prop.|-4077144726618700772[0] + // CHECK JS_IR NATIVE: + // Mangled name: IFoo#(){} + // Public signature: /IFoo.prop.|-5734736374948136327[0] + get(): String + +} + diff --git a/compiler/testData/ir/irText/declarations/annotations/javaAnnotation.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/javaAnnotation.sig.kt.txt new file mode 100644 index 00000000000..963c00bc8a2 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/javaAnnotation.sig.kt.txt @@ -0,0 +1,18 @@ +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +@JavaAnn +fun test1(): Unit + +// CHECK: +// Mangled name: #test2(){} +// Public signature: /test2|4279114864133353152[0] +@JavaAnn(value = "abc", i = 123) +fun test2(): Unit + +// CHECK: +// Mangled name: #test3(){} +// Public signature: /test3|-3759735065270951803[0] +@JavaAnn(value = "abc", i = 123) +fun test3(): Unit + diff --git a/compiler/testData/ir/irText/declarations/annotations/javaAnnotationWithSingleArrayArgument.kt b/compiler/testData/ir/irText/declarations/annotations/javaAnnotationWithSingleArrayArgument.kt index fd4b0fe5fc6..52e94500ac8 100644 --- a/compiler/testData/ir/irText/declarations/annotations/javaAnnotationWithSingleArrayArgument.kt +++ b/compiler/testData/ir/irText/declarations/annotations/javaAnnotationWithSingleArrayArgument.kt @@ -1,5 +1,9 @@ // SKIP_KT_DUMP // TARGET_BACKEND: JVM + +// SKIP_SIGNATURE_DUMP +// ^ Different types in annotations generated by K1 and K2 + // FILE: A.java public class A { diff --git a/compiler/testData/ir/irText/declarations/annotations/localDelegatedPropertiesWithAnnotations.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/localDelegatedPropertiesWithAnnotations.sig.kt.txt new file mode 100644 index 00000000000..f9672c0a744 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/localDelegatedPropertiesWithAnnotations.sig.kt.txt @@ -0,0 +1,28 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +open annotation class A : Annotation { + // CHECK: + // Mangled name: A{}x + // Public signature: /A.x|-8060530855978347579[0] + val x: String + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.String + // Public signature: /A.x.|316111172223894646[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: A#(kotlin.String){} + // Public signature: /A.|1280618353163213788[0] + constructor(x: String) /* primary */ + +} + +// CHECK: +// Mangled name: #foo(kotlin.collections.Map){} +// Public signature: /foo|2882082711847831728[0] +fun foo(m: Map): Unit + diff --git a/compiler/testData/ir/irText/declarations/annotations/multipleAnnotationsInSquareBrackets.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/multipleAnnotationsInSquareBrackets.sig.kt.txt new file mode 100644 index 00000000000..f932abd26dc --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/multipleAnnotationsInSquareBrackets.sig.kt.txt @@ -0,0 +1,41 @@ +// CHECK: +// Mangled name: A1 +// Public signature: /A1|null[0] +open annotation class A1 : Annotation { + // CHECK: + // Mangled name: A1#(){} + // Public signature: /A1.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: A2 +// Public signature: /A2|null[0] +open annotation class A2 : Annotation { + // CHECK: + // Mangled name: A2#(){} + // Public signature: /A2.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: A3 +// Public signature: /A3|null[0] +open annotation class A3 : Annotation { + // CHECK: + // Mangled name: A3#(){} + // Public signature: /A3.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +@A1 +@A2 +@A3 +fun test(): Unit + diff --git a/compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.sig.kt.txt new file mode 100644 index 00000000000..56d5faea2d4 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.sig.kt.txt @@ -0,0 +1,34 @@ +// CHECK: +// Mangled name: Ann +// Public signature: /Ann|null[0] +open annotation class Ann : Annotation { + // CHECK: + // Mangled name: Ann#(){} + // Public signature: /Ann.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: Test +// Public signature: /Test|null[0] +class Test { + // CHECK: + // Mangled name: Test{}x + // Public signature: /Test.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: Test#(){}kotlin.Int + // Public signature: /Test.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test#(){} + // Public signature: /Test.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Test#(kotlin.Int){} + // Public signature: /Test.|-5182794243525578284[0] + constructor(@Ann x: Int) /* primary */ + +} + diff --git a/compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.kt b/compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.kt index 5e555af5cc7..5383c58f586 100644 --- a/compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.kt +++ b/compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.kt @@ -1,5 +1,10 @@ // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: JS_IR +// MUTE_SIGNATURE_COMPARISON_K2: NATIVE +// ^ KT-57818 + annotation class TestAnn(val x: String) @TestAnn("testVal.property") -val testVal: String = "" \ No newline at end of file +val testVal: String = "" diff --git a/compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.sig.kt.txt new file mode 100644 index 00000000000..09dfddcdf4f --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.sig.kt.txt @@ -0,0 +1,36 @@ +// CHECK: +// Mangled name: {}testVal +// Public signature: /testVal|2839078120601828782[0] +@TestAnn(x = "testVal.property") +val testVal: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /testVal.|-8940261368877498423[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testVal.|-3119877793352707332[0] + get + +// CHECK: +// Mangled name: TestAnn +// Public signature: /TestAnn|null[0] +open annotation class TestAnn : Annotation { + // CHECK: + // Mangled name: TestAnn{}x + // Public signature: /TestAnn.x|-8060530855978347579[0] + val x: String + // CHECK JVM_IR: + // Mangled name: TestAnn#(){}kotlin.String + // Public signature: /TestAnn.x.|316111172223894646[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAnn#(){} + // Public signature: /TestAnn.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: TestAnn#(kotlin.String){} + // Public signature: /TestAnn.|1280618353163213788[0] + constructor(x: String) /* primary */ + +} + diff --git a/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsFromClassHeaderWithAnnotations.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsFromClassHeaderWithAnnotations.sig.kt.txt new file mode 100644 index 00000000000..25e01f42418 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsFromClassHeaderWithAnnotations.sig.kt.txt @@ -0,0 +1,65 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +open annotation class A : Annotation { + // CHECK: + // Mangled name: A{}x + // Public signature: /A.x|-8060530855978347579[0] + val x: String + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.String + // Public signature: /A.x.|316111172223894646[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: A#(kotlin.String){} + // Public signature: /A.|1280618353163213788[0] + constructor(x: String) /* primary */ + +} + +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C{}x + // Public signature: /C.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.x.|1482705010654679335[0] + @A(x = "C.x.get") + get + + // CHECK: + // Mangled name: C{}y + // Public signature: /C.y|3625903257357557171[0] + var y: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.y.|-6745575372101973707[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.y.|-7902422373892128922[0] + @A(x = "C.y.get") + get + // CHECK: + // Mangled name: C#(kotlin.Int){} + // Public signature: /C.y.|2154335559382602722[0] + @A(x = "C.y.set") + set + + // CHECK: + // Mangled name: C#(kotlin.Int;kotlin.Int){} + // Public signature: /C.|-7691762014320324121[0] + constructor(x: Int, y: Int) /* primary */ + +} + diff --git a/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.kt b/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.kt index a06050efc3c..8857935a344 100644 --- a/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.kt +++ b/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.kt @@ -1,4 +1,9 @@ // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: JS_IR +// MUTE_SIGNATURE_COMPARISON_K2: NATIVE +// ^ KT-57818 + annotation class TestAnn(val x: String) val test1: String @@ -13,4 +18,4 @@ val test3: String = "" @get:TestAnn("test4.get") @set:TestAnn("test4.set") -var test4: String = "" \ No newline at end of file +var test4: String = "" diff --git a/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.sig.kt.txt new file mode 100644 index 00000000000..a11d6cbd86a --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.sig.kt.txt @@ -0,0 +1,85 @@ +// CHECK: +// Mangled name: {}test3 +// Public signature: /test3|7677556066983021166[0] +val test3: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /test3.|-2084248125648281731[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test3.|-7333791615083236686[0] + @TestAnn(x = "test3.get") + get + +// CHECK: +// Mangled name: {}test4 +// Public signature: /test4|-9115637610245762085[0] +var test4: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /test4.|5046196083583551233[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test4.|4166854324968284003[0] + @TestAnn(x = "test4.get") + get + // CHECK: + // Mangled name: #(kotlin.String){} + // Public signature: /test4.|-6376420079491092905[0] + @TestAnn(x = "test4.set") + set + +// CHECK: +// Mangled name: TestAnn +// Public signature: /TestAnn|null[0] +open annotation class TestAnn : Annotation { + // CHECK: + // Mangled name: TestAnn{}x + // Public signature: /TestAnn.x|-8060530855978347579[0] + val x: String + // CHECK JVM_IR: + // Mangled name: TestAnn#(){}kotlin.String + // Public signature: /TestAnn.x.|316111172223894646[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAnn#(){} + // Public signature: /TestAnn.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: TestAnn#(kotlin.String){} + // Public signature: /TestAnn.|1280618353163213788[0] + constructor(x: String) /* primary */ + +} + +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /test1.|-7403750508378492770[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test1.|-5735092642142423279[0] + @TestAnn(x = "test1.get") + get(): String + +// CHECK: +// Mangled name: {}test2 +// Public signature: /test2|2517758057000911509[0] +var test2: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /test2.|-8062412501290172814[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test2.|-5218942532816206869[0] + @TestAnn(x = "test2.get") + get(): String + // CHECK: + // Mangled name: #(kotlin.String){} + // Public signature: /test2.|4560361687368503848[0] + @TestAnn(x = "test2.set") + set(value: String): Unit + diff --git a/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.kt b/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.kt index 5f901e369b0..65c1471ada9 100644 --- a/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.kt +++ b/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.kt @@ -1,7 +1,12 @@ // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: JS_IR +// MUTE_SIGNATURE_COMPARISON_K2: NATIVE +// ^ KT-57818 + annotation class AnnParam @setparam:AnnParam var p: Int = 0 -class C(@setparam:AnnParam var p: Int) \ No newline at end of file +class C(@setparam:AnnParam var p: Int) diff --git a/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.sig.kt.txt new file mode 100644 index 00000000000..8e2a18b8ead --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.sig.kt.txt @@ -0,0 +1,54 @@ +// CHECK: +// Mangled name: {}p +// Public signature: /p|6715504260787941082[0] +var p: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /p.|5329635969197638839[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /p.|-1162552463316289847[0] + get + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /p.|-6346582004572228570[0] + set + +// CHECK: +// Mangled name: AnnParam +// Public signature: /AnnParam|null[0] +open annotation class AnnParam : Annotation { + // CHECK: + // Mangled name: AnnParam#(){} + // Public signature: /AnnParam.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C{}p + // Public signature: /C.p|6715504260787941082[0] + var p: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.p.|5329635969197638839[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.p.|-1162552463316289847[0] + get + // CHECK: + // Mangled name: C#(kotlin.Int){} + // Public signature: /C.p.|-6346582004572228570[0] + set + + // CHECK: + // Mangled name: C#(kotlin.Int){} + // Public signature: /C.|-5182794243525578284[0] + constructor(p: Int) /* primary */ + +} + diff --git a/compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.kt b/compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.kt index 338b563d0cf..3e7731ac07b 100644 --- a/compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.kt +++ b/compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.kt @@ -1,4 +1,9 @@ // 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/annotations/receiverParameterWithAnnotations.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.sig.kt.txt new file mode 100644 index 00000000000..9f4ec4eecab --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.sig.kt.txt @@ -0,0 +1,62 @@ +// CHECK: +// Mangled name: Ann +// Public signature: /Ann|null[0] +open annotation class Ann : Annotation { + // CHECK: + // Mangled name: Ann#(){} + // Public signature: /Ann.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: A#f@kotlin.String(){}kotlin.String + // Public signature: /A.f|-7101655006580999052[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#f@kotlin.String(){} + // Public signature: /A.f|8972825158424444953[0] + fun String.f(): String + + // CHECK: + // Mangled name: A@kotlin.String?{}p + // Public signature: /A.p|-5332805019112550693[0] + val String?.p: String + // CHECK JVM_IR: + // Mangled name: A#@kotlin.String?(){}kotlin.String + // Public signature: /A.p.|2132774030714660058[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#@kotlin.String?(){} + // Public signature: /A.p.|-206460032103866705[0] + get(): String + +} + +// CHECK JVM_IR: +// Mangled name: #topLevelF@kotlin.String?(){}kotlin.String +// Public signature: /topLevelF|1393314255563085986[0] +// CHECK JS_IR NATIVE: +// Mangled name: #topLevelF@kotlin.String?(){} +// Public signature: /topLevelF|657392952960169607[0] +fun String?.topLevelF(): String + +// CHECK: +// Mangled name: @kotlin.String{}topLevelP +// Public signature: /topLevelP|4430474858321876067[0] +val String.topLevelP: String + // CHECK JVM_IR: + // Mangled name: #@kotlin.String(){}kotlin.String + // Public signature: /topLevelP.|6082050321613134215[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@kotlin.String(){} + // Public signature: /topLevelP.|529461791237324071[0] + get(): String + diff --git a/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.kt b/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.kt index bedcc898c7d..b2364e6b6b9 100644 --- a/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.kt +++ b/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.kt @@ -1,5 +1,8 @@ +// SKIP_SIGNATURE_DUMP +// ^ Different types in annotations generated by K1 and K2 + annotation class A(vararg val xs: String) @A(*arrayOf("a"), *arrayOf("b")) -fun test() {} \ No newline at end of file +fun test() {} diff --git a/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.sig.kt.txt new file mode 100644 index 00000000000..aec3268673c --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.sig.kt.txt @@ -0,0 +1,29 @@ +// CHECK: +// Mangled name: TestAnn +// Public signature: /TestAnn|null[0] +@Target(allowedTargets = [AnnotationTarget.TYPEALIAS]) +open annotation class TestAnn : Annotation { + // CHECK: + // Mangled name: TestAnn{}x + // Public signature: /TestAnn.x|-8060530855978347579[0] + val x: String + // CHECK JVM_IR: + // Mangled name: TestAnn#(){}kotlin.String + // Public signature: /TestAnn.x.|316111172223894646[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAnn#(){} + // Public signature: /TestAnn.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: TestAnn#(kotlin.String){} + // Public signature: /TestAnn.|1280618353163213788[0] + constructor(x: String) /* primary */ + +} + +// CHECK: +// Mangled name: TestTypeAlias +// Public signature: /TestTypeAlias|null[0] +@TestAnn(x = "TestTypeAlias") +typealias TestTypeAlias = String diff --git a/compiler/testData/ir/irText/declarations/annotations/typeParametersWithAnnotations.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/typeParametersWithAnnotations.sig.kt.txt new file mode 100644 index 00000000000..fcd01e68859 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/typeParametersWithAnnotations.sig.kt.txt @@ -0,0 +1,17 @@ +// CHECK: +// Mangled name: Anno +// Public signature: /Anno|null[0] +@Target(allowedTargets = [AnnotationTarget.TYPE_PARAMETER]) +open annotation class Anno : Annotation { + // CHECK: + // Mangled name: Anno#(){} + // Public signature: /Anno.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: #foo(){0§} +// Public signature: /foo|-7822584347064313243[0] +fun <@Anno T : Any?> foo(): Unit + diff --git a/compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.sig.kt.txt new file mode 100644 index 00000000000..c4f4b17a236 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.sig.kt.txt @@ -0,0 +1,51 @@ +// CHECK: +// Mangled name: TestAnn +// Public signature: /TestAnn|null[0] +open annotation class TestAnn : Annotation { + // CHECK: + // Mangled name: TestAnn{}x + // Public signature: /TestAnn.x|-8060530855978347579[0] + val x: String + // CHECK JVM_IR: + // Mangled name: TestAnn#(){}kotlin.String + // Public signature: /TestAnn.x.|316111172223894646[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAnn#(){} + // Public signature: /TestAnn.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: TestAnn#(kotlin.String){} + // Public signature: /TestAnn.|1280618353163213788[0] + constructor(x: String) /* primary */ + +} + +// CHECK: +// Mangled name: TestClassConstructor1 +// Public signature: /TestClassConstructor1|null[0] +class TestClassConstructor1 { + // CHECK: + // Mangled name: TestClassConstructor1{}xx + // Public signature: /TestClassConstructor1.xx|5916295751157136767[0] + val xx: Int + // CHECK JVM_IR: + // Mangled name: TestClassConstructor1#(){}kotlin.Int + // Public signature: /TestClassConstructor1.xx.|-7844073399004608724[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestClassConstructor1#(){} + // Public signature: /TestClassConstructor1.xx.|5648847738704808838[0] + get + + // CHECK: + // Mangled name: TestClassConstructor1#(kotlin.Int){} + // Public signature: /TestClassConstructor1.|-5182794243525578284[0] + constructor(@TestAnn(x = "TestClassConstructor1.x") x: Int) /* primary */ + +} + +// CHECK: +// Mangled name: #testFun(kotlin.Int){} +// Public signature: /testFun|7846764360131207179[0] +fun testFun(@TestAnn(x = "testFun.x") x: Int): Unit + diff --git a/compiler/testData/ir/irText/declarations/annotations/varargsInAnnotationArguments.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/varargsInAnnotationArguments.sig.kt.txt new file mode 100644 index 00000000000..9adb8fcc26d --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/varargsInAnnotationArguments.sig.kt.txt @@ -0,0 +1,85 @@ +// CHECK: +// Mangled name: A1 +// Public signature: /A1|null[0] +open annotation class A1 : Annotation { + // CHECK: + // Mangled name: A1{}xs + // Public signature: /A1.xs|1063330853857063704[0] + val xs: IntArray + // CHECK JVM_IR: + // Mangled name: A1#(){}kotlin.IntArray + // Public signature: /A1.xs.|5887559004820637749[0] + // CHECK JS_IR NATIVE: + // Mangled name: A1#(){} + // Public signature: /A1.xs.|-6958094100501701183[0] + get + + // CHECK: + // Mangled name: A1#(kotlin.IntArray...){} + // Public signature: /A1.|3304157197881351514[0] + constructor(vararg xs: Int) /* primary */ + +} + +// CHECK: +// Mangled name: A2 +// Public signature: /A2|null[0] +open annotation class A2 : Annotation { + // CHECK: + // Mangled name: A2{}xs + // Public signature: /A2.xs|1063330853857063704[0] + val xs: Array + // CHECK JVM_IR: + // Mangled name: A2#(){}kotlin.Array + // Public signature: /A2.xs.|9188548163055185324[0] + // CHECK JS_IR NATIVE: + // Mangled name: A2#(){} + // Public signature: /A2.xs.|-6958094100501701183[0] + get + + // CHECK: + // Mangled name: A2#(kotlin.Array...){} + // Public signature: /A2.|-6780234697714860085[0] + constructor(vararg xs: String) /* primary */ + +} + +// CHECK: +// Mangled name: AA +// Public signature: /AA|null[0] +open annotation class AA : Annotation { + // CHECK: + // Mangled name: AA{}xs + // Public signature: /AA.xs|1063330853857063704[0] + val xs: Array + // CHECK JVM_IR: + // Mangled name: AA#(){}kotlin.Array + // Public signature: /AA.xs.|-3667422235339963828[0] + // CHECK JS_IR NATIVE: + // Mangled name: AA#(){} + // Public signature: /AA.xs.|-6958094100501701183[0] + get + + // CHECK: + // Mangled name: AA#(kotlin.Array...){} + // Public signature: /AA.|-3149474316715311617[0] + constructor(vararg xs: A1) /* primary */ + +} + +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +@A1(xs = [1, 2, 3]) +@A2(xs = ["a", "b", "c"]) +@AA(xs = [A1(xs = [4]), A1(xs = [5]), A1(xs = [6])]) +fun test1(): Unit + +// CHECK: +// Mangled name: #test2(){} +// Public signature: /test2|4279114864133353152[0] +@A1(xs = []) +@A2(xs = []) +@AA(xs = []) +fun test2(): Unit + diff --git a/compiler/testData/ir/irText/declarations/annotations/variablesWithAnnotations.sig.kt.txt b/compiler/testData/ir/irText/declarations/annotations/variablesWithAnnotations.sig.kt.txt new file mode 100644 index 00000000000..e5fcc8e0435 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/variablesWithAnnotations.sig.kt.txt @@ -0,0 +1,28 @@ +// CHECK: +// Mangled name: TestAnn +// Public signature: /TestAnn|null[0] +open annotation class TestAnn : Annotation { + // CHECK: + // Mangled name: TestAnn{}x + // Public signature: /TestAnn.x|-8060530855978347579[0] + val x: String + // CHECK JVM_IR: + // Mangled name: TestAnn#(){}kotlin.String + // Public signature: /TestAnn.x.|316111172223894646[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestAnn#(){} + // Public signature: /TestAnn.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: TestAnn#(kotlin.String){} + // Public signature: /TestAnn.|1280618353163213788[0] + constructor(x: String) /* primary */ + +} + +// CHECK: +// Mangled name: #foo(){} +// Public signature: /foo|-1041209573719867811[0] +fun foo(): Unit + diff --git a/compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.kt b/compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.kt index 973802ffdee..f4c241a66aa 100644 --- a/compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.kt +++ b/compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.kt @@ -1,2 +1,7 @@ // FIR_IDENTICAL -val test = try { } catch (e : Throwable) { } \ No newline at end of file + +// 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/catchParameterInTopLevelProperty.sig.kt.txt b/compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.sig.kt.txt new file mode 100644 index 00000000000..7af58950a4a --- /dev/null +++ b/compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.sig.kt.txt @@ -0,0 +1,9 @@ +// CHECK: +// Mangled name: {}test +// Public signature: /test|-5712650070209114719[0] +val test: Unit + // CHECK: + // Mangled name: #(){} + // Public signature: /test.|208282462577758837[0] + get + diff --git a/compiler/testData/ir/irText/declarations/classLevelProperties.sig.kt.txt b/compiler/testData/ir/irText/declarations/classLevelProperties.sig.kt.txt new file mode 100644 index 00000000000..983ef1f50fe --- /dev/null +++ b/compiler/testData/ir/irText/declarations/classLevelProperties.sig.kt.txt @@ -0,0 +1,123 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C{}test1 + // Public signature: /C.test1|6005685442305498193[0] + val test1: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.test1.|3978508226793108919[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.test1.|-5735092642142423279[0] + get + + // CHECK: + // Mangled name: C{}test3 + // Public signature: /C.test3|7677556066983021166[0] + var test3: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.test3.|6145294165644146033[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.test3.|-7333791615083236686[0] + get + // CHECK: + // Mangled name: C#(kotlin.Int){} + // Public signature: /C.test3.|-4170290427940674844[0] + set + + // CHECK: + // Mangled name: C{}test4 + // Public signature: /C.test4|-9115637610245762085[0] + var test4: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.test4.|-8911174941514444072[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.test4.|4166854324968284003[0] + get + // CHECK: + // Mangled name: C#(kotlin.Int){} + // Public signature: /C.test4.|8105340104867729538[0] + set(value: Int): Unit + + // CHECK: + // Mangled name: C{}test5 + // Public signature: /C.test5|4734809624271551895[0] + var test5: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.test5.|-639929328226188476[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.test5.|-839819880171293643[0] + get + // CHECK: + // Mangled name: C#(kotlin.Int){} + // Public signature: /C.test5.|-8941794992615749462[0] + private set + + // CHECK: + // Mangled name: C{}test6 + // Public signature: /C.test6|-2606527149405855403[0] + val test6: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.test6.|-7378740493776144578[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.test6.|2028965735388282488[0] + get + + // CHECK: + // Mangled name: C{}test7 + // Public signature: /C.test7|1362036650170262859[0] + val test7: Int /* by */ + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.test7.|-7305979124924885797[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.test7.|-4463638325142628163[0] + get(): Int + + // CHECK: + // Mangled name: C{}test8 + // Public signature: /C.test8|5640428216506241852[0] + var test8: Int /* by */ + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.test8.|-4986202166917088055[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.test8.|-4670710835380513070[0] + get(): Int + // CHECK: + // Mangled name: C#(kotlin.Int){} + // Public signature: /C.test8.|-6993542117905462862[0] + set(: Int): Unit + + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: C{}test2 + // Public signature: /C.test2|2517758057000911509[0] + val test2: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.test2.|-8779933517717592707[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.test2.|-5218942532816206869[0] + get(): Int + +} + diff --git a/compiler/testData/ir/irText/declarations/constValInitializers.kt b/compiler/testData/ir/irText/declarations/constValInitializers.kt index f21864bfb3c..e0d09260bdf 100644 --- a/compiler/testData/ir/irText/declarations/constValInitializers.kt +++ b/compiler/testData/ir/irText/declarations/constValInitializers.kt @@ -1,5 +1,9 @@ // 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/constValInitializers.sig.kt.txt b/compiler/testData/ir/irText/declarations/constValInitializers.sig.kt.txt new file mode 100644 index 00000000000..3a3a13df5c9 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/constValInitializers.sig.kt.txt @@ -0,0 +1,84 @@ +// CHECK: +// Mangled name: {}I0 +// Public signature: /I0|3638397844945051376[0] +const val I0: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /I0.|-6746694356593193165[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /I0.|7085170094336958136[0] + get + +// CHECK: +// Mangled name: {}I1 +// Public signature: /I1|84494794639401383[0] +const val I1: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /I1.|-8819240179982204215[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /I1.|1430672906566406691[0] + get + +// CHECK: +// Mangled name: {}I2 +// Public signature: /I2|-5820322169900540552[0] +const val I2: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /I2.|-4989683773709385937[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /I2.|-1160209788406877161[0] + get + +// CHECK: +// Mangled name: {}STR1 +// Public signature: /STR1|-6743560849647323388[0] +const val STR1: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /STR1.|-2293085048547070941[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /STR1.|5781950605000309766[0] + get + +// CHECK: +// Mangled name: {}STR2 +// Public signature: /STR2|373630768127354084[0] +const val STR2: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /STR2.|1585456442054637269[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /STR2.|8041479152331919578[0] + get + +// CHECK: +// Mangled name: {}STR3 +// Public signature: /STR3|-2584825627971705247[0] +const val STR3: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /STR3.|-7307022761040876675[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /STR3.|8574952695803340733[0] + get + +// CHECK: +// Mangled name: {}STR4 +// Public signature: /STR4|-8283585211440994945[0] +const val STR4: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /STR4.|-2113476242053901162[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /STR4.|-7243567156065898284[0] + get + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.kt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.kt index 1e640051fd8..1e237a802ad 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.kt @@ -1,6 +1,9 @@ // !LANGUAGE: +ContextReceivers // TARGET_BACKEND: JVM_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 new file mode 100644 index 00000000000..b4e9e409634 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.sig.kt.txt @@ -0,0 +1,84 @@ +// CHECK: +// Mangled name: {}operationScore +// Public signature: /operationScore|-9073278321118823634[0] +var operationScore: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /operationScore.|7107010356269447258[0] + get + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /operationScore.|1936076120216071025[0] + set + +// CHECK: +// Mangled name: MyContainer +// Public signature: /MyContainer|null[0] +data class MyContainer { + // CHECK: + // Mangled name: MyContainer{}i + // Public signature: /MyContainer.i|5014384761142332495[0] + var i: Int + // CHECK JVM_IR: + // Mangled name: MyContainer#(){}kotlin.Int + // Public signature: /MyContainer.i.|-8784396159001927527[0] + get + // CHECK: + // Mangled name: MyContainer#(kotlin.Int){} + // Public signature: /MyContainer.i.|1223530399758590178[0] + set + + // CHECK: + // Mangled name: MyContainer#(kotlin.Int){} + // Public signature: /MyContainer.|-5182794243525578284[0] + constructor(i: Int) /* primary */ + // CHECK JVM_IR: + // Mangled name: MyContainer#component1(){}kotlin.Int + // Public signature: /MyContainer.component1|-8217597213800111288[0] + operator fun component1(): Int + + // CHECK JVM_IR: + // Mangled name: MyContainer#copy(kotlin.Int){}MyContainer + // Public signature: /MyContainer.copy|-2712595066263545556[0] + fun copy(i: Int): MyContainer + + // CHECK JVM_IR: + // Mangled name: MyContainer#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /MyContainer.equals|722809408929142791[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: MyContainer#hashCode(){}kotlin.Int + // Public signature: /MyContainer.hashCode|-8048879360829830756[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: MyContainer#toString(){}kotlin.String + // Public signature: /MyContainer.toString|6958853723545266802[0] + override fun toString(): String + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +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 +// 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 +// 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){} +// 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 7c6ec1d20e9..f40f4bcb855 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.kt @@ -1,6 +1,9 @@ // !LANGUAGE: +ContextReceivers // TARGET_BACKEND: JVM_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 new file mode 100644 index 00000000000..7e45e47e8ef --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.sig.kt.txt @@ -0,0 +1,65 @@ +// CHECK: +// Mangled name: MyContainer +// Public signature: /MyContainer|null[0] +data class MyContainer { + // CHECK: + // Mangled name: MyContainer{}s + // Public signature: /MyContainer.s|7217541905509134881[0] + var s: String + // CHECK JVM_IR: + // Mangled name: MyContainer#(){}kotlin.String + // Public signature: /MyContainer.s.|4142379646177092803[0] + get + // CHECK: + // Mangled name: MyContainer#(kotlin.String){} + // Public signature: /MyContainer.s.|8225901422521337963[0] + set + + // CHECK: + // Mangled name: MyContainer#(kotlin.String){} + // Public signature: /MyContainer.|1280618353163213788[0] + constructor(s: String) /* primary */ + // CHECK JVM_IR: + // Mangled name: MyContainer#component1(){}kotlin.String + // Public signature: /MyContainer.component1|-7481405593404337796[0] + operator fun component1(): String + + // CHECK JVM_IR: + // Mangled name: MyContainer#copy(kotlin.String){}MyContainer + // Public signature: /MyContainer.copy|-9194766205182052641[0] + fun copy(s: String): MyContainer + + // CHECK JVM_IR: + // Mangled name: MyContainer#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /MyContainer.equals|722809408929142791[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: MyContainer#hashCode(){}kotlin.Int + // Public signature: /MyContainer.hashCode|-8048879360829830756[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: MyContainer#toString(){}kotlin.String + // Public signature: /MyContainer.toString|6958853723545266802[0] + override fun toString(): String + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +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? +// 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){} +// 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 f2dff2e9e81..01aa6c8d3e4 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/class.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/class.kt @@ -1,8 +1,12 @@ // FIR_IDENTICAL // !LANGUAGE: +ContextReceivers +// DUMP_LOCAL_DECLARATION_SIGNATURES // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57428, KT-57435 + 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 new file mode 100644 index 00000000000..dab081b8a61 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/class.sig.kt.txt @@ -0,0 +1,50 @@ +// CHECK: +// Mangled name: Inner +// 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){} + // Public signature: /Inner.|7428094623108856579[0] + constructor($context_receiver_0: Outer, arg: Any) /* primary */ + // CHECK: + // Mangled name computed from Ir: Inner.contextReceiverField0 + // Mangled name computed from Descriptor: Inner{}contextReceiverField0#jf + private /* final field */ val contextReceiverField0: Outer + + // CHECK JVM_IR: + // Mangled name: Inner#bar(){}kotlin.Int + // Public signature: /Inner.bar|-6436649210114349217[0] + fun bar(): Int + +} + +// CHECK: +// Mangled name: Outer +// Public signature: /Outer|null[0] +class Outer { + // CHECK: + // Mangled name: Outer{}x + // Public signature: /Outer.x|-8060530855978347579[0] + val x: Int + field + // CHECK JVM_IR: + // Mangled name: Outer#(){}kotlin.Int + // Public signature: /Outer.x.|4966956098150895696[0] + get + + // CHECK: + // Mangled name: Outer#(){} + // Public signature: /Outer.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: #f(Outer){} +// Public signature: /f|-90367846469451219[0] +fun f(outer: Outer): Unit + // CHECK JVM_IR: + // Mangled name: #f(Outer){}##static@Outer(){}Inner + local fun Outer.(): Inner + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.kt b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.kt index 6e40fe38b91..75ff39ae126 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.kt @@ -1,6 +1,9 @@ // !LANGUAGE: +ContextReceivers // TARGET_BACKEND: JVM_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 new file mode 100644 index 00000000000..1b83e5f474b --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.sig.kt.txt @@ -0,0 +1,114 @@ +// CHECK: +// Mangled name: {}operationScore +// Public signature: /operationScore|-9073278321118823634[0] +var operationScore: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /operationScore.|7107010356269447258[0] + get + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /operationScore.|1936076120216071025[0] + set + +// CHECK: +// Mangled name: Result +// Public signature: /Result|null[0] +data class Result { + // CHECK: + // Mangled name: Result{}i + // Public signature: /Result.i|5014384761142332495[0] + var i: Int + // CHECK JVM_IR: + // Mangled name: Result#(){}kotlin.Int + // Public signature: /Result.i.|-8784396159001927527[0] + get + // CHECK: + // Mangled name: Result#(kotlin.Int){} + // Public signature: /Result.i.|1223530399758590178[0] + set + + // CHECK: + // Mangled name: Result#(kotlin.Int){} + // Public signature: /Result.|-5182794243525578284[0] + constructor(i: Int) /* primary */ + // CHECK JVM_IR: + // Mangled name: Result#component1(){}kotlin.Int + // Public signature: /Result.component1|-8217597213800111288[0] + operator fun component1(): Int + + // CHECK JVM_IR: + // Mangled name: Result#copy(kotlin.Int){}Result + // Public signature: /Result.copy|5439238034196076859[0] + fun copy(i: Int): Result + + // CHECK JVM_IR: + // Mangled name: Result#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Result.equals|722809408929142791[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Result#hashCode(){}kotlin.Int + // Public signature: /Result.hashCode|-8048879360829830756[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Result#toString(){}kotlin.String + // Public signature: /Result.toString|6958853723545266802[0] + override fun toString(): String + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +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 +// 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){} +// 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 +// 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){} +// 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 +// 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){} +// 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 +// 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){} +// 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 86f97d0b635..cb120ede724 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.kt @@ -3,6 +3,9 @@ // 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 new file mode 100644 index 00000000000..5e5c809313b --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.sig.kt.txt @@ -0,0 +1,42 @@ +// CHECK: +// Mangled name: Context +// Public signature: /Context|null[0] +class Context { + // CHECK: + // Mangled name: Context#(){} + // Public signature: /Context.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Context#foo(){}kotlin.Int + // Public signature: /Context.foo|-1256155405684507276[0] + fun foo(): Int + +} + +// CHECK: +// Mangled name: Test +// Public signature: /Test|null[0] +class Test { + // CHECK: + // Mangled name computed from Ir: Test#(Context){} + // Mangled name computed from Descriptor: Test#!Context(){} + // Public signature: /Test.|4848133296495274545[0] + constructor($context_receiver_0: Context) /* primary */ + // CHECK: + // Mangled name computed from Ir: Test.contextReceiverField0 + // Mangled name computed from Descriptor: Test{}contextReceiverField0#jf + private /* final field */ val contextReceiverField0: Context + + // CHECK: + // Mangled name: Test#bar(){} + // Public signature: /Test.bar|496682602797471549[0] + fun bar(): Unit + + // CHECK JVM_IR: + // Mangled name: Test#foo(){}kotlin.Int + // Public signature: /Test.foo|-1256155405684507276[0] + fun foo(): Int + +} + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualFunctionConversion.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualFunctionConversion.sig.kt.txt new file mode 100644 index 00000000000..5badf178745 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualFunctionConversion.sig.kt.txt @@ -0,0 +1,15 @@ +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +fun box(): String + +// CHECK JVM_IR: +// Mangled name: #callWithContext(kotlin.Function1){}kotlin.String +// Public signature: /callWithContext|2869415620415030876[0] +fun callWithContext(f: Function1): String + +// CHECK JVM_IR: +// Mangled name: #withContext(kotlin.Function1){}kotlin.String +// Public signature: /withContext|-1533357735492795771[0] +fun withContext(f: Function1): String + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.kt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.kt index 280e426f67b..458f70d4f51 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.kt @@ -1,6 +1,9 @@ // !LANGUAGE: +ContextReceivers // TARGET_BACKEND: JVM_IR +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57435 + class Context { fun c() = 1 } @@ -34,4 +37,4 @@ fun box(): String = with(Context()) { result += 1.testInlineWithExtensionAndMultipleContextsAndArgs() } return if (result == 23) "OK" else "fail" -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.sig.kt.txt new file mode 100644 index 00000000000..c7c950742b1 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.sig.kt.txt @@ -0,0 +1,71 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A { + // CHECK: + // Mangled name: A{}a + // Public signature: /A.a|-1200697420457237799[0] + val a: Any? + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Any? + // Public signature: /A.a.|-5253003527138676623[0] + get + + // CHECK: + // Mangled name: A#(kotlin.Any?){} + // Public signature: /A.|-8205545948568413246[0] + constructor(a: Any?) /* primary */ + +} + +// CHECK: +// Mangled name: Context +// Public signature: /Context|null[0] +class Context { + // CHECK: + // Mangled name: Context#(){} + // Public signature: /Context.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Context#c(){}kotlin.Int + // Public signature: /Context.c|-7090409735962961857[0] + fun c(): Int + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +fun box(): String + +// CHECK JVM_IR: +// Mangled name computed from Ir: #testInline(Context){}kotlin.Int +// Mangled name computed from Descriptor: #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 +// 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 +// 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 +// 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 +// 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 c626b9384d8..0428ef443d7 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.kt @@ -1,8 +1,12 @@ // FIR_IDENTICAL // !LANGUAGE: +ContextReceivers +// DUMP_LOCAL_DECLARATION_SIGNATURES // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57428, KT-57435 + class O(val o: String) context(O) diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.sig.kt.txt new file mode 100644 index 00000000000..c0fe0216b85 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.sig.kt.txt @@ -0,0 +1,65 @@ +// CHECK: +// Mangled name: O +// Public signature: /O|null[0] +class O { + // CHECK: + // Mangled name: O{}o + // Public signature: /O.o|-5332571409865440260[0] + val o: String + field + // CHECK JVM_IR: + // Mangled name: O#(){}kotlin.String + // Public signature: /O.o.|2606027183154875572[0] + get + + // CHECK: + // Mangled name: O#(kotlin.String){} + // Public signature: /O.|1280618353163213788[0] + constructor(o: String) /* primary */ + +} + +// CHECK: +// Mangled name: OK +// Public signature: /OK|null[0] +class OK { + // CHECK: + // Mangled name: OK{}k + // Public signature: /OK.k|2162811783424158931[0] + val k: String + field + // CHECK JVM_IR: + // Mangled name: OK#(){}kotlin.String + // Public signature: /OK.k.|-8248201737917988340[0] + get + + // CHECK: + // Mangled name: OK{}result + // Public signature: /OK.result|456251868630197251[0] + val result: String + field + // CHECK JVM_IR: + // Mangled name: OK#(){}kotlin.String + // Public signature: /OK.result.|8441547134620975366[0] + get + + // CHECK: + // Mangled name computed from Ir: OK#(O;kotlin.String){} + // Mangled name computed from Descriptor: OK#!O(kotlin.String){} + // Public signature: /OK.|-804847331171011326[0] + constructor($context_receiver_0: O, k: String) /* primary */ + // CHECK: + // Mangled name computed from Ir: OK.contextReceiverField0 + // Mangled name computed from Descriptor: OK{}contextReceiverField0#jf + private /* final field */ val contextReceiverField0: O + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +fun box(): String + // CHECK JVM_IR: + // Mangled name: #box(){}kotlin.String##static@O(){}kotlin.String + local fun O.(): String + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.kt b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.kt index 4622a0f3308..563923c6c91 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.kt @@ -2,6 +2,9 @@ // TARGET_BACKEND: JVM_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 new file mode 100644 index 00000000000..b108faaf487 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.sig.kt.txt @@ -0,0 +1,83 @@ +// CHECK: +// Mangled name: {}operationScore +// Public signature: /operationScore|-9073278321118823634[0] +var operationScore: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /operationScore.|7107010356269447258[0] + get + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /operationScore.|1936076120216071025[0] + set + +// CHECK: +// Mangled name: Delegate +// Public signature: /Delegate|null[0] +class Delegate { + // CHECK: + // Mangled name: Delegate{}delegateValue + // Public signature: /Delegate.delegateValue|-8268138023786011357[0] + var delegateValue: String + // CHECK JVM_IR: + // Mangled name: Delegate#(){}kotlin.String + // Public signature: /Delegate.delegateValue.|-8802990183041924458[0] + get + // CHECK: + // Mangled name: Delegate#(kotlin.String){} + // Public signature: /Delegate.delegateValue.|-6867110197203157583[0] + set + + // CHECK: + // Mangled name: Delegate#(){} + // Public signature: /Delegate.|-5645683436151566731[0] + 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 + // 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){} + // Public signature: /Delegate.setValue|9105212648373628088[0] + operator fun setValue($context_receiver_0: Int, thisRef: Any?, property: KProperty<*>, value: String): Unit + +} + +// CHECK: +// Mangled name: Result +// Public signature: /Result|null[0] +class Result { + // CHECK: + // Mangled name: Result{}s + // Public signature: /Result.s|7217541905509134881[0] + var s: String /* by */ + // CHECK JVM_IR: + // Mangled name: Result#(){}kotlin.String + // Public signature: /Result.s.|4142379646177092803[0] + get(): String + // CHECK: + // Mangled name: Result#(kotlin.String){} + // Public signature: /Result.s.|8225901422521337963[0] + set(: String): Unit + + // CHECK: + // Mangled name computed from Ir: Result#(kotlin.Int){} + // Mangled name computed from Descriptor: Result#!kotlin.Int(){} + // Public signature: /Result.|-1392650824251324893[0] + constructor($context_receiver_0: Int) /* primary */ + // CHECK: + // Mangled name computed from Ir: Result.contextReceiverField0 + // Mangled name computed from Descriptor: Result{}contextReceiverField0#jf + private /* final field */ val contextReceiverField0: Int + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +fun box(): String + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.kt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.kt index 167cf3187e0..fd1c3fa1f70 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.kt @@ -2,6 +2,9 @@ // !LANGUAGE: +ContextReceivers // TARGET_BACKEND: JVM_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 new file mode 100644 index 00000000000..bbf86fb66cd --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.sig.kt.txt @@ -0,0 +1,71 @@ +// CHECK: +// Mangled name: Circle +// Public signature: /Circle|null[0] +class Circle : Shape { + // CHECK: + // Mangled name: Circle#(){} + // Public signature: /Circle.|-5645683436151566731[0] + 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 + // Public signature: /Circle.draw|-6733499063990640842[0] + override fun draw($context_receiver_0: Canvas): String + +} + +// CHECK: +// Mangled name: Canvas +// Public signature: /Canvas|null[0] +interface Canvas { + + // CHECK: + // Mangled name: Canvas{}suffix + // Public signature: /Canvas.suffix|-3301965527200666288[0] + abstract val suffix: String + // CHECK JVM_IR: + // Mangled name: Canvas#(){}kotlin.String + // Public signature: /Canvas.suffix.|8958072538558116778[0] + abstract get + +} + +// CHECK: +// Mangled name: Shape +// Public signature: /Shape|null[0] +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 + // Public signature: /Shape.draw|-6733499063990640842[0] + abstract fun draw($context_receiver_0: Canvas): String + +} + +// CHECK: +// Mangled name: MyCanvas +// Public signature: /MyCanvas|null[0] +object MyCanvas : Canvas { + // CHECK: + // Mangled name: MyCanvas{}suffix + // Public signature: /MyCanvas.suffix|-3301965527200666288[0] + override val suffix: String + // CHECK JVM_IR: + // Mangled name: MyCanvas#(){}kotlin.String + // Public signature: /MyCanvas.suffix.|8958072538558116778[0] + override get + + // CHECK: + // Mangled name: MyCanvas#(){} + // Public signature: /MyCanvas.|-5645683436151566731[0] + private constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +fun box(): String + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.kt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.kt index 0cf7e3a6ced..b0069b44773 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.kt @@ -1,6 +1,9 @@ // !LANGUAGE: +ContextReceivers // TARGET_BACKEND: JVM_IR +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429, KT-57435 + data class Pair(val first: A, val second: B) context(Comparator) 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 new file mode 100644 index 00000000000..08bf0d54af7 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.sig.kt.txt @@ -0,0 +1,79 @@ +// CHECK: +// Mangled name: Pair +// Public signature: /Pair|null[0] +data class Pair { + // CHECK: + // Mangled name: Pair{}first + // Public signature: /Pair.first|1497393077339299626[0] + val first: A + // CHECK JVM_IR: + // Mangled name: Pair#(){}1:0 + // Public signature: /Pair.first.|-2355525345180386541[0] + get + + // CHECK: + // Mangled name: Pair{}second + // Public signature: /Pair.second|8934636033843101515[0] + val second: B + // CHECK JVM_IR: + // Mangled name: Pair#(){}1:1 + // Public signature: /Pair.second.|-7108495346814383827[0] + get + + // CHECK: + // Mangled name: Pair#(1:0;1:1){} + // Public signature: /Pair.|3086114026882374588[0] + constructor(first: A, second: B) /* primary */ + // CHECK JVM_IR: + // Mangled name: Pair#component1(){}1:0 + // Public signature: /Pair.component1|2393470133763651536[0] + operator fun component1(): A + + // CHECK JVM_IR: + // Mangled name: Pair#component2(){}1:1 + // Public signature: /Pair.component2|319033347667924570[0] + operator fun component2(): B + + // CHECK JVM_IR: + // Mangled name: Pair#copy(1:0;1:1){}Pair<1:0,1:1> + // Public signature: /Pair.copy|7298985996422673194[0] + fun copy(first: A, second: B): Pair + + // CHECK JVM_IR: + // Mangled name: Pair#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Pair.equals|722809408929142791[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Pair#hashCode(){}kotlin.Int + // Public signature: /Pair.hashCode|-8048879360829830756[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Pair#toString(){}kotlin.String + // Public signature: /Pair.toString|6958853723545266802[0] + override fun toString(): String + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +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 +// Public signature: /compareTo|-4091974102091923679[0] +infix operator fun T.compareTo($context_receiver_0: Comparator, other: T): Int + +// CHECK: +// Mangled name: @Pair<0:0,0:0>{0§}min +// 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 + // 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 06dc09c49cc..04d8daebc0a 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.kt @@ -2,6 +2,9 @@ // TARGET_BACKEND: JVM_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 new file mode 100644 index 00000000000..59c8c58dca5 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.sig.kt.txt @@ -0,0 +1,35 @@ +// CHECK: +// Mangled name: View +// Public signature: /View|null[0] +class View { + // CHECK: + // Mangled name: View{}coefficient + // Public signature: /View.coefficient|4563127391682800227[0] + val coefficient: Int + // CHECK JVM_IR: + // Mangled name: View#(){}kotlin.Int + // Public signature: /View.coefficient.|2286291581442465794[0] + get + + // CHECK: + // Mangled name: View#(){} + // Public signature: /View.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +fun box(): String + +// CHECK: +// Mangled name: @kotlin.Int{}dp +// 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 + // 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 31534e1fac5..9758fdce6c5 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.kt @@ -1,6 +1,9 @@ // !LANGUAGE: +ContextReceivers // TARGET_BACKEND: JVM_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 new file mode 100644 index 00000000000..f266c1502dd --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.sig.kt.txt @@ -0,0 +1,62 @@ +// CHECK: +// Mangled name: K +// Public signature: /K|null[0] +class K { + // CHECK: + // Mangled name: K{}k + // Public signature: /K.k|2162811783424158931[0] + val k: String + // CHECK JVM_IR: + // Mangled name: K#(){}kotlin.String + // Public signature: /K.k.|-8248201737917988340[0] + get + + // CHECK: + // Mangled name: K#(){} + // Public signature: /K.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: O +// Public signature: /O|null[0] +class O { + // CHECK: + // Mangled name: O{}o + // Public signature: /O.o|-5332571409865440260[0] + val o: String + // CHECK JVM_IR: + // Mangled name: O#(){}kotlin.String + // Public signature: /O.o.|2606027183154875572[0] + get + + // CHECK: + // Mangled name: O#(){} + // Public signature: /O.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: Param +// Public signature: /Param|null[0] +class Param { + // CHECK: + // Mangled name: Param#(){} + // Public signature: /Param.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +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 +// 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 a90dd8afdcc..229f18fe829 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.kt @@ -2,6 +2,9 @@ // TARGET_BACKEND: JVM_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 new file mode 100644 index 00000000000..5f7a1f9a721 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.sig.kt.txt @@ -0,0 +1,93 @@ +// CHECK: +// Mangled name: Monoid +// Public signature: /Monoid|null[0] +interface Monoid : Semigroup { + // CHECK JVM_IR: + // Mangled name: Monoid#combine@1:0(1:0){}1:0 + // Public signature: /Monoid.combine|-3517256775590682507[0] + abstract /* fake */ override infix fun T.combine(other: T): T + + // CHECK: + // Mangled name: Monoid{}unit + // Public signature: /Monoid.unit|-5200734743185576787[0] + abstract val unit: T + // CHECK JVM_IR: + // Mangled name: Monoid#(){}1:0 + // Public signature: /Monoid.unit.|-2842189358620964971[0] + abstract get + +} + +// CHECK: +// Mangled name: Semigroup +// Public signature: /Semigroup|null[0] +interface Semigroup { + + // CHECK JVM_IR: + // Mangled name: Semigroup#combine@1:0(1:0){}1:0 + // Public signature: /Semigroup.combine|-3517256775590682507[0] + abstract infix fun T.combine(other: T): T + +} + +// CHECK: +// Mangled name: IntMonoid +// Public signature: /IntMonoid|null[0] +object IntMonoid : Monoid { + // CHECK: + // Mangled name: IntMonoid{}unit + // Public signature: /IntMonoid.unit|-5200734743185576787[0] + override val unit: Int + // CHECK JVM_IR: + // Mangled name: IntMonoid#(){}kotlin.Int + // Public signature: /IntMonoid.unit.|3772729924213749256[0] + override get + + // CHECK: + // Mangled name: IntMonoid#(){} + // Public signature: /IntMonoid.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: IntMonoid#combine@kotlin.Int(kotlin.Int){}kotlin.Int + // Public signature: /IntMonoid.combine|4765448259581317405[0] + override infix fun Int.combine(other: Int): Int + +} + +// CHECK: +// Mangled name: StringMonoid +// Public signature: /StringMonoid|null[0] +object StringMonoid : Monoid { + // CHECK: + // Mangled name: StringMonoid{}unit + // Public signature: /StringMonoid.unit|-5200734743185576787[0] + override val unit: String + // CHECK JVM_IR: + // Mangled name: StringMonoid#(){}kotlin.String + // Public signature: /StringMonoid.unit.|4504480110251605077[0] + override get + + // CHECK: + // Mangled name: StringMonoid#(){} + // Public signature: /StringMonoid.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: StringMonoid#combine@kotlin.String(kotlin.String){}kotlin.String + // Public signature: /StringMonoid.combine|-5815259829474546918[0] + override infix fun String.combine(other: String): String + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +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 +// 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 24146d8f967..e6868006d65 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/function.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/function.kt @@ -1,8 +1,12 @@ // FIR_IDENTICAL // !LANGUAGE: +ContextReceivers +// DUMP_LOCAL_DECLARATION_SIGNATURES // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57428, KT-57435 + 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 new file mode 100644 index 00000000000..21a4f311976 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/function.sig.kt.txt @@ -0,0 +1,35 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C{}c + // Public signature: /C.c|-4416962153448040627[0] + val c: Int + field + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.c.|-2440337234483931882[0] + get + + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: #bar(C){} +// Public signature: /bar|-380723744805794672[0] +fun bar(c: C): Unit + // CHECK: + // Mangled name: #bar(C){}##static@C(){} + local fun C.(): Unit + +// CHECK: +// Mangled name computed from Ir: #foo(C){} +// Mangled name computed from Descriptor: #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 c1a1494714a..23eff898c5b 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.kt @@ -2,6 +2,9 @@ // 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 new file mode 100644 index 00000000000..7467c80bb7a --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.sig.kt.txt @@ -0,0 +1,80 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C{}c + // Public signature: /C.c|-4416962153448040627[0] + val c: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.c.|-2440337234483931882[0] + get + + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: Param +// Public signature: /Param|null[0] +class Param { + // CHECK: + // Mangled name: Param#(){} + // Public signature: /Param.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: R +// Public signature: /R|null[0] +class R { + // CHECK: + // Mangled name: R{}r + // Public signature: /R.r|-8117627916896159533[0] + val r: Int + // CHECK JVM_IR: + // Mangled name: R#(){}kotlin.Int + // Public signature: /R.r.|4210912234201800356[0] + get + + // CHECK: + // Mangled name: R#(){} + // Public signature: /R.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name computed from Ir: #f1@R(C;kotlin.Function3){} +// Mangled name computed from Descriptor: #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){} +// 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){} +// 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){} +// Public signature: /f4|-1495265522536685659[0] +fun f4($context_receiver_0: C, g: Function1): Unit + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.kt b/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.kt index 508a1b5a8f4..5eaad6e5c47 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.kt @@ -4,6 +4,10 @@ // IGNORE_BACKEND_K1: JS_IR // IGNORE_BACKEND_K1: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429, KT-57435 + + context(T) class A context(Collection

) class B

diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.sig.kt.txt new file mode 100644 index 00000000000..cc18d2b724d --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.sig.kt.txt @@ -0,0 +1,42 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A { + // CHECK: + // Mangled name computed from Ir: A#(1:0){} + // Mangled name computed from Descriptor: A#!1:0(){} + // Public signature: /A.|5547349096232763669[0] + constructor($context_receiver_0: T) /* primary */ + // CHECK: + // Mangled name computed from Ir: A.contextReceiverField0 + // Mangled name computed from Descriptor: A{}contextReceiverField0#jf + private /* final field */ val contextReceiverField0: T + +} + +// CHECK: +// Mangled name: B +// 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>(){} + // Public signature: /B.|-5453957848603821578[0] + constructor($context_receiver_0: Collection

) /* primary */ + // CHECK: + // Mangled name computed from Ir: B.contextReceiverField0 + // Mangled name computed from Descriptor: B{}contextReceiverField0#jf + private /* final field */ val contextReceiverField0: Collection

+ +} + +// CHECK: +// Mangled name: #bar@kotlin.collections.Collection(){} +// Public signature: /bar|-6231113953181180683[0] +fun Collection.bar(): Unit + +// CHECK: +// Mangled name: #foo@kotlin.Int(){} +// Public signature: /foo|4521317896132265411[0] +fun Int.foo(): Unit + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.kt b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.kt index 0a0f62aba1a..f0f27173010 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.kt @@ -2,6 +2,9 @@ // TARGET_BACKEND: JVM_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 new file mode 100644 index 00000000000..2d56d35b36d --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.sig.kt.txt @@ -0,0 +1,138 @@ +// CHECK: +// Mangled name: Counter +// Public signature: /Counter|null[0] +data class Counter { + // CHECK: + // Mangled name: Counter{}i + // Public signature: /Counter.i|5014384761142332495[0] + var i: Int + // CHECK JVM_IR: + // Mangled name: Counter#(){}kotlin.Int + // Public signature: /Counter.i.|-8784396159001927527[0] + get + // CHECK: + // Mangled name: Counter#(kotlin.Int){} + // Public signature: /Counter.i.|1223530399758590178[0] + set + + // CHECK: + // Mangled name: Counter#(kotlin.Int){} + // Public signature: /Counter.|-5182794243525578284[0] + constructor(i: Int) /* primary */ + // CHECK JVM_IR: + // Mangled name: Counter#component1(){}kotlin.Int + // Public signature: /Counter.component1|-8217597213800111288[0] + operator fun component1(): Int + + // CHECK JVM_IR: + // Mangled name: Counter#copy(kotlin.Int){}Counter + // Public signature: /Counter.copy|2961790952651150110[0] + fun copy(i: Int): Counter + + // CHECK JVM_IR: + // Mangled name: Counter#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Counter.equals|722809408929142791[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Counter#hashCode(){}kotlin.Int + // Public signature: /Counter.hashCode|-8048879360829830756[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Counter#toString(){}kotlin.String + // Public signature: /Counter.toString|6958853723545266802[0] + override fun toString(): String + +} + +// CHECK: +// Mangled name: CounterConfig +// Public signature: /CounterConfig|null[0] +data class CounterConfig { + // CHECK: + // Mangled name: CounterConfig{}max + // Public signature: /CounterConfig.max|-4328207510034083913[0] + val max: Int + // CHECK JVM_IR: + // Mangled name: CounterConfig#(){}kotlin.Int + // Public signature: /CounterConfig.max.|3083068406880796820[0] + get + + // CHECK: + // Mangled name: CounterConfig#(kotlin.Int){} + // Public signature: /CounterConfig.|-5182794243525578284[0] + constructor(max: Int) /* primary */ + // CHECK JVM_IR: + // Mangled name: CounterConfig#component1(){}kotlin.Int + // Public signature: /CounterConfig.component1|-8217597213800111288[0] + operator fun component1(): Int + + // CHECK JVM_IR: + // Mangled name: CounterConfig#copy(kotlin.Int){}CounterConfig + // Public signature: /CounterConfig.copy|-6936688204078599579[0] + fun copy(max: Int): CounterConfig + + // CHECK JVM_IR: + // Mangled name: CounterConfig#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /CounterConfig.equals|722809408929142791[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: CounterConfig#hashCode(){}kotlin.Int + // Public signature: /CounterConfig.hashCode|-8048879360829830756[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: CounterConfig#toString(){}kotlin.String + // Public signature: /CounterConfig.toString|6958853723545266802[0] + override fun toString(): String + +} + +// CHECK: +// Mangled name: CounterIterator +// Public signature: /CounterIterator|null[0] +class CounterIterator : Iterator { + // CHECK: + // Mangled name: CounterIterator{}counter + // Public signature: /CounterIterator.counter|3849500605769271673[0] + private val counter: Counter + // CHECK JVM_IR: + // Mangled name: CounterIterator#(){}Counter + // Public signature: /CounterIterator.counter.|-1972897806384113317[0] + private get + + // CHECK: + // Mangled name computed from Ir: CounterIterator#(CounterConfig;Counter){} + // Mangled name computed from Descriptor: CounterIterator#!CounterConfig(Counter){} + // Public signature: /CounterIterator.|4731448293962665986[0] + constructor($context_receiver_0: CounterConfig, counter: Counter) /* primary */ + // CHECK: + // Mangled name computed from Ir: CounterIterator.contextReceiverField0 + // Mangled name computed from Descriptor: CounterIterator{}contextReceiverField0#jf + private /* final field */ val contextReceiverField0: CounterConfig + + // CHECK JVM_IR: + // Mangled name: CounterIterator#hasNext(){}kotlin.Boolean + // Public signature: /CounterIterator.hasNext|-8822308834813776763[0] + override operator fun hasNext(): Boolean + + // CHECK JVM_IR: + // Mangled name: CounterIterator#next(){}kotlin.Int + // Public signature: /CounterIterator.next|-2200495694769701977[0] + override operator fun next(): Int + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +fun box(): String + +// CHECK JVM_IR: +// Mangled name computed from Ir: #iterator@Counter(CounterConfig){}CounterIterator +// Mangled name computed from Descriptor: #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 72bfbffee29..6d600ea2e57 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/kt52791.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/kt52791.kt @@ -2,5 +2,8 @@ // FIR_IDENTICAL // TARGET_BACKEND: JVM_IR +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57435 + context(Unit, Int) -class MyClass \ No newline at end of file +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 new file mode 100644 index 00000000000..a78c5217e0f --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/kt52791.sig.kt.txt @@ -0,0 +1,20 @@ +// CHECK: +// Mangled name: MyClass +// 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(){} + // Public signature: /MyClass.|1062323742830185042[0] + constructor($context_receiver_0: Unit, $context_receiver_1: Int) /* primary */ + // CHECK: + // Mangled name computed from Ir: MyClass.contextReceiverField0 + // Mangled name computed from Descriptor: MyClass{}contextReceiverField0#jf + private /* final field */ val contextReceiverField0: Unit + // CHECK: + // Mangled name computed from Ir: MyClass.contextReceiverField1 + // Mangled name computed from Descriptor: MyClass{}contextReceiverField1#jf + 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 ec0355d6e7f..9a45bdbc9eb 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/lazy.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/lazy.kt @@ -1,8 +1,12 @@ // FIR_IDENTICAL // !LANGUAGE: +ContextReceivers +// DUMP_LOCAL_DECLARATION_SIGNATURES // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57428, KT-57435 + interface Lazy context(Lazy, 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 new file mode 100644 index 00000000000..932172b2cc1 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/lazy.sig.kt.txt @@ -0,0 +1,64 @@ +// CHECK: +// Mangled name: Lazy +// Public signature: /Lazy|null[0] +interface Lazy { + +} + +// CHECK: +// Mangled name: #f(Lazy;Lazy;Lazy<0:0>;Lazy>){0§} +// Public signature: /f|-6064829949850642050[0] +fun f(lazy1: Lazy, lazy2: Lazy, lazyT: Lazy, lazyLazyT: Lazy>): Unit + // CHECK: + // Mangled name: #f(Lazy;Lazy;Lazy<1:0>;Lazy>){0§}##static@Lazy(){} + local fun Lazy.(): Unit + // CHECK: + // Mangled name: #f(Lazy;Lazy;Lazy<2:0>;Lazy>){0§}##static@Lazy(){}##static@Lazy(){} + local fun Lazy.(): Unit + + // CHECK: + // Mangled name: #f(Lazy;Lazy;Lazy<1:0>;Lazy>){0§}##static@Lazy(){} + local fun Lazy.(): Unit + // CHECK: + // Mangled name: #f(Lazy;Lazy;Lazy<2:0>;Lazy>){0§}##static@Lazy(){}##static@Lazy(){} + local fun Lazy.(): Unit + + // CHECK: + // Mangled name: #f(Lazy;Lazy;Lazy<1:0>;Lazy>){0§}##static@Lazy<1:0>(){} + local fun Lazy.(): Unit + // CHECK: + // Mangled name: #f(Lazy;Lazy;Lazy<2:0>;Lazy>){0§}##static@Lazy<2:0>(){}##static@Lazy(){} + local fun Lazy.(): Unit + + // CHECK: + // Mangled name: #f(Lazy;Lazy;Lazy<1:0>;Lazy>){0§}##static@Lazy>(){} + local fun Lazy>.(): Unit + // CHECK: + // Mangled name: #f(Lazy;Lazy;Lazy<2:0>;Lazy>){0§}##static@Lazy>(){}##static@Lazy(){} + local fun Lazy.(): Unit + + // CHECK: + // Mangled name: #f(Lazy;Lazy;Lazy<1:0>;Lazy>){0§}##static@Lazy(){} + local fun Lazy.(): Unit + // CHECK: + // Mangled name: #f(Lazy;Lazy;Lazy<2:0>;Lazy>){0§}##static@Lazy(){}##static@Lazy>(){} + local fun Lazy>.(): Unit + +// CHECK: +// Mangled name computed from Ir: #test1(Lazy;Lazy){} +// Mangled name computed from Descriptor: #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§} +// 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§} +// 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 109c7d8efd2..70f34274255 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/overloadPriority.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/overloadPriority.kt @@ -1,8 +1,12 @@ // FIR_IDENTICAL // !LANGUAGE: +ContextReceivers +// DUMP_LOCAL_DECLARATION_SIGNATURES // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57428, KT-57435 + class Context context(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 new file mode 100644 index 00000000000..324fc633a30 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/overloadPriority.sig.kt.txt @@ -0,0 +1,30 @@ +// CHECK: +// Mangled name: Context +// Public signature: /Context|null[0] +class Context { + // CHECK: + // Mangled name: Context#(){} + // Public signature: /Context.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name computed from Ir: #f(Context){}kotlin.String +// Mangled name computed from Descriptor: #f!Context(){}kotlin.String +// Public signature: /f|-5175802051654911360[0] +fun f($context_receiver_0: Context): String + +// CHECK JVM_IR: +// Mangled name: #f(){}kotlin.Any +// Public signature: /f|-2324325393552926316[0] +fun f(): Any + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + // CHECK JVM_IR: + // Mangled name: #test(){}##static@Context(){}kotlin.Int + local fun Context.(): Int + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/overloading.kt b/compiler/testData/ir/irText/declarations/contextReceivers/overloading.kt index b97b40593e0..4b39bd79235 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/overloading.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/overloading.kt @@ -1,8 +1,12 @@ // FIR_IDENTICAL // !LANGUAGE: +ContextReceivers +// DUMP_LOCAL_DECLARATION_SIGNATURES // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57428, KT-57435 + context(Int, String) fun foo(): Int { return this@Int + 42 diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/overloading.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/overloading.sig.kt.txt new file mode 100644 index 00000000000..e08332d5dab --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/overloading.sig.kt.txt @@ -0,0 +1,20 @@ +// CHECK JVM_IR: +// Mangled name computed from Ir: #foo(kotlin.Int){}kotlin.Int +// Mangled name computed from Descriptor: #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 +// Public signature: /foo|7076979931255393427[0] +fun foo($context_receiver_0: Int, $context_receiver_1: String): Int + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + // CHECK JVM_IR: + // Mangled name: #test(){}##static@kotlin.Int(){}kotlin.Int + local fun Int.(): Int + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.sig.kt.txt new file mode 100644 index 00000000000..cbc5890bf5c --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.sig.kt.txt @@ -0,0 +1,30 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C{}result + // Public signature: /C.result|456251868630197251[0] + val result: String + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.String + // Public signature: /C.result.|8441547134620975366[0] + get + + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +fun box(): String + +// CHECK JVM_IR: +// Mangled name: #contextual(kotlin.Function1){}kotlin.String +// Public signature: /contextual|-248785556334643583[0] +fun contextual(f: Function1): String + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.kt b/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.kt index 75585f99fee..d5a7dd0e21f 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.kt @@ -4,6 +4,9 @@ // 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 new file mode 100644 index 00000000000..978306f3dfc --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.sig.kt.txt @@ -0,0 +1,34 @@ +// CHECK: +// Mangled name: Matrix +// Public signature: /Matrix|null[0] +class Matrix { + // CHECK: + // Mangled name: Matrix#(){} + // Public signature: /Matrix.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: NumberOperations +// Public signature: /NumberOperations|null[0] +interface NumberOperations { + + // CHECK JVM_IR: + // Mangled name: NumberOperations#plus@kotlin.Number(kotlin.Number){}kotlin.Number + // Public signature: /NumberOperations.plus|-6518987633126930952[0] + abstract fun Number.plus(other: Number): Number + +} + +// CHECK JVM_IR: +// Mangled name computed from Ir: #plus@Matrix(NumberOperations;Matrix){}Matrix +// Mangled name computed from Descriptor: #plus!NumberOperations@Matrix(Matrix){}Matrix +// Public signature: /plus|1303343764214809933[0] +fun Matrix.plus($context_receiver_0: NumberOperations, other: Matrix): Matrix + +// CHECK: +// Mangled name: #plusMatrix@NumberOperations(Matrix;Matrix){} +// Public signature: /plusMatrix|-8194087590203252948[0] +fun NumberOperations.plusMatrix(m1: Matrix, m2: Matrix): Unit + diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/property.kt b/compiler/testData/ir/irText/declarations/contextReceivers/property.kt index 2318f9dd52c..ed8a895d12c 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/property.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/property.kt @@ -1,6 +1,9 @@ // FIR_IDENTICAL // !LANGUAGE: +ContextReceivers +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57435 + 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 new file mode 100644 index 00000000000..25ebe474253 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/property.sig.kt.txt @@ -0,0 +1,44 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +interface A { + + // CHECK JVM_IR: + // Mangled name: A#a(){}kotlin.Int + // Public signature: /A.a|5993980063692763883[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#a(){} + // Public signature: /A.a|-4432112437378250461[0] + abstract fun a(): Int + +} + +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +interface B { + + // CHECK JVM_IR: + // Mangled name: B#b(){}kotlin.Int + // Public signature: /B.b|-6472101675379091489[0] + // CHECK JS_IR NATIVE: + // Mangled name: B#b(){} + // Public signature: /B.b|4789657038926421504[0] + abstract fun b(): Int + +} + +// CHECK: +// Mangled name: {}c +// 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 + // Public signature: /c.|-2082007887378586898[0] + // CHECK JS_IR NATIVE: + // Mangled name computed from Ir: #(A;B){} + // Mangled name computed from Descriptor: #!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 66c34b2c372..32fb8ce5e67 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.kt @@ -3,6 +3,9 @@ // IGNORE_BACKEND_K1: JS_IR // IGNORE_BACKEND_K1: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429, KT-57435 + class A(val a: T) class B(val b: Any) class C(val c: 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 new file mode 100644 index 00000000000..b863a598207 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.sig.kt.txt @@ -0,0 +1,76 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A { + // CHECK: + // Mangled name: A{}a + // Public signature: /A.a|-1200697420457237799[0] + val a: T + // CHECK JVM_IR: + // Mangled name: A#(){}1:0 + // Public signature: /A.a.|5765441560292063424[0] + get + + // CHECK: + // Mangled name: A#(1:0){} + // Public signature: /A.|-8731461708390519279[0] + constructor(a: T) /* primary */ + +} + +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +class B { + // CHECK: + // Mangled name: B{}b + // Public signature: /B.b|772347207915745207[0] + val b: Any + // CHECK JVM_IR: + // Mangled name: B#(){}kotlin.Any + // Public signature: /B.b.|4768115582956424363[0] + get + + // CHECK: + // Mangled name: B#(kotlin.Any){} + // Public signature: /B.|4518179880532599055[0] + constructor(b: Any) /* primary */ + +} + +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C{}c + // Public signature: /C.c|-4416962153448040627[0] + val c: Any + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Any + // Public signature: /C.c.|-7073232512849879703[0] + get + + // CHECK: + // Mangled name: C#(kotlin.Any){} + // Public signature: /C.|4518179880532599055[0] + constructor(c: Any) /* primary */ + +} + +// CHECK: +// Mangled name computed from Ir: #f(A;A;B){} +// Mangled name computed from Descriptor: #f!A!A!B(){} +// Public signature: /f|-2471136927765483161[0] +fun f($context_receiver_0: A, $context_receiver_1: A, $context_receiver_2: B): Unit + +// CHECK: +// Mangled name: @C{}p +// 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 + // 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 b9a7d6086f8..a682a255524 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.kt @@ -1,8 +1,12 @@ // FIR_IDENTICAL // !LANGUAGE: +ContextReceivers +// DUMP_LOCAL_DECLARATION_SIGNATURES // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57428, KT-57435 + 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 new file mode 100644 index 00000000000..f083e27faef --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.sig.kt.txt @@ -0,0 +1,17 @@ +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + // CHECK: + // Mangled name: #test(){}##static@kotlin.Int(){} + local fun Int.(): Unit + // CHECK: + // Mangled name: #test(){}##static@kotlin.Int(){}##static(kotlin.Int){} + 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§} +// 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 99f1f239236..fd4e4ffbc11 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.kt @@ -1,6 +1,9 @@ // !LANGUAGE: +ContextReceivers // TARGET_BACKEND: JVM_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 new file mode 100644 index 00000000000..1ac667ab12b --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.sig.kt.txt @@ -0,0 +1,86 @@ +// CHECK: +// Mangled name: {}operationScore +// Public signature: /operationScore|-9073278321118823634[0] +var operationScore: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /operationScore.|7107010356269447258[0] + get + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /operationScore.|1936076120216071025[0] + set + +// CHECK: +// Mangled name: Result +// Public signature: /Result|null[0] +data class Result { + // CHECK: + // Mangled name: Result{}i + // Public signature: /Result.i|5014384761142332495[0] + val i: Int + // CHECK JVM_IR: + // Mangled name: Result#(){}kotlin.Int + // Public signature: /Result.i.|-8784396159001927527[0] + get + + // CHECK: + // Mangled name: Result#(kotlin.Int){} + // Public signature: /Result.|-5182794243525578284[0] + constructor(i: Int) /* primary */ + // CHECK JVM_IR: + // Mangled name: Result#component1(){}kotlin.Int + // Public signature: /Result.component1|-8217597213800111288[0] + operator fun component1(): Int + + // CHECK JVM_IR: + // Mangled name: Result#copy(kotlin.Int){}Result + // Public signature: /Result.copy|5439238034196076859[0] + fun copy(i: Int): Result + + // CHECK JVM_IR: + // Mangled name: Result#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Result.equals|722809408929142791[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Result#hashCode(){}kotlin.Int + // Public signature: /Result.hashCode|-8048879360829830756[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Result#toString(){}kotlin.String + // Public signature: /Result.toString|6958853723545266802[0] + override fun toString(): String + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +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 +// 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 +// 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 +// 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 +// Public signature: /unaryPlus|6329022242309077522[0] +operator fun Result.unaryPlus($context_receiver_0: Int): Result + diff --git a/compiler/testData/ir/irText/declarations/defaultArguments.kt b/compiler/testData/ir/irText/declarations/defaultArguments.kt index 0876934ebff..43b8943b925 100644 --- a/compiler/testData/ir/irText/declarations/defaultArguments.kt +++ b/compiler/testData/ir/irText/declarations/defaultArguments.kt @@ -1,4 +1,8 @@ // FIR_IDENTICAL +// DUMP_LOCAL_DECLARATION_SIGNATURES + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^KT-57434 fun test1(x: Int, y: Int = 0, z: String = "abc") { fun local(xx: Int = x, yy: Int = y, zz: String = z) {} diff --git a/compiler/testData/ir/irText/declarations/defaultArguments.sig.kt.txt b/compiler/testData/ir/irText/declarations/defaultArguments.sig.kt.txt new file mode 100644 index 00000000000..3a08641ea5c --- /dev/null +++ b/compiler/testData/ir/irText/declarations/defaultArguments.sig.kt.txt @@ -0,0 +1,8 @@ +// CHECK: +// Mangled name: #test1(kotlin.Int;kotlin.Int;kotlin.String){} +// Public signature: /test1|-2420205866450198550[0] +fun test1(x: Int, y: Int, z: String): Unit + // CHECK: + // Mangled name: #test1(kotlin.Int;kotlin.Int;kotlin.String){}#local#static(kotlin.Int;kotlin.Int;kotlin.String){} + local fun local(xx: Int, yy: Int, zz: String): Unit + diff --git a/compiler/testData/ir/irText/declarations/delegatedProperties.sig.kt.txt b/compiler/testData/ir/irText/declarations/delegatedProperties.sig.kt.txt new file mode 100644 index 00000000000..48e1ec4c8f7 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/delegatedProperties.sig.kt.txt @@ -0,0 +1,79 @@ +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: Int /* by */ + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test1.|3978508226793108919[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test1.|-5735092642142423279[0] + get(): Int + +// CHECK: +// Mangled name: {}test4 +// Public signature: /test4|-9115637610245762085[0] +var test4: Any /* by */ + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Any + // Public signature: /test4.|-6534367907772852251[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test4.|4166854324968284003[0] + get(): Any + // CHECK: + // Mangled name: #(kotlin.Any){} + // Public signature: /test4.|128813287573470091[0] + set(: Any): Unit + +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C{}map + // Public signature: /C.map|7076745113644856434[0] + val map: MutableMap + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.collections.MutableMap + // Public signature: /C.map.|-8717997113067483919[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.map.|4042543427940588392[0] + get + + // CHECK: + // Mangled name: C{}test2 + // Public signature: /C.test2|2517758057000911509[0] + val test2: Int /* by */ + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.test2.|-8779933517717592707[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.test2.|-5218942532816206869[0] + get(): Int + + // CHECK: + // Mangled name: C{}test3 + // Public signature: /C.test3|7677556066983021166[0] + var test3: Any /* by */ + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Any + // Public signature: /C.test3.|-7091348225606608458[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.test3.|-7333791615083236686[0] + get(): Any + // CHECK: + // Mangled name: C#(kotlin.Any){} + // Public signature: /C.test3.|1934506036485889165[0] + set(: Any): Unit + + // CHECK: + // Mangled name: C#(kotlin.collections.MutableMap){} + // Public signature: /C.|1811770173759787848[0] + constructor(map: MutableMap) /* primary */ + +} + diff --git a/compiler/testData/ir/irText/declarations/deprecatedProperty.kt b/compiler/testData/ir/irText/declarations/deprecatedProperty.kt index a4f8201569e..4d7f5d6f38c 100644 --- a/compiler/testData/ir/irText/declarations/deprecatedProperty.kt +++ b/compiler/testData/ir/irText/declarations/deprecatedProperty.kt @@ -1,5 +1,9 @@ // FIR_IDENTICAL +// MUTE_SIGNATURE_COMPARISON_K2: JS_IR +// MUTE_SIGNATURE_COMPARISON_K2: NATIVE +// ^ KT-57818 + @Deprecated("") val testVal = 1 @@ -42,4 +46,4 @@ val Any.testExtVal @Deprecated("") var Any.textExtVar get() = 1 - set(v) {} \ No newline at end of file + set(v) {} diff --git a/compiler/testData/ir/irText/declarations/deprecatedProperty.sig.kt.txt b/compiler/testData/ir/irText/declarations/deprecatedProperty.sig.kt.txt new file mode 100644 index 00000000000..9fdad8de2d3 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/deprecatedProperty.sig.kt.txt @@ -0,0 +1,160 @@ +// CHECK: +// Mangled name: {}testVal +// Public signature: /testVal|2839078120601828782[0] +val testVal: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /testVal.|-7988245952340984303[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testVal.|-3119877793352707332[0] + get + +// CHECK: +// Mangled name: {}testVar +// Public signature: /testVar|8413087277002944883[0] +var testVar: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /testVar.|9191290906921825044[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testVar.|-6235253478789807887[0] + get + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /testVar.|6808984626494163247[0] + set + +// CHECK: +// Mangled name: {}testValWithExplicitDefaultGet +// Public signature: /testValWithExplicitDefaultGet|-1362346025810080601[0] +val testValWithExplicitDefaultGet: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /testValWithExplicitDefaultGet.|2648103895002657715[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testValWithExplicitDefaultGet.|-8735908783303630657[0] + get + +// CHECK: +// Mangled name: {}testVarWithExplicitDefaultGet +// Public signature: /testVarWithExplicitDefaultGet|-8754279407647697140[0] +var testVarWithExplicitDefaultGet: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /testVarWithExplicitDefaultGet.|3955830634200256099[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testVarWithExplicitDefaultGet.|992058837805048370[0] + get + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /testVarWithExplicitDefaultGet.|4119788075131884604[0] + set + +// CHECK: +// Mangled name: {}testVarWithExplicitDefaultSet +// Public signature: /testVarWithExplicitDefaultSet|3134433727768464527[0] +var testVarWithExplicitDefaultSet: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /testVarWithExplicitDefaultSet.|-2052637508114761529[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testVarWithExplicitDefaultSet.|-2635424036897877324[0] + get + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /testVarWithExplicitDefaultSet.|3131385112898998488[0] + set + +// CHECK: +// Mangled name: {}testVarWithExplicitDefaultGetSet +// Public signature: /testVarWithExplicitDefaultGetSet|-1096239594080027300[0] +var testVarWithExplicitDefaultGetSet: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /testVarWithExplicitDefaultGetSet.|3584728981296673693[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testVarWithExplicitDefaultGetSet.|-2125629970699123398[0] + get + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /testVarWithExplicitDefaultGetSet.|-3337739576673384360[0] + set + +// CHECK: +// Mangled name: {}testLateinitVar +// Public signature: /testLateinitVar|1925235078562480345[0] +lateinit var testLateinitVar: Any + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Any + // Public signature: /testLateinitVar.|4393847554774081346[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testLateinitVar.|-4880838389462456231[0] + get + // CHECK: + // Mangled name: #(kotlin.Any){} + // Public signature: /testLateinitVar.|7446759265434254613[0] + set + +// CHECK: +// Mangled name: @kotlin.Any{}testExtVal +// Public signature: /testExtVal|-8237418459332608534[0] +val Any.testExtVal: Int + // CHECK JVM_IR: + // Mangled name: #@kotlin.Any(){}kotlin.Int + // Public signature: /testExtVal.|8770503610838008181[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@kotlin.Any(){} + // Public signature: /testExtVal.|1308965094478704656[0] + get(): Int + +// CHECK: +// Mangled name: {}testValWithExplicitGet +// Public signature: /testValWithExplicitGet|-2760968258434476382[0] +val testValWithExplicitGet: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /testValWithExplicitGet.|-5725471951034126732[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testValWithExplicitGet.|4659206126654299952[0] + get(): Int + +// CHECK: +// Mangled name: {}testVarWithExplicitGetSet +// Public signature: /testVarWithExplicitGetSet|1929510087894372653[0] +var testVarWithExplicitGetSet: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /testVarWithExplicitGetSet.|-9115970585418240898[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testVarWithExplicitGetSet.|5154869453605324201[0] + get(): Int + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /testVarWithExplicitGetSet.|-4962773332362494644[0] + set(v: Int): Unit + +// CHECK: +// Mangled name: @kotlin.Any{}textExtVar +// Public signature: /textExtVar|4539451128426188922[0] +var Any.textExtVar: Int + // CHECK JVM_IR: + // Mangled name: #@kotlin.Any(){}kotlin.Int + // Public signature: /textExtVar.|3926456668852509000[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@kotlin.Any(){} + // Public signature: /textExtVar.|-4403417818273803832[0] + get(): Int + // CHECK: + // Mangled name: #@kotlin.Any(kotlin.Int){} + // Public signature: /textExtVar.|8797278301660283872[0] + set(v: Int): Unit + diff --git a/compiler/testData/ir/irText/declarations/extensionProperties.kt b/compiler/testData/ir/irText/declarations/extensionProperties.kt index 3b9decc799c..565c9f02024 100644 --- a/compiler/testData/ir/irText/declarations/extensionProperties.kt +++ b/compiler/testData/ir/irText/declarations/extensionProperties.kt @@ -1,4 +1,9 @@ // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: JS_IR +// MUTE_SIGNATURE_COMPARISON_K2: NATIVE +// ^ KT-57818 + val String.test1 get() = 42 var String.test2 @@ -11,4 +16,4 @@ class Host { var String.test4 get() = 42 set(value) {} -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/declarations/extensionProperties.sig.kt.txt b/compiler/testData/ir/irText/declarations/extensionProperties.sig.kt.txt new file mode 100644 index 00000000000..4264979c520 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/extensionProperties.sig.kt.txt @@ -0,0 +1,67 @@ +// CHECK: +// Mangled name: Host +// Public signature: /Host|null[0] +class Host { + // CHECK: + // Mangled name: Host#(){} + // Public signature: /Host.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Host@kotlin.String{}test3 + // Public signature: /Host.test3|6611475030333167314[0] + val String.test3: Int + // CHECK JVM_IR: + // Mangled name: Host#@kotlin.String(){}kotlin.Int + // Public signature: /Host.test3.|-8733015989987681805[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#@kotlin.String(){} + // Public signature: /Host.test3.|8733981612854462725[0] + get(): Int + + // CHECK: + // Mangled name: Host@kotlin.String{}test4 + // Public signature: /Host.test4|7486468124994005123[0] + var String.test4: Int + // CHECK JVM_IR: + // Mangled name: Host#@kotlin.String(){}kotlin.Int + // Public signature: /Host.test4.|5807409276278007610[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#@kotlin.String(){} + // Public signature: /Host.test4.|-1587066497248455001[0] + get(): Int + // CHECK: + // Mangled name: Host#@kotlin.String(kotlin.Int){} + // Public signature: /Host.test4.|8811649911764795566[0] + set(value: Int): Unit + +} + +// CHECK: +// Mangled name: @kotlin.String{}test1 +// Public signature: /test1|-338155035617859525[0] +val String.test1: Int + // CHECK JVM_IR: + // Mangled name: #@kotlin.String(){}kotlin.Int + // Public signature: /test1.|-5900273555540008657[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@kotlin.String(){} + // Public signature: /test1.|-5601238586673262455[0] + get(): Int + +// CHECK: +// Mangled name: @kotlin.String{}test2 +// Public signature: /test2|298349501950551030[0] +var String.test2: Int + // CHECK JVM_IR: + // Mangled name: #@kotlin.String(){}kotlin.Int + // Public signature: /test2.|3412895218642147211[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@kotlin.String(){} + // Public signature: /test2.|1426339134726014217[0] + get(): Int + // CHECK: + // Mangled name: #@kotlin.String(kotlin.Int){} + // Public signature: /test2.|3674864148848971521[0] + set(value: Int): Unit + diff --git a/compiler/testData/ir/irText/declarations/fakeOverrides.sig.kt.txt b/compiler/testData/ir/irText/declarations/fakeOverrides.sig.kt.txt new file mode 100644 index 00000000000..1ed28954fb3 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/fakeOverrides.sig.kt.txt @@ -0,0 +1,75 @@ +// CHECK: +// Mangled name: CFoo +// Public signature: /CFoo|null[0] +abstract class CFoo { + // CHECK: + // Mangled name: CFoo#(){} + // Public signature: /CFoo.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: CFoo#foo(1:0){} + // Public signature: /CFoo.foo|-701456291278879981[0] + fun foo(x: T): Unit + +} + +// CHECK: +// Mangled name: Test1 +// Public signature: /Test1|null[0] +class Test1 : CFoo, IBar, IFooStr { + // CHECK: + // Mangled name: Test1{}bar + // Public signature: /Test1.bar|-7864284097863469857[0] + override val bar: Int + // CHECK JVM_IR: + // Mangled name: Test1#(){}kotlin.Int + // Public signature: /Test1.bar.|-7403724005139201014[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.bar.|6880642144337645699[0] + override get + + // CHECK: + // Mangled name: Test1#(){} + // Public signature: /Test1.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Test1#foo(kotlin.String){} + // Public signature: /Test1.foo|1351044947738582195[0] + /* fake */ override fun foo(x: String): Unit + +} + +// CHECK: +// Mangled name: IBar +// Public signature: /IBar|null[0] +interface IBar { + + // CHECK: + // Mangled name: IBar{}bar + // Public signature: /IBar.bar|-7864284097863469857[0] + abstract val bar: Int + // CHECK JVM_IR: + // Mangled name: IBar#(){}kotlin.Int + // Public signature: /IBar.bar.|-7403724005139201014[0] + // CHECK JS_IR NATIVE: + // Mangled name: IBar#(){} + // Public signature: /IBar.bar.|6880642144337645699[0] + abstract get + +} + +// CHECK: +// Mangled name: IFooStr +// Public signature: /IFooStr|null[0] +interface IFooStr { + + // CHECK: + // Mangled name: IFooStr#foo(kotlin.String){} + // Public signature: /IFooStr.foo|1351044947738582195[0] + abstract fun foo(x: String): Unit + +} + diff --git a/compiler/testData/ir/irText/declarations/fileWithAnnotations.sig.kt.txt b/compiler/testData/ir/irText/declarations/fileWithAnnotations.sig.kt.txt new file mode 100644 index 00000000000..33c5c85bcd8 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/fileWithAnnotations.sig.kt.txt @@ -0,0 +1,16 @@ +@file:JvmName(name = "FileWithAnnotations") + +// CHECK: +// Mangled name: {}bar +// Public signature: /bar|-7864284097863469857[0] +val bar: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /bar.|-7403724005139201014[0] + get + +// CHECK: +// Mangled name: #foo(){} +// Public signature: /foo|-1041209573719867811[0] +fun foo(): Unit + diff --git a/compiler/testData/ir/irText/declarations/fileWithTypeAliasesOnly.sig.kt.txt b/compiler/testData/ir/irText/declarations/fileWithTypeAliasesOnly.sig.kt.txt new file mode 100644 index 00000000000..b34bb9e9e13 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/fileWithTypeAliasesOnly.sig.kt.txt @@ -0,0 +1,4 @@ +// CHECK: +// Mangled name: Bar +// Public signature: /Bar|null[0] +typealias Bar = Function1 diff --git a/compiler/testData/ir/irText/declarations/genericDelegatedProperty.kt b/compiler/testData/ir/irText/declarations/genericDelegatedProperty.kt index e90261c217c..81f54eca400 100644 --- a/compiler/testData/ir/irText/declarations/genericDelegatedProperty.kt +++ b/compiler/testData/ir/irText/declarations/genericDelegatedProperty.kt @@ -1,3 +1,6 @@ +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57436 + class C object Delegate { @@ -5,4 +8,4 @@ object Delegate { operator fun setValue(thisRef: Any?, kProp: Any? , newValue: Int) {} } -var C.genericDelegatedProperty by Delegate \ No newline at end of file +var C.genericDelegatedProperty by Delegate diff --git a/compiler/testData/ir/irText/declarations/genericDelegatedProperty.sig.kt.txt b/compiler/testData/ir/irText/declarations/genericDelegatedProperty.sig.kt.txt new file mode 100644 index 00000000000..024a2807be3 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/genericDelegatedProperty.sig.kt.txt @@ -0,0 +1,51 @@ +// CHECK: +// Mangled name: @C<0:0>{0§}genericDelegatedProperty +// Public signature: /genericDelegatedProperty|7487675580233236234[0] +var C.genericDelegatedProperty: Int /* by */ + // CHECK JVM_IR: + // Mangled name: #@C<0:0>(){0§}kotlin.Int + // Public signature: /genericDelegatedProperty.|6889694694135857174[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@C<0:0>(){0§} + // Public signature: /genericDelegatedProperty.|5217762966964391406[0] + get(): Int + // CHECK: + // Mangled name: #@C<0:0>(kotlin.Int){0§} + // Public signature: /genericDelegatedProperty.|3753144775079530725[0] + set(: Int): Unit + +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: Delegate +// Public signature: /Delegate|null[0] +object Delegate { + // CHECK: + // Mangled name: Delegate#(){} + // Public signature: /Delegate.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Delegate#getValue(kotlin.Any?;kotlin.Any?){}kotlin.Int + // Public signature: /Delegate.getValue|-3377375928534350672[0] + // CHECK JS_IR NATIVE: + // Mangled name: Delegate#getValue(kotlin.Any?;kotlin.Any?){} + // Public signature: /Delegate.getValue|-9077843357189755365[0] + operator fun getValue(thisRef: Any?, kProp: Any?): Int + + // CHECK: + // Mangled name: Delegate#setValue(kotlin.Any?;kotlin.Any?;kotlin.Int){} + // Public signature: /Delegate.setValue|6795912344196649599[0] + operator fun setValue(thisRef: Any?, kProp: Any?, newValue: Int): Unit + +} + diff --git a/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.sig.kt.txt b/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.sig.kt.txt new file mode 100644 index 00000000000..df413524cb6 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.sig.kt.txt @@ -0,0 +1,181 @@ +// CHECK: +// Mangled name: IT +// Public signature: /IT|null[0] +value class IT { + // CHECK: + // Mangled name: IT{}x + // Public signature: /IT.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: IT#(){}kotlin.Int + // Public signature: /IT.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: IT#(){} + // Public signature: /IT.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: IT#(kotlin.Int){} + // Public signature: /IT.|-5182794243525578284[0] + constructor(x: Int) /* primary */ + // CHECK JVM_IR: + // Mangled name: IT#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /IT.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: IT#equals(kotlin.Any?){} + // Public signature: /IT.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: IT#hashCode(){}kotlin.Int + // Public signature: /IT.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: IT#hashCode(){} + // Public signature: /IT.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: IT#toString(){}kotlin.String + // Public signature: /IT.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: IT#toString(){} + // Public signature: /IT.toString|-1522858123163872138[0] + override fun toString(): String + +} + +// CHECK: +// Mangled name: InlineMutableSet +// Public signature: /InlineMutableSet|null[0] +value class InlineMutableSet : MutableSet { + // CHECK: + // Mangled name: InlineMutableSet{}ms + // Public signature: /InlineMutableSet.ms|3456531059400385118[0] + private val ms: MutableSet + // CHECK JVM_IR: + // Mangled name: InlineMutableSet#(){}kotlin.collections.MutableSet + // Public signature: /InlineMutableSet.ms.|1704733968327666901[0] + // CHECK JS_IR NATIVE: + // Mangled name: InlineMutableSet#(){} + // Public signature: /InlineMutableSet.ms.|4267115966333581446[0] + private get + + // CHECK: + // Mangled name: InlineMutableSet#(kotlin.collections.MutableSet){} + // Public signature: /InlineMutableSet.|-3183535736515224569[0] + constructor(ms: MutableSet) /* primary */ + // CHECK JVM_IR: + // Mangled name: InlineMutableSet#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /InlineMutableSet.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: InlineMutableSet#equals(kotlin.Any?){} + // Public signature: /InlineMutableSet.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: InlineMutableSet#hashCode(){}kotlin.Int + // Public signature: /InlineMutableSet.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: InlineMutableSet#hashCode(){} + // Public signature: /InlineMutableSet.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: InlineMutableSet#toString(){}kotlin.String + // Public signature: /InlineMutableSet.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: InlineMutableSet#toString(){} + // Public signature: /InlineMutableSet.toString|-1522858123163872138[0] + override fun toString(): String + + // CHECK JVM_IR: + // Mangled name: InlineMutableSet#add(IT){}kotlin.Boolean + // Public signature: /InlineMutableSet.add|4556529580522000316[0] + // CHECK JS_IR NATIVE: + // Mangled name: InlineMutableSet#add(IT){} + // Public signature: /InlineMutableSet.add|4002399033337307378[0] + override fun add(element: IT): Boolean + + // CHECK JVM_IR: + // Mangled name: InlineMutableSet#addAll(kotlin.collections.Collection){}kotlin.Boolean + // Public signature: /InlineMutableSet.addAll|-5427487393658674793[0] + // CHECK JS_IR NATIVE: + // Mangled name: InlineMutableSet#addAll(kotlin.collections.Collection){} + // Public signature: /InlineMutableSet.addAll|9104210835668956209[0] + override fun addAll(elements: Collection): Boolean + + // CHECK: + // Mangled name: InlineMutableSet#clear(){} + // Public signature: /InlineMutableSet.clear|-6446868449915108923[0] + override fun clear(): Unit + + // CHECK JVM_IR: + // Mangled name: InlineMutableSet#contains(IT){}kotlin.Boolean + // Public signature: /InlineMutableSet.contains|5433205509426188652[0] + // CHECK JS_IR NATIVE: + // Mangled name: InlineMutableSet#contains(IT){} + // Public signature: /InlineMutableSet.contains|1523972532095183124[0] + override operator fun contains(element: IT): Boolean + + // CHECK JVM_IR: + // Mangled name: InlineMutableSet#containsAll(kotlin.collections.Collection){}kotlin.Boolean + // Public signature: /InlineMutableSet.containsAll|-7975270216380936973[0] + // CHECK JS_IR NATIVE: + // Mangled name: InlineMutableSet#containsAll(kotlin.collections.Collection){} + // Public signature: /InlineMutableSet.containsAll|9031609470323530811[0] + override fun containsAll(elements: Collection): Boolean + + // CHECK JVM_IR: + // Mangled name: InlineMutableSet#isEmpty(){}kotlin.Boolean + // Public signature: /InlineMutableSet.isEmpty|-626562167393617703[0] + // CHECK JS_IR NATIVE: + // Mangled name: InlineMutableSet#isEmpty(){} + // Public signature: /InlineMutableSet.isEmpty|-412363028532554867[0] + override fun isEmpty(): Boolean + + // CHECK JVM_IR: + // Mangled name: InlineMutableSet#iterator(){}kotlin.collections.MutableIterator + // Public signature: /InlineMutableSet.iterator|-4073191386552833309[0] + // CHECK JS_IR NATIVE: + // Mangled name: InlineMutableSet#iterator(){} + // Public signature: /InlineMutableSet.iterator|8062689420742628886[0] + override operator fun iterator(): MutableIterator + + // CHECK JVM_IR: + // Mangled name: InlineMutableSet#remove(IT){}kotlin.Boolean + // Public signature: /InlineMutableSet.remove|-5569885229390352812[0] + // CHECK JS_IR NATIVE: + // Mangled name: InlineMutableSet#remove(IT){} + // Public signature: /InlineMutableSet.remove|-8774249090991155730[0] + override fun remove(element: IT): Boolean + + // CHECK JVM_IR: + // Mangled name: InlineMutableSet#removeAll(kotlin.collections.Collection){}kotlin.Boolean + // Public signature: /InlineMutableSet.removeAll|-3088468608435360013[0] + // CHECK JS_IR NATIVE: + // Mangled name: InlineMutableSet#removeAll(kotlin.collections.Collection){} + // Public signature: /InlineMutableSet.removeAll|6600936413226809258[0] + override fun removeAll(elements: Collection): Boolean + + // CHECK JVM_IR: + // Mangled name: InlineMutableSet#retainAll(kotlin.collections.Collection){}kotlin.Boolean + // Public signature: /InlineMutableSet.retainAll|-9017555672250825665[0] + // CHECK JS_IR NATIVE: + // Mangled name: InlineMutableSet#retainAll(kotlin.collections.Collection){} + // Public signature: /InlineMutableSet.retainAll|5389728810992799385[0] + override fun retainAll(elements: Collection): Boolean + + // CHECK: + // Mangled name: InlineMutableSet{}size + // Public signature: /InlineMutableSet.size|-6253659984320132064[0] + override val size: Int + // CHECK JVM_IR: + // Mangled name: InlineMutableSet#(){}kotlin.Int + // Public signature: /InlineMutableSet.size.|-3941649985161900780[0] + // CHECK JS_IR NATIVE: + // Mangled name: InlineMutableSet#(){} + // Public signature: /InlineMutableSet.size.|-8255337774232345969[0] + override get(): Int + +} + diff --git a/compiler/testData/ir/irText/declarations/interfaceProperties.sig.kt.txt b/compiler/testData/ir/irText/declarations/interfaceProperties.sig.kt.txt new file mode 100644 index 00000000000..f3a96121097 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/interfaceProperties.sig.kt.txt @@ -0,0 +1,63 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +interface C { + + // CHECK: + // Mangled name: C{}test1 + // Public signature: /C.test1|6005685442305498193[0] + abstract val test1: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.test1.|3978508226793108919[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.test1.|-5735092642142423279[0] + abstract get + + // CHECK: + // Mangled name: C{}test2 + // Public signature: /C.test2|2517758057000911509[0] + val test2: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.test2.|-8779933517717592707[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.test2.|-5218942532816206869[0] + get(): Int + + // CHECK: + // Mangled name: C{}test3 + // Public signature: /C.test3|7677556066983021166[0] + abstract var test3: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.test3.|6145294165644146033[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.test3.|-7333791615083236686[0] + abstract get + // CHECK: + // Mangled name: C#(kotlin.Int){} + // Public signature: /C.test3.|-4170290427940674844[0] + abstract set + + // CHECK: + // Mangled name: C{}test4 + // Public signature: /C.test4|-9115637610245762085[0] + var test4: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.test4.|-8911174941514444072[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.test4.|4166854324968284003[0] + get(): Int + // CHECK: + // Mangled name: C#(kotlin.Int){} + // Public signature: /C.test4.|8105340104867729538[0] + set(value: Int): Unit + +} + diff --git a/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.sig.kt.txt b/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.sig.kt.txt new file mode 100644 index 00000000000..4aa0b5aa936 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.sig.kt.txt @@ -0,0 +1,50 @@ +// CHECK: +// Mangled name: MyRec +// Public signature: /MyRec|null[0] +@JvmRecord +data class MyRec : Record { + // CHECK: + // Mangled name: MyRec{}name + // Public signature: /MyRec.name|4231860309499509769[0] + val name: String + // CHECK JVM_IR: + // Mangled name: MyRec#(){}kotlin.String + // Public signature: /MyRec.name.|-8006111524522882650[0] + get + + // CHECK: + // Mangled name: MyRec#(kotlin.String){} + // Public signature: /MyRec.|1280618353163213788[0] + constructor(name: String) /* primary */ + // CHECK JVM_IR: + // Mangled name: MyRec#component1(){}kotlin.String + // Public signature: /MyRec.component1|-7481405593404337796[0] + operator fun component1(): String + + // CHECK JVM_IR: + // Mangled name: MyRec#copy(kotlin.String){}MyRec + // Public signature: /MyRec.copy|4211487615034027288[0] + fun copy(name: String): MyRec + + // CHECK JVM_IR: + // Mangled name: MyRec#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /MyRec.equals|722809408929142791[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: MyRec#hashCode(){}kotlin.Int + // Public signature: /MyRec.hashCode|-8048879360829830756[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: MyRec#toString(){}kotlin.String + // Public signature: /MyRec.toString|6958853723545266802[0] + override fun toString(): String + +} + +// CHECK: +// Mangled name: #test(MyRec){} +// Public signature: /test|3445256146312347200[0] +fun test(rec: MyRec): Unit + diff --git a/compiler/testData/ir/irText/declarations/jvmRecord/javaRecordComponentAccess.sig.kt.txt b/compiler/testData/ir/irText/declarations/jvmRecord/javaRecordComponentAccess.sig.kt.txt new file mode 100644 index 00000000000..12e9a988442 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/jvmRecord/javaRecordComponentAccess.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #test_1(MyRec){} +// Public signature: /test_1|3006741164408257003[0] +fun test_1(rec: MyRec): Unit + +// CHECK: +// Mangled name: #test_2(MyRec){} +// Public signature: /test_2|1426784909469346506[0] +fun test_2(rec: MyRec): Unit + diff --git a/compiler/testData/ir/irText/declarations/kt27005.sig.kt.txt b/compiler/testData/ir/irText/declarations/kt27005.sig.kt.txt new file mode 100644 index 00000000000..001cc3421d9 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/kt27005.sig.kt.txt @@ -0,0 +1,21 @@ +// CHECK JVM_IR: +// Mangled name: #bar(){}kotlin.Any +// Public signature: /bar|-7451665824130722710[0] +// CHECK JS_IR NATIVE: +// Mangled name: #bar(){} +// Public signature: /bar|496682602797471549[0] +suspend fun bar(): Any + +// CHECK JVM_IR: +// Mangled name: #baz(){0§}0:0 +// Public signature: /baz|-6572927612231176329[0] +// CHECK JS_IR NATIVE: +// Mangled name: #baz(){0§} +// Public signature: /baz|-202208744392008648[0] +suspend fun baz(): T + +// CHECK: +// Mangled name: #foo(){} +// Public signature: /foo|-1041209573719867811[0] +suspend fun foo(): Unit + diff --git a/compiler/testData/ir/irText/declarations/kt29833.sig.kt.txt b/compiler/testData/ir/irText/declarations/kt29833.sig.kt.txt new file mode 100644 index 00000000000..7516a58296a --- /dev/null +++ b/compiler/testData/ir/irText/declarations/kt29833.sig.kt.txt @@ -0,0 +1,31 @@ +package interop + +// CHECK: +// Mangled name: interop.Definitions +// Public signature: interop/Definitions|null[0] +object Definitions { + // CHECK: + // Mangled name: interop.Definitions{}ktValue + // Public signature: interop/Definitions.ktValue|-7932704459611172354[0] + val ktValue: String + // CHECK JVM_IR: + // Mangled name: interop.Definitions#(){}kotlin.String + // Public signature: interop/Definitions.ktValue.|233367925131846588[0] + get + + // CHECK: + // Mangled name: interop.Definitions#(){} + // Public signature: interop/Definitions.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK: + // Mangled name: interop.Definitions{}KT_CONSTANT + // Public signature: interop/Definitions.KT_CONSTANT|-8714407162660026641[0] + const val KT_CONSTANT: String + // CHECK JVM_IR: + // Mangled name: interop.Definitions#(){}kotlin.String + // Public signature: interop/Definitions.KT_CONSTANT.|4728854297559730352[0] + get + +} + diff --git a/compiler/testData/ir/irText/declarations/kt35550.kt b/compiler/testData/ir/irText/declarations/kt35550.kt index 06937b70091..adb3ff17938 100644 --- a/compiler/testData/ir/irText/declarations/kt35550.kt +++ b/compiler/testData/ir/irText/declarations/kt35550.kt @@ -1,3 +1,6 @@ +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57754, KT-57436 + interface I { val T.id: T get() = this diff --git a/compiler/testData/ir/irText/declarations/kt35550.sig.kt.txt b/compiler/testData/ir/irText/declarations/kt35550.sig.kt.txt new file mode 100644 index 00000000000..d516a20573b --- /dev/null +++ b/compiler/testData/ir/irText/declarations/kt35550.sig.kt.txt @@ -0,0 +1,46 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A : I { + // CHECK: + // Mangled name: A#(I){} + // Public signature: /A.|605687824747116295[0] + constructor(i: I) /* primary */ + // CHECK: + // Mangled name: A.$$delegate_0 + // Public signature: /A.$$delegate_0|-7286425919675154353[0] + private /* final field */ val $$delegate_0: I + + // CHECK: + // Mangled name: A@0:0{0§}id + // Public signature: /A.id|6409895071901545951[0] + override val T.id: T + // CHECK JVM_IR: + // Mangled name: A#@0:0(){0§}0:0 + // Public signature: /A.id.|4983271234253098452[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#@0:0(){0§} + // Public signature: /A.id.|-1537502770664138716[0] + override get(): T + +} + +// CHECK: +// Mangled name: I +// Public signature: /I|null[0] +interface I { + + // CHECK: + // Mangled name: I@0:0{0§}id + // Public signature: /I.id|6409895071901545951[0] + val T.id: T + // CHECK JVM_IR: + // Mangled name: I#@0:0(){0§}0:0 + // Public signature: /I.id.|4983271234253098452[0] + // CHECK JS_IR NATIVE: + // Mangled name: I#@0:0(){0§} + // Public signature: /I.id.|-1537502770664138716[0] + get(): T + +} + diff --git a/compiler/testData/ir/irText/declarations/kt45308.kt b/compiler/testData/ir/irText/declarations/kt45308.kt index 55509470ccc..3d7f4d3ae8e 100644 --- a/compiler/testData/ir/irText/declarations/kt45308.kt +++ b/compiler/testData/ir/irText/declarations/kt45308.kt @@ -2,6 +2,9 @@ // IGNORE_BACKEND_K1: JS_IR // IGNORE_BACKEND_K1: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57433 + // MODULE: a // FILE: a.kt package a diff --git a/compiler/testData/ir/irText/declarations/kt45308.sig.kt.txt b/compiler/testData/ir/irText/declarations/kt45308.sig.kt.txt new file mode 100644 index 00000000000..625515bf05b --- /dev/null +++ b/compiler/testData/ir/irText/declarations/kt45308.sig.kt.txt @@ -0,0 +1,25 @@ +// MODULE: a +// FILE: a.kt +package a + +// CHECK: +// Mangled name: a.A +// Public signature: a/A|null[0] +typealias A = String +// MODULE: b +// FILE: b.kt +package b + +// CHECK JVM_IR: +// Mangled name: b#foo(kotlin.Function0){}kotlin.String +// Public signature: b/foo|-5020381652845254261[0] +fun foo(f: Function0): String + +// MODULE: c +// FILE: c.kt + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +fun box(): String + diff --git a/compiler/testData/ir/irText/declarations/kt47527.sig.kt.txt b/compiler/testData/ir/irText/declarations/kt47527.sig.kt.txt new file mode 100644 index 00000000000..e1c3f9c3a59 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/kt47527.sig.kt.txt @@ -0,0 +1,24 @@ +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +// CHECK JS_IR NATIVE: +// Mangled name: #box(){} +// Public signature: /box|2173511048851971368[0] +fun box(): String + +// CHECK JVM_IR: +// Mangled name: #test_1(kotlin.Any?){}kotlin.String? +// Public signature: /test_1|8306101080862525041[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test_1(kotlin.Any?){} +// Public signature: /test_1|6244764910155513609[0] +fun test_1(value: Any?): String? + +// CHECK JVM_IR: +// Mangled name: #test_2(kotlin.Any?){}kotlin.String? +// Public signature: /test_2|4804906371697221872[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test_2(kotlin.Any?){} +// Public signature: /test_2|-2820233899677445404[0] +fun test_2(value: Any?): String? + diff --git a/compiler/testData/ir/irText/declarations/kt52677.sig.kt.txt b/compiler/testData/ir/irText/declarations/kt52677.sig.kt.txt new file mode 100644 index 00000000000..447459b8a2d --- /dev/null +++ b/compiler/testData/ir/irText/declarations/kt52677.sig.kt.txt @@ -0,0 +1,135 @@ +// CHECK: +// Mangled name: MySerializable +// Public signature: /MySerializable|null[0] +@Target(allowedTargets = [AnnotationTarget.TYPE]) +open annotation class MySerializable : Annotation { + // CHECK: + // Mangled name: MySerializable{}c + // Public signature: /MySerializable.c|-4416962153448040627[0] + val c: KClass<*> + // CHECK JVM_IR: + // Mangled name: MySerializable#(){}kotlin.reflect.KClass<*> + // Public signature: /MySerializable.c.|-6941111973387927723[0] + // CHECK JS_IR NATIVE: + // Mangled name: MySerializable#(){} + // Public signature: /MySerializable.c.|2368736057102379596[0] + get + + // CHECK: + // Mangled name: MySerializable#(kotlin.reflect.KClass<*>){} + // Public signature: /MySerializable.|5783844857148764471[0] + constructor(c: KClass<*>) /* primary */ + +} + +// CHECK: +// Mangled name: LoginSuccessPacket +// Public signature: /LoginSuccessPacket|null[0] +data class LoginSuccessPacket { + // CHECK: + // Mangled name: LoginSuccessPacket{}id + // Public signature: /LoginSuccessPacket.id|4553357683448926321[0] + val id: @MySerializable(c = UuidSerializer::class) Uuid1 + // CHECK JVM_IR: + // Mangled name: LoginSuccessPacket#(){}Uuid1 + // Public signature: /LoginSuccessPacket.id.|1939250508314525801[0] + // CHECK JS_IR NATIVE: + // Mangled name: LoginSuccessPacket#(){} + // Public signature: /LoginSuccessPacket.id.|2571929917854535737[0] + get + + // CHECK: + // Mangled name: LoginSuccessPacket#(Uuid1){} + // Public signature: /LoginSuccessPacket.|-1666114669831529718[0] + constructor(id: @MySerializable(c = UuidSerializer::class) Uuid1) /* primary */ + // CHECK JVM_IR: + // Mangled name: LoginSuccessPacket#component1(){}Uuid1 + // Public signature: /LoginSuccessPacket.component1|-3428488995872773450[0] + // CHECK JS_IR NATIVE: + // Mangled name: LoginSuccessPacket#component1(){} + // Public signature: /LoginSuccessPacket.component1|162597135895221648[0] + operator fun component1(): @MySerializable(c = UuidSerializer::class) Uuid1 + + // CHECK JVM_IR: + // Mangled name: LoginSuccessPacket#copy(Uuid1){}LoginSuccessPacket + // Public signature: /LoginSuccessPacket.copy|-7819973036324215638[0] + // CHECK JS_IR NATIVE: + // Mangled name: LoginSuccessPacket#copy(Uuid1){} + // Public signature: /LoginSuccessPacket.copy|9160330822770885462[0] + fun copy(id: @MySerializable(c = UuidSerializer::class) Uuid1): LoginSuccessPacket + + // CHECK JVM_IR: + // Mangled name: LoginSuccessPacket#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /LoginSuccessPacket.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: LoginSuccessPacket#equals(kotlin.Any?){} + // Public signature: /LoginSuccessPacket.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: LoginSuccessPacket#hashCode(){}kotlin.Int + // Public signature: /LoginSuccessPacket.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: LoginSuccessPacket#hashCode(){} + // Public signature: /LoginSuccessPacket.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: LoginSuccessPacket#toString(){}kotlin.String + // Public signature: /LoginSuccessPacket.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: LoginSuccessPacket#toString(){} + // Public signature: /LoginSuccessPacket.toString|-1522858123163872138[0] + override fun toString(): String + +} + +// CHECK: +// Mangled name: Uuid1 +// Public signature: /Uuid1|null[0] +class Uuid1 { + // CHECK: + // Mangled name: Uuid1#(){} + // Public signature: /Uuid1.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: MySerializer +// Public signature: /MySerializer|null[0] +interface MySerializer { + +} + +// CHECK: +// Mangled name: UuidSerializer +// Public signature: /UuidSerializer|null[0] +object UuidSerializer : MySerializer<@MySerializable(c = UuidSerializer::class) Uuid1> { + // CHECK: + // Mangled name: UuidSerializer#(){} + // Public signature: /UuidSerializer.|-5645683436151566731[0] + private constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #bar(){}Uuid1 +// Public signature: /bar|-6949225675121992296[0] +// CHECK JS_IR NATIVE: +// Mangled name: #bar(){} +// Public signature: /bar|496682602797471549[0] +fun bar(): @MySerializable(c = UuidSerializer::class) Uuid1 + +// CHECK JVM_IR: +// Mangled name: #foo(){}Uuid1 +// Public signature: /foo|-4975789094402571215[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo(){} +// Public signature: /foo|-1041209573719867811[0] +fun foo(): @MySerializable(c = UuidSerializer::class) Uuid1 + +// CHECK: +// Mangled name: Uuid +// Public signature: /Uuid|null[0] +typealias Uuid = @MySerializable(c = UuidSerializer::class) Uuid1 diff --git a/compiler/testData/ir/irText/declarations/localClassWithOverrides.kt b/compiler/testData/ir/irText/declarations/localClassWithOverrides.kt index f345db53e4c..eaaa542ba59 100644 --- a/compiler/testData/ir/irText/declarations/localClassWithOverrides.kt +++ b/compiler/testData/ir/irText/declarations/localClassWithOverrides.kt @@ -1,4 +1,9 @@ // FIR_IDENTICAL +// DUMP_LOCAL_DECLARATION_SIGNATURES + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57430 + fun outer() { abstract class ALocal { abstract fun afun() @@ -11,4 +16,4 @@ fun outer() { override val aval = 1 override var avar = 2 } -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/declarations/localClassWithOverrides.sig.kt.txt b/compiler/testData/ir/irText/declarations/localClassWithOverrides.sig.kt.txt new file mode 100644 index 00000000000..9fbb483816d --- /dev/null +++ b/compiler/testData/ir/irText/declarations/localClassWithOverrides.sig.kt.txt @@ -0,0 +1,74 @@ +// CHECK: +// Mangled name: #outer(){} +// Public signature: /outer|1607449560170809066[0] +fun outer(): Unit + // CHECK: + // Mangled name: #outer(){}.ALocal + local abstract class ALocal { + // CHECK: + // Mangled name: #outer(){}.ALocal#(){} + constructor() /* primary */ + + // CHECK: + // Mangled name: #outer(){}.ALocal#afun(){} + abstract fun afun(): Unit + + // CHECK: + // Mangled name: #outer(){}.ALocal{}aval + abstract val aval: Int + // CHECK JVM_IR: + // Mangled name: #outer(){}.ALocal#(){}kotlin.Int + // CHECK JS_IR NATIVE: + // Mangled name: #outer(){}.ALocal#(){} + abstract get + + // CHECK: + // Mangled name: #outer(){}.ALocal{}avar + abstract var avar: Int + // CHECK JVM_IR: + // Mangled name: #outer(){}.ALocal#(){}kotlin.Int + // CHECK JS_IR NATIVE: + // Mangled name: #outer(){}.ALocal#(){} + abstract get + // CHECK: + // Mangled name: #outer(){}.ALocal#(kotlin.Int){} + abstract set + + } + + // CHECK: + // Mangled name: #outer(){}.Local + local class Local : ALocal { + // CHECK: + // Mangled name: #outer(){}.Local{}aval + override val aval: Int + field + // CHECK JVM_IR: + // Mangled name: #outer(){}.Local#(){}kotlin.Int + // CHECK JS_IR NATIVE: + // Mangled name: #outer(){}.Local#(){} + override get + + // CHECK: + // Mangled name: #outer(){}.Local{}avar + override var avar: Int + field + // CHECK JVM_IR: + // Mangled name: #outer(){}.Local#(){}kotlin.Int + // CHECK JS_IR NATIVE: + // Mangled name: #outer(){}.Local#(){} + override get + // CHECK: + // Mangled name: #outer(){}.Local#(kotlin.Int){} + override set + + // CHECK: + // Mangled name: #outer(){}.Local#(){} + constructor() /* primary */ + + // CHECK: + // Mangled name: #outer(){}.Local#afun(){} + override fun afun(): Unit + + } + diff --git a/compiler/testData/ir/irText/declarations/localDelegatedProperties.sig.kt.txt b/compiler/testData/ir/irText/declarations/localDelegatedProperties.sig.kt.txt new file mode 100644 index 00000000000..91656c44f44 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/localDelegatedProperties.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +fun test1(): Unit + +// CHECK: +// Mangled name: #test2(){} +// Public signature: /test2|4279114864133353152[0] +fun test2(): Unit + diff --git a/compiler/testData/ir/irText/declarations/localVarInDoWhile.sig.kt.txt b/compiler/testData/ir/irText/declarations/localVarInDoWhile.sig.kt.txt new file mode 100644 index 00000000000..5deb343fa79 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/localVarInDoWhile.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #foo(){} +// Public signature: /foo|-1041209573719867811[0] +fun foo(): Unit + diff --git a/compiler/testData/ir/irText/declarations/multiplatform/expectClassInherited.sig.kt.txt b/compiler/testData/ir/irText/declarations/multiplatform/expectClassInherited.sig.kt.txt new file mode 100644 index 00000000000..b146d19965a --- /dev/null +++ b/compiler/testData/ir/irText/declarations/multiplatform/expectClassInherited.sig.kt.txt @@ -0,0 +1,74 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[1] +expect abstract class A { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[1] + protected expect constructor() /* primary */ + + // CHECK: + // Mangled name: A#foo(){} + // Public signature: /A.foo|-1041209573719867811[1] + expect abstract fun foo(): Unit + +} + +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +abstract class A { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + protected constructor() /* primary */ + + // CHECK: + // Mangled name: A#foo(){} + // Public signature: /A.foo|-1041209573719867811[0] + abstract fun foo(): Unit + +} + +// CHECK: +// Mangled name: B +// Public signature: /B|null[1] +expect open class B : A { + // CHECK: + // Mangled name: B#(kotlin.Int){} + // Public signature: /B.|-5182794243525578284[1] + expect constructor(i: Int) /* primary */ + + // CHECK: + // Mangled name: B#bar(kotlin.String){} + // Public signature: /B.bar|5132770888056479978[1] + expect open fun bar(s: String): Unit + + // CHECK: + // Mangled name: B#foo(){} + // Public signature: /B.foo|-1041209573719867811[1] + expect override fun foo(): Unit + +} + +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +open class B : A { + // CHECK: + // Mangled name: B#(kotlin.Int){} + // Public signature: /B.|-5182794243525578284[0] + constructor(i: Int) /* primary */ + + // CHECK: + // Mangled name: B#bar(kotlin.String){} + // Public signature: /B.bar|5132770888056479978[0] + open fun bar(s: String): Unit + + // CHECK: + // Mangled name: B#foo(){} + // Public signature: /B.foo|-1041209573719867811[0] + override fun foo(): Unit + +} + diff --git a/compiler/testData/ir/irText/declarations/multiplatform/expectIntersectionOverride.sig.kt.txt b/compiler/testData/ir/irText/declarations/multiplatform/expectIntersectionOverride.sig.kt.txt new file mode 100644 index 00000000000..868610e3afc --- /dev/null +++ b/compiler/testData/ir/irText/declarations/multiplatform/expectIntersectionOverride.sig.kt.txt @@ -0,0 +1,121 @@ +// MODULE: +// FILE: common.kt + +// CHECK: +// Mangled name: C +// Public signature: /C|null[1] +expect class C : I1, I2 { + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[1] + expect constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: C#f(){}kotlin.String + // Public signature: /C.f|9098388873611041001[1] + // CHECK JS_IR NATIVE: + // Mangled name: C#f(){} + // Public signature: /C.f|5316533450599009716[1] + expect abstract /* fake */ override fun f(): String + + // CHECK: + // Mangled name: C{}p + // Public signature: /C.p|6715504260787941082[1] + expect abstract /* fake */ override val p: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.p.|5329635969197638839[1] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.p.|-1162552463316289847[1] + abstract /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: I1 +// Public signature: /I1|null[0] +interface I1 { + + // CHECK JVM_IR: + // Mangled name: I1#f(){}kotlin.String + // Public signature: /I1.f|9098388873611041001[0] + // CHECK JS_IR NATIVE: + // Mangled name: I1#f(){} + // Public signature: /I1.f|5316533450599009716[0] + abstract fun f(): String + + // CHECK: + // Mangled name: I1{}p + // Public signature: /I1.p|6715504260787941082[0] + abstract val p: Int + // CHECK JVM_IR: + // Mangled name: I1#(){}kotlin.Int + // Public signature: /I1.p.|5329635969197638839[0] + // CHECK JS_IR NATIVE: + // Mangled name: I1#(){} + // Public signature: /I1.p.|-1162552463316289847[0] + abstract get + +} + +// CHECK: +// Mangled name: I2 +// Public signature: /I2|null[0] +interface I2 { + + // CHECK JVM_IR: + // Mangled name: I2#f(){}kotlin.String + // Public signature: /I2.f|9098388873611041001[0] + // CHECK JS_IR NATIVE: + // Mangled name: I2#f(){} + // Public signature: /I2.f|5316533450599009716[0] + abstract fun f(): String + + // CHECK: + // Mangled name: I2{}p + // Public signature: /I2.p|6715504260787941082[0] + abstract val p: Int + // CHECK JVM_IR: + // Mangled name: I2#(){}kotlin.Int + // Public signature: /I2.p.|5329635969197638839[0] + // CHECK JS_IR NATIVE: + // Mangled name: I2#(){} + // Public signature: /I2.p.|-1162552463316289847[0] + abstract get + +} + +// MODULE: platform +// FILE: platform.kt + +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C : I1, I2 { + // CHECK: + // Mangled name: C{}p + // Public signature: /C.p|6715504260787941082[0] + override val p: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.p.|5329635969197638839[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.p.|-1162552463316289847[0] + override get + + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: C#f(){}kotlin.String + // Public signature: /C.f|9098388873611041001[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#f(){} + // Public signature: /C.f|5316533450599009716[0] + override fun f(): String + +} diff --git a/compiler/testData/ir/irText/declarations/multiplatform/expectMemberInNotExpectClass.sig.kt.txt b/compiler/testData/ir/irText/declarations/multiplatform/expectMemberInNotExpectClass.sig.kt.txt new file mode 100644 index 00000000000..ee9f7240ea1 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/multiplatform/expectMemberInNotExpectClass.sig.kt.txt @@ -0,0 +1,92 @@ +// CHECK: +// Mangled name: C1 +// Public signature: /C1|null[1] +expect open class C1 { + // CHECK: + // Mangled name: C1{}p + // Public signature: /C1.p|6715504260787941082[1] + expect val p: Int + // CHECK JVM_IR: + // Mangled name: C1#(){}kotlin.Int + // Public signature: /C1.p.|5329635969197638839[1] + // CHECK JS_IR NATIVE: + // Mangled name: C1#(){} + // Public signature: /C1.p.|-1162552463316289847[1] + get + + // CHECK: + // Mangled name: C1#(){} + // Public signature: /C1.|-5645683436151566731[1] + expect constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: C1#f(){}kotlin.String + // Public signature: /C1.f|9098388873611041001[1] + // CHECK JS_IR NATIVE: + // Mangled name: C1#f(){} + // Public signature: /C1.f|5316533450599009716[1] + expect fun f(): String + +} + +// CHECK: +// Mangled name: C1 +// Public signature: /C1|null[0] +open class C1 { + // CHECK: + // Mangled name: C1{}p + // Public signature: /C1.p|6715504260787941082[0] + val p: Int + // CHECK JVM_IR: + // Mangled name: C1#(){}kotlin.Int + // Public signature: /C1.p.|5329635969197638839[0] + // CHECK JS_IR NATIVE: + // Mangled name: C1#(){} + // Public signature: /C1.p.|-1162552463316289847[0] + get + + // CHECK: + // Mangled name: C1#(){} + // Public signature: /C1.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: C1#f(){}kotlin.String + // Public signature: /C1.f|9098388873611041001[0] + // CHECK JS_IR NATIVE: + // Mangled name: C1#f(){} + // Public signature: /C1.f|5316533450599009716[0] + fun f(): String + +} + +// CHECK: +// Mangled name: C2 +// Public signature: /C2|null[0] +class C2 : C1 { + // CHECK: + // Mangled name: C2#(){} + // Public signature: /C2.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: C2#f(){}kotlin.String + // Public signature: /C2.f|9098388873611041001[0] + // CHECK JS_IR NATIVE: + // Mangled name: C2#f(){} + // Public signature: /C2.f|5316533450599009716[0] + /* fake */ override fun f(): String + + // CHECK: + // Mangled name: C2{}p + // Public signature: /C2.p|6715504260787941082[0] + /* fake */ override val p: Int + // CHECK JVM_IR: + // Mangled name: C2#(){}kotlin.Int + // Public signature: /C2.p.|5329635969197638839[0] + // CHECK JS_IR NATIVE: + // Mangled name: C2#(){} + // Public signature: /C2.p.|-1162552463316289847[0] + /* fake */ override get(): Int + +} diff --git a/compiler/testData/ir/irText/declarations/multiplatform/expectMemberInNotExpectClassFir.sig.kt.txt b/compiler/testData/ir/irText/declarations/multiplatform/expectMemberInNotExpectClassFir.sig.kt.txt new file mode 100644 index 00000000000..5cb5dfc58e3 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/multiplatform/expectMemberInNotExpectClassFir.sig.kt.txt @@ -0,0 +1,98 @@ +// MODULE: +// FILE: common.kt + +// CHECK: +// Mangled name: C1 +// Public signature: /C1|null[1] +expect open class C1 { + // CHECK: + // Mangled name: C1{}p + // Public signature: /C1.p|6715504260787941082[1] + expect val p: Int + // CHECK JVM_IR: + // Mangled name: C1#(){}kotlin.Int + // Public signature: /C1.p.|5329635969197638839[1] + // CHECK JS_IR NATIVE: + // Mangled name: C1#(){} + // Public signature: /C1.p.|-1162552463316289847[1] + get + + // CHECK: + // Mangled name: C1#(){} + // Public signature: /C1.|-5645683436151566731[1] + expect constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: C1#f(){}kotlin.String + // Public signature: /C1.f|9098388873611041001[1] + // CHECK JS_IR NATIVE: + // Mangled name: C1#f(){} + // Public signature: /C1.f|5316533450599009716[1] + expect fun f(): String + +} + +// CHECK: +// Mangled name: C2 +// Public signature: /C2|null[0] +class C2 : C1 { + // CHECK: + // Mangled name: C2#(){} + // Public signature: /C2.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: C2#f(){}kotlin.String + // Public signature: /C2.f|9098388873611041001[1] + // CHECK JS_IR NATIVE: + // Mangled name: C2#f(){} + // Public signature: /C2.f|5316533450599009716[1] + expect /* fake */ override fun f(): String + + // CHECK: + // Mangled name: C2{}p + // Public signature: /C2.p|6715504260787941082[1] + expect /* fake */ override val p: Int + // CHECK JVM_IR: + // Mangled name: C2#(){}kotlin.Int + // Public signature: /C2.p.|5329635969197638839[1] + // CHECK JS_IR NATIVE: + // Mangled name: C2#(){} + // Public signature: /C2.p.|-1162552463316289847[1] + /* fake */ override get(): Int + +} + +// MODULE: platform +// FILE: platform.kt + +// CHECK: +// Mangled name: C1 +// Public signature: /C1|null[0] +open class C1 { + // CHECK: + // Mangled name: C1{}p + // Public signature: /C1.p|6715504260787941082[0] + val p: Int + // CHECK JVM_IR: + // Mangled name: C1#(){}kotlin.Int + // Public signature: /C1.p.|5329635969197638839[0] + // CHECK JS_IR NATIVE: + // Mangled name: C1#(){} + // Public signature: /C1.p.|-1162552463316289847[0] + get + + // CHECK: + // Mangled name: C1#(){} + // Public signature: /C1.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: C1#f(){}kotlin.String + // Public signature: /C1.f|9098388873611041001[0] + // CHECK JS_IR NATIVE: + // Mangled name: C1#f(){} + // Public signature: /C1.f|5316533450599009716[0] + fun f(): String + +} diff --git a/compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass.sig.kt.txt b/compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass.sig.kt.txt new file mode 100644 index 00000000000..8b08f7ce808 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass.sig.kt.txt @@ -0,0 +1,222 @@ +// CHECK: +// Mangled name: MyEnum +// Public signature: /MyEnum|null[1] +expect enum class MyEnum : Enum { + // 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 JVM_IR: + // Mangled name: MyEnum#valueOf#static(kotlin.String){}MyEnum + // Public signature: /MyEnum.valueOf|4316550590519800984[1] + // CHECK JS_IR NATIVE: + // Mangled name: MyEnum#valueOf#static(kotlin.String){} + // Public signature: /MyEnum.valueOf|-4683474617854611729[1] + fun valueOf(value: String): MyEnum + + // CHECK JVM_IR: + // Mangled name: MyEnum#values#static(){}kotlin.Array + // Public signature: /MyEnum.values|3097625172661156808[1] + // CHECK JS_IR NATIVE: + // Mangled name: MyEnum#values#static(){} + // Public signature: /MyEnum.values|-8715569000920726747[1] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: MyEnum#clone(){}kotlin.Any + // Public signature: /MyEnum.clone|-6903128697527593263[1] + // CHECK JS_IR NATIVE: + // Mangled name: MyEnum#compareTo(MyEnum){} + // Public signature: /MyEnum.compareTo|-1404018836780573573[1] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: MyEnum#compareTo(MyEnum){}kotlin.Int + // Public signature: /MyEnum.compareTo|2015858924903177055[1] + // CHECK JS_IR NATIVE: + // Mangled name: MyEnum#equals(kotlin.Any?){} + // Public signature: /MyEnum.equals|4638265728071529943[1] + /* 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] + // CHECK JS_IR NATIVE: + // Mangled name: MyEnum#hashCode(){} + // Public signature: /MyEnum.hashCode|3409210261493131192[1] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: MyEnum#hashCode(){}kotlin.Int + // Public signature: /MyEnum.hashCode|-8048879360829830756[1] + // CHECK JS_IR NATIVE: + // Mangled name: MyEnum#toString(){} + // Public signature: /MyEnum.toString|-1522858123163872138[1] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: MyEnum#toString(){}kotlin.String + // Public signature: /MyEnum.toString|6958853723545266802[1] + // CHECK JS_IR NATIVE: + // Mangled name: MyEnum#static{}entries + // Public signature: /MyEnum.entries|-5134227801081826149[1] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: MyEnum#static{}entries + // Public signature: /MyEnum.entries|-5134227801081826149[1] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: MyEnum##static(){}kotlin.enums.EnumEntries + // Public signature: /MyEnum.entries.|-3922959509726908718[1] + // CHECK JS_IR NATIVE: + // Mangled name: MyEnum{}name + // Public signature: /MyEnum.name|4231860309499509769[1] + get(): EnumEntries + + // CHECK: + // Mangled name: MyEnum{}name + // Public signature: /MyEnum.name|4231860309499509769[1] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: MyEnum#(){}kotlin.String + // Public signature: /MyEnum.name.|-8006111524522882650[1] + // CHECK JS_IR NATIVE: + // Mangled name: MyEnum{}ordinal + // Public signature: /MyEnum.ordinal|1912745122988592376[1] + /* fake */ override get(): String + + // CHECK: + // Mangled name: MyEnum{}ordinal + // Public signature: /MyEnum.ordinal|1912745122988592376[1] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: MyEnum#(){}kotlin.Int + // Public signature: /MyEnum.ordinal.|-6902664390061762634[1] + // CHECK JS_IR NATIVE: + // Mangled name: MyEnum + // Public signature: /MyEnum|null[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: MyEnum +// Public signature: /MyEnum|null[0] +enum class MyEnum : Enum { + // CHECK: + // Mangled name: MyEnum#(){} + // Public signature: /MyEnum.|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK: + // Mangled name: MyEnum.BAR + // Public signature: /MyEnum.BAR|null[0] + BAR + + // CHECK: + // Mangled name: MyEnum.BAZ + // Public signature: /MyEnum.BAZ|null[0] + BAZ + + // CHECK: + // Mangled name: MyEnum.FOO + // Public signature: /MyEnum.FOO|null[0] + FOO + + // CHECK JVM_IR: + // Mangled name: MyEnum#valueOf#static(kotlin.String){}MyEnum + // Public signature: /MyEnum.valueOf|4316550590519800984[0] + // CHECK JS_IR NATIVE: + // Mangled name: MyEnum#values#static(){} + // Public signature: /MyEnum.values|-8715569000920726747[0] + fun valueOf(value: String): MyEnum + + // CHECK JVM_IR: + // Mangled name: MyEnum#values#static(){}kotlin.Array + // Public signature: /MyEnum.values|3097625172661156808[0] + // CHECK JS_IR NATIVE: + // Mangled name: MyEnum#compareTo(MyEnum){} + // Public signature: /MyEnum.compareTo|-1404018836780573573[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: MyEnum#clone(){}kotlin.Any + // Public signature: /MyEnum.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: MyEnum#equals(kotlin.Any?){} + // Public signature: /MyEnum.equals|4638265728071529943[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: MyEnum#compareTo(MyEnum){}kotlin.Int + // Public signature: /MyEnum.compareTo|2015858924903177055[0] + // CHECK JS_IR NATIVE: + // Mangled name: MyEnum#hashCode(){} + // Public signature: /MyEnum.hashCode|3409210261493131192[0] + /* fake */ override operator fun compareTo(other: MyEnum): Int + + // CHECK JVM_IR: + // Mangled name: MyEnum#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /MyEnum.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: MyEnum#toString(){} + // Public signature: /MyEnum.toString|-1522858123163872138[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: MyEnum#hashCode(){}kotlin.Int + // Public signature: /MyEnum.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: MyEnum#static{}entries + // Public signature: /MyEnum.entries|-5134227801081826149[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: MyEnum#toString(){}kotlin.String + // Public signature: /MyEnum.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: MyEnum##static(){} + // Public signature: /MyEnum.entries.|-6068527377476727729[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: MyEnum#static{}entries + // Public signature: /MyEnum.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: MyEnum##static(){}kotlin.enums.EnumEntries + // Public signature: /MyEnum.entries.|-3922959509726908718[0] + // CHECK JS_IR NATIVE: + // Mangled name: MyEnum#(){} + // Public signature: /MyEnum.name.|5879344792307730109[0] + get(): EnumEntries + + // CHECK: + // Mangled name: MyEnum{}name + // Public signature: /MyEnum.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: MyEnum#(){}kotlin.String + // Public signature: /MyEnum.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: MyEnum#(){} + // Public signature: /MyEnum.ordinal.|8409904226035914023[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: MyEnum{}ordinal + // Public signature: /MyEnum.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: MyEnum#(){}kotlin.Int + // Public signature: /MyEnum.ordinal.|-6902664390061762634[0] + /* fake */ override get(): Int + +} + diff --git a/compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass2.kt b/compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass2.kt index 79f04dddd05..1374c2602be 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass2.kt +++ b/compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass2.kt @@ -4,6 +4,9 @@ // 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 new file mode 100644 index 00000000000..27dcbf57671 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass2.sig.kt.txt @@ -0,0 +1,88 @@ +// FILE: main.kt + +// CHECK: +// Mangled name: MyEnum +// Public signature: /MyEnum|null[0] +enum class MyEnum : Enum { + // CHECK: + // Mangled name: MyEnum#(){} + // Public signature: /MyEnum.|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK: + // Mangled name: MyEnum.BAR + // Public signature: /MyEnum.BAR|null[0] + BAR + + // CHECK: + // Mangled name: MyEnum.BAZ + // Public signature: /MyEnum.BAZ|null[0] + BAZ + + // CHECK: + // Mangled name: MyEnum.FOO + // Public signature: /MyEnum.FOO|null[0] + FOO + + // CHECK JVM_IR: + // Mangled name: MyEnum#valueOf#static(kotlin.String){}MyEnum + // Public signature: /MyEnum.valueOf|4316550590519800984[0] + fun valueOf(value: String): MyEnum + + // CHECK JVM_IR: + // Mangled name: MyEnum#values#static(){}kotlin.Array + // Public signature: /MyEnum.values|3097625172661156808[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: MyEnum#clone(){}kotlin.Any + // Public signature: /MyEnum.clone|-6903128697527593263[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: MyEnum#compareTo(MyEnum){}kotlin.Int + // Public signature: /MyEnum.compareTo|2015858924903177055[0] + /* fake */ override operator fun compareTo(other: MyEnum): Int + + // CHECK JVM_IR: + // Mangled name: MyEnum#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /MyEnum.equals|722809408929142791[0] + /* fake */ override fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: MyEnum#hashCode(){}kotlin.Int + // Public signature: /MyEnum.hashCode|-8048879360829830756[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: MyEnum#toString(){}kotlin.String + // Public signature: /MyEnum.toString|6958853723545266802[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: MyEnum#static{}entries + // Public signature: /MyEnum.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: MyEnum##static(){}kotlin.enums.EnumEntries + // Public signature: /MyEnum.entries.|-3922959509726908718[0] + get(): EnumEntries + + // CHECK: + // Mangled name: MyEnum{}name + // Public signature: /MyEnum.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: MyEnum#(){}kotlin.String + // Public signature: /MyEnum.name.|-8006111524522882650[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: MyEnum{}ordinal + // Public signature: /MyEnum.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: MyEnum#(){}kotlin.Int + // Public signature: /MyEnum.ordinal.|-6902664390061762634[0] + /* fake */ override get(): Int + +} diff --git a/compiler/testData/ir/irText/declarations/multiplatform/expectedSealedClass.sig.kt.txt b/compiler/testData/ir/irText/declarations/multiplatform/expectedSealedClass.sig.kt.txt new file mode 100644 index 00000000000..b1f26ac5905 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/multiplatform/expectedSealedClass.sig.kt.txt @@ -0,0 +1,44 @@ +// CHECK: +// Mangled name: Add +// Public signature: /Add|null[1] +expect class Add : Ops { + // CHECK: + // Mangled name: Add#(){} + // Public signature: /Add.|-5645683436151566731[1] + expect constructor() /* primary */ + +} + +// CHECK: +// Mangled name: Add +// Public signature: /Add|null[0] +class Add : Ops { + // CHECK: + // Mangled name: Add#(){} + // Public signature: /Add.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: Ops +// Public signature: /Ops|null[1] +expect sealed class Ops { + // CHECK: + // Mangled name: Ops#(){} + // Public signature: /Ops.|-5645683436151566731[1] + protected expect constructor() /* primary */ + +} + +// CHECK: +// Mangled name: Ops +// Public signature: /Ops|null[0] +sealed class Ops { + // CHECK: + // Mangled name: Ops#(){} + // Public signature: /Ops.|-5645683436151566731[0] + protected constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/declarations/packageLevelProperties.sig.kt.txt b/compiler/testData/ir/irText/declarations/packageLevelProperties.sig.kt.txt new file mode 100644 index 00000000000..299bf64d54a --- /dev/null +++ b/compiler/testData/ir/irText/declarations/packageLevelProperties.sig.kt.txt @@ -0,0 +1,112 @@ +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test1.|3978508226793108919[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test1.|-5735092642142423279[0] + get + +// CHECK: +// Mangled name: {}test3 +// Public signature: /test3|7677556066983021166[0] +var test3: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test3.|6145294165644146033[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test3.|-7333791615083236686[0] + get + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /test3.|-4170290427940674844[0] + set + +// CHECK: +// Mangled name: {}test4 +// Public signature: /test4|-9115637610245762085[0] +var test4: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test4.|-8911174941514444072[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test4.|4166854324968284003[0] + get + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /test4.|8105340104867729538[0] + set(value: Int): Unit + +// CHECK: +// Mangled name: {}test5 +// Public signature: /test5|4734809624271551895[0] +var test5: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test5.|-639929328226188476[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test5.|-839819880171293643[0] + get + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /test5.|-8941794992615749462[0] + private set + +// CHECK: +// Mangled name: {}test6 +// Public signature: /test6|-2606527149405855403[0] +val test6: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test6.|-7378740493776144578[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test6.|2028965735388282488[0] + get + +// CHECK: +// Mangled name: {}test7 +// Public signature: /test7|1362036650170262859[0] +val test7: Int /* by */ + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test7.|-7305979124924885797[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test7.|-4463638325142628163[0] + get(): Int + +// CHECK: +// Mangled name: {}test8 +// Public signature: /test8|5640428216506241852[0] +var test8: Int /* by */ + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test8.|-4986202166917088055[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test8.|-4670710835380513070[0] + get(): Int + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /test8.|-6993542117905462862[0] + set(: Int): Unit + +// CHECK: +// Mangled name: {}test2 +// Public signature: /test2|2517758057000911509[0] +val test2: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test2.|-8779933517717592707[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test2.|-5218942532816206869[0] + get(): Int + diff --git a/compiler/testData/ir/irText/declarations/parameters/class.sig.kt.txt b/compiler/testData/ir/irText/declarations/parameters/class.sig.kt.txt new file mode 100644 index 00000000000..3e0463e880b --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/class.sig.kt.txt @@ -0,0 +1,46 @@ +// CHECK: +// Mangled name: Test +// Public signature: /Test|null[0] +class Test { + // CHECK: + // Mangled name: Test.TestInner + // Public signature: /Test.TestInner|null[0] + inner class TestInner { + // CHECK: + // Mangled name: Test.TestInner#(){} + // Public signature: /Test.TestInner.|-5645683436151566731[0] + constructor() /* primary */ + + } + + // CHECK: + // Mangled name: Test.TestNested + // Public signature: /Test.TestNested|null[0] + class TestNested { + // CHECK: + // Mangled name: Test.TestNested#(){} + // Public signature: /Test.TestNested.|-5645683436151566731[0] + constructor() /* primary */ + + } + + // CHECK: + // Mangled name: Test#(){} + // Public signature: /Test.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: TestInterface +// Public signature: /TestInterface|null[0] +interface TestInterface { + // CHECK: + // Mangled name: TestInterface.TestNestedInterface + // Public signature: /TestInterface.TestNestedInterface|null[0] + interface TestNestedInterface { + + } + +} + diff --git a/compiler/testData/ir/irText/declarations/parameters/constructor.kt b/compiler/testData/ir/irText/declarations/parameters/constructor.kt index 3bcfcdfc132..d6c8922c239 100644 --- a/compiler/testData/ir/irText/declarations/parameters/constructor.kt +++ b/compiler/testData/ir/irText/declarations/parameters/constructor.kt @@ -1,3 +1,6 @@ +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR +// ^ KT-57429 + class Test1(val x: T1, val y: T2) class Test2(x: Int, val y: String) { @@ -10,4 +13,4 @@ class Test3(val x: Int, val y: String = "") class Test4(val x: Int) { constructor(x: Int, y: Int = 42) : this(x + y) -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/declarations/parameters/constructor.sig.kt.txt b/compiler/testData/ir/irText/declarations/parameters/constructor.sig.kt.txt new file mode 100644 index 00000000000..a3f69d2227f --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/constructor.sig.kt.txt @@ -0,0 +1,147 @@ +// CHECK: +// Mangled name: Test1 +// Public signature: /Test1|null[0] +class Test1 { + // CHECK: + // Mangled name: Test1{}x + // Public signature: /Test1.x|-8060530855978347579[0] + val x: T1 + // CHECK JVM_IR: + // Mangled name: Test1#(){}1:0 + // Public signature: /Test1.x.|-8893883356128097563[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Test1{}y + // Public signature: /Test1.y|3625903257357557171[0] + val y: T2 + // CHECK JVM_IR: + // Mangled name: Test1#(){}1:1 + // Public signature: /Test1.y.|6657541212363005233[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test1#(){} + // Public signature: /Test1.y.|-7902422373892128922[0] + get + + // CHECK: + // Mangled name: Test1#(1:0;1:1){} + // Public signature: /Test1.|3086114026882374588[0] + constructor(x: T1, y: T2) /* primary */ + +} + +// CHECK: +// Mangled name: Test2 +// Public signature: /Test2|null[0] +class Test2 { + // CHECK: + // Mangled name: Test2{}y + // Public signature: /Test2.y|3625903257357557171[0] + val y: String + // CHECK JVM_IR: + // Mangled name: Test2#(){}kotlin.String + // Public signature: /Test2.y.|1760775372995524147[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2#(){} + // Public signature: /Test2.y.|-7902422373892128922[0] + get + + // CHECK: + // Mangled name: Test2.TestInner + // Public signature: /Test2.TestInner|null[0] + inner class TestInner { + // CHECK: + // Mangled name: Test2.TestInner{}z + // Public signature: /Test2.TestInner.z|7549650372729116193[0] + val z: Z + // CHECK JVM_IR: + // Mangled name: Test2.TestInner#(){}1:0 + // Public signature: /Test2.TestInner.z.|6635558627205321915[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test2.TestInner#(){} + // Public signature: /Test2.TestInner.z.|4925813204745917177[0] + get + + // CHECK: + // Mangled name: Test2.TestInner#(1:0){} + // Public signature: /Test2.TestInner.|-8731461708390519279[0] + constructor(z: Z) /* primary */ + // CHECK: + // Mangled name: Test2.TestInner#(1:0;kotlin.Int){} + // Public signature: /Test2.TestInner.|7281397193015694517[0] + constructor(z: Z, i: Int) + + } + + // CHECK: + // Mangled name: Test2#(kotlin.Int;kotlin.String){} + // Public signature: /Test2.|-6994814679185246063[0] + constructor(x: Int, y: String) /* primary */ + +} + +// CHECK: +// Mangled name: Test3 +// Public signature: /Test3|null[0] +class Test3 { + // CHECK: + // Mangled name: Test3{}x + // Public signature: /Test3.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: Test3#(){}kotlin.Int + // Public signature: /Test3.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#(){} + // Public signature: /Test3.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Test3{}y + // Public signature: /Test3.y|3625903257357557171[0] + val y: String + // CHECK JVM_IR: + // Mangled name: Test3#(){}kotlin.String + // Public signature: /Test3.y.|1760775372995524147[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test3#(){} + // Public signature: /Test3.y.|-7902422373892128922[0] + get + + // CHECK: + // Mangled name: Test3#(kotlin.Int;kotlin.String){} + // Public signature: /Test3.|-6994814679185246063[0] + constructor(x: Int, y: String) /* primary */ + +} + +// CHECK: +// Mangled name: Test4 +// Public signature: /Test4|null[0] +class Test4 { + // CHECK: + // Mangled name: Test4{}x + // Public signature: /Test4.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: Test4#(){}kotlin.Int + // Public signature: /Test4.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test4#(){} + // Public signature: /Test4.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Test4#(kotlin.Int){} + // Public signature: /Test4.|-5182794243525578284[0] + constructor(x: Int) /* primary */ + // CHECK: + // Mangled name: Test4#(kotlin.Int;kotlin.Int){} + // Public signature: /Test4.|-7691762014320324121[0] + constructor(x: Int, y: Int) + +} + diff --git a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.kt b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.kt index 124a7506f2a..482d9c3c7f6 100644 --- a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.kt +++ b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.kt @@ -1,4 +1,7 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429 + data class Test(val x: T, val y: String = "") diff --git a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.sig.kt.txt b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.sig.kt.txt new file mode 100644 index 00000000000..d57cade1b4c --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.sig.kt.txt @@ -0,0 +1,82 @@ +// CHECK: +// Mangled name: Test +// Public signature: /Test|null[0] +data class Test { + // CHECK: + // Mangled name: Test{}x + // Public signature: /Test.x|-8060530855978347579[0] + val x: T + // CHECK JVM_IR: + // Mangled name: Test#(){}1:0 + // Public signature: /Test.x.|-8893883356128097563[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test#(){} + // Public signature: /Test.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Test{}y + // Public signature: /Test.y|3625903257357557171[0] + val y: String + // CHECK JVM_IR: + // Mangled name: Test#(){}kotlin.String + // Public signature: /Test.y.|1760775372995524147[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test#(){} + // Public signature: /Test.y.|-7902422373892128922[0] + get + + // CHECK: + // Mangled name: Test#(1:0;kotlin.String){} + // Public signature: /Test.|-7411275398527089511[0] + constructor(x: T, y: String) /* primary */ + // CHECK JVM_IR: + // Mangled name: Test#component1(){}1:0 + // Public signature: /Test.component1|2393470133763651536[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test#component1(){} + // Public signature: /Test.component1|162597135895221648[0] + operator fun component1(): T + + // CHECK JVM_IR: + // Mangled name: Test#component2(){}kotlin.String + // Public signature: /Test.component2|1228864375093914597[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test#component2(){} + // Public signature: /Test.component2|3796717572321500973[0] + operator fun component2(): String + + // CHECK JVM_IR: + // Mangled name: Test#copy(1:0;kotlin.String){}Test<1:0> + // Public signature: /Test.copy|8763634592557776800[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test#copy(1:0;kotlin.String){} + // Public signature: /Test.copy|-4651516421033771294[0] + fun copy(x: T, y: String): Test + + // CHECK JVM_IR: + // Mangled name: Test#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Test.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test#equals(kotlin.Any?){} + // Public signature: /Test.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Test#hashCode(){}kotlin.Int + // Public signature: /Test.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test#hashCode(){} + // Public signature: /Test.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Test#toString(){}kotlin.String + // Public signature: /Test.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test#toString(){} + // Public signature: /Test.toString|-1522858123163872138[0] + override fun toString(): String + +} + diff --git a/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.kt b/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.kt index 9da67f77f65..ad4bfb53722 100644 --- a/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.kt +++ b/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.kt @@ -1,4 +1,8 @@ // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429 + val test1 = 42 var test2 = 42 @@ -12,4 +16,4 @@ class Host { class InPrimaryCtor( val testInPrimaryCtor1: T, var testInPrimaryCtor2: Int = 42 -) \ No newline at end of file +) diff --git a/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.sig.kt.txt b/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.sig.kt.txt new file mode 100644 index 00000000000..e5264f3dc10 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.sig.kt.txt @@ -0,0 +1,106 @@ +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test1.|3978508226793108919[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test1.|-5735092642142423279[0] + get + +// CHECK: +// Mangled name: {}test2 +// Public signature: /test2|2517758057000911509[0] +var test2: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test2.|-8779933517717592707[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test2.|-5218942532816206869[0] + get + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /test2.|1925150309265265312[0] + set + +// CHECK: +// Mangled name: Host +// Public signature: /Host|null[0] +class Host { + // CHECK: + // Mangled name: Host{}testMember1 + // Public signature: /Host.testMember1|-6927948367741148766[0] + val testMember1: Int + // CHECK JVM_IR: + // Mangled name: Host#(){}kotlin.Int + // Public signature: /Host.testMember1.|-5459388376303709502[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#(){} + // Public signature: /Host.testMember1.|-4927757728199550360[0] + get + + // CHECK: + // Mangled name: Host{}testMember2 + // Public signature: /Host.testMember2|-8955784718453180422[0] + var testMember2: Int + // CHECK JVM_IR: + // Mangled name: Host#(){}kotlin.Int + // Public signature: /Host.testMember2.|6996843230957051336[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#(){} + // Public signature: /Host.testMember2.|7875832727540192624[0] + get + // CHECK: + // Mangled name: Host#(kotlin.Int){} + // Public signature: /Host.testMember2.|5166755654765741256[0] + set + + // CHECK: + // Mangled name: Host#(){} + // Public signature: /Host.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: InPrimaryCtor +// Public signature: /InPrimaryCtor|null[0] +class InPrimaryCtor { + // CHECK: + // Mangled name: InPrimaryCtor{}testInPrimaryCtor1 + // Public signature: /InPrimaryCtor.testInPrimaryCtor1|8162816596808715257[0] + val testInPrimaryCtor1: T + // CHECK JVM_IR: + // Mangled name: InPrimaryCtor#(){}1:0 + // Public signature: /InPrimaryCtor.testInPrimaryCtor1.|-3259454449312875389[0] + // CHECK JS_IR NATIVE: + // Mangled name: InPrimaryCtor#(){} + // Public signature: /InPrimaryCtor.testInPrimaryCtor1.|4519403801874358446[0] + get + + // CHECK: + // Mangled name: InPrimaryCtor{}testInPrimaryCtor2 + // Public signature: /InPrimaryCtor.testInPrimaryCtor2|6743375261432235408[0] + var testInPrimaryCtor2: Int + // CHECK JVM_IR: + // Mangled name: InPrimaryCtor#(){}kotlin.Int + // Public signature: /InPrimaryCtor.testInPrimaryCtor2.|-455870240469973752[0] + // CHECK JS_IR NATIVE: + // Mangled name: InPrimaryCtor#(){} + // Public signature: /InPrimaryCtor.testInPrimaryCtor2.|6677557829332876002[0] + get + // CHECK: + // Mangled name: InPrimaryCtor#(kotlin.Int){} + // Public signature: /InPrimaryCtor.testInPrimaryCtor2.|-2246089499454556022[0] + set + + // CHECK: + // Mangled name: InPrimaryCtor#(1:0;kotlin.Int){} + // Public signature: /InPrimaryCtor.|7281397193015694517[0] + constructor(testInPrimaryCtor1: T, testInPrimaryCtor2: Int) /* primary */ + +} + diff --git a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.kt b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.kt index bf93d9971ea..e07aeabe5a7 100644 --- a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.kt +++ b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.kt @@ -1,7 +1,10 @@ +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57754, KT-57429 + interface IBase { fun foo(x: Int) val bar: Int fun qux(t: T, x: X) } -class Test(impl: IBase) : IBase by impl \ No newline at end of file +class Test(impl: IBase) : IBase by impl diff --git a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.sig.kt.txt b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.sig.kt.txt new file mode 100644 index 00000000000..88de0ee31a7 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.sig.kt.txt @@ -0,0 +1,65 @@ +// CHECK: +// Mangled name: Test +// Public signature: /Test|null[0] +class Test : IBase { + // CHECK: + // Mangled name: Test#(IBase<1:0>){} + // Public signature: /Test.|-3017997426280513504[0] + constructor(impl: IBase) /* primary */ + // CHECK: + // Mangled name: Test.$$delegate_0 + // Public signature: /Test.$$delegate_0|-7286425919675154353[0] + private /* final field */ val $$delegate_0: IBase + // CHECK: + // Mangled name: Test#foo(kotlin.Int){} + // Public signature: /Test.foo|-104159190164110731[0] + override fun foo(x: Int): Unit + + // CHECK: + // Mangled name: Test#qux(1:0;0:0){0§} + // Public signature: /Test.qux|2089843959414439633[0] + override fun qux(t: TT, x: X): Unit + + // CHECK: + // Mangled name: Test{}bar + // Public signature: /Test.bar|-7864284097863469857[0] + override val bar: Int + // CHECK JVM_IR: + // Mangled name: Test#(){}kotlin.Int + // Public signature: /Test.bar.|-7403724005139201014[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test#(){} + // Public signature: /Test.bar.|6880642144337645699[0] + override get(): Int + +} + +// CHECK: +// Mangled name: IBase +// Public signature: /IBase|null[0] +interface IBase { + + // CHECK: + // Mangled name: IBase#foo(kotlin.Int){} + // Public signature: /IBase.foo|-104159190164110731[0] + abstract fun foo(x: Int): Unit + + // CHECK: + // Mangled name: IBase#qux(1:0;0:0){0§} + // Public signature: /IBase.qux|2089843959414439633[0] + abstract fun qux(t: T, x: X): Unit + + // CHECK: + // Mangled name: IBase{}bar + // Public signature: /IBase.bar|-7864284097863469857[0] + abstract val bar: Int + // CHECK JVM_IR: + // Mangled name: IBase#(){}kotlin.Int + // Public signature: /IBase.bar.|-7403724005139201014[0] + // CHECK JS_IR NATIVE: + // Mangled name: IBase#(){} + // Public signature: /IBase.bar.|6880642144337645699[0] + abstract get + +} + diff --git a/compiler/testData/ir/irText/declarations/parameters/fun.sig.kt.txt b/compiler/testData/ir/irText/declarations/parameters/fun.sig.kt.txt new file mode 100644 index 00000000000..931b21cabd9 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/fun.sig.kt.txt @@ -0,0 +1,41 @@ +// CHECK: +// Mangled name: Host +// Public signature: /Host|null[0] +class Host { + // CHECK: + // Mangled name: Host#(){} + // Public signature: /Host.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Host#testMembetExt1@kotlin.String(kotlin.Int;kotlin.String){} + // Public signature: /Host.testMembetExt1|8870420018904797729[0] + fun String.testMembetExt1(i: Int, j: String): Unit + + // CHECK: + // Mangled name: Host#testMembetExt2@kotlin.String(kotlin.Int;0:0){0§} + // Public signature: /Host.testMembetExt2|7335072512555735434[0] + fun String.testMembetExt2(i: Int, j: T): Unit + +} + +// CHECK: +// Mangled name: #test1(kotlin.Int;0:0){0§} +// Public signature: /test1|3909853005204725277[0] +fun test1(i: Int, j: T): Unit + +// CHECK: +// Mangled name: #test2(kotlin.Int;kotlin.String){} +// Public signature: /test2|7169768065709748599[0] +fun test2(i: Int, j: String): Unit + +// CHECK: +// Mangled name: #test3(kotlin.Array...){} +// Public signature: /test3|-5387729831293380819[0] +fun test3(vararg args: String): Unit + +// CHECK: +// Mangled name: #textExt1@kotlin.String(kotlin.Int;kotlin.String){} +// Public signature: /textExt1|-1442095296360892469[0] +fun String.textExt1(i: Int, j: String): Unit + diff --git a/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.kt b/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.kt index 2ba367df453..b5541f7726b 100644 --- a/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.kt +++ b/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.kt @@ -1,6 +1,10 @@ // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR +// ^ KT-57429 + class Outer { inner class Inner { fun foo(x1: T1, x2: T2) {} } -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.sig.kt.txt b/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.sig.kt.txt new file mode 100644 index 00000000000..e5a38b4e610 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.sig.kt.txt @@ -0,0 +1,27 @@ +// CHECK: +// Mangled name: Outer +// Public signature: /Outer|null[0] +class Outer { + // CHECK: + // Mangled name: Outer.Inner + // Public signature: /Outer.Inner|null[0] + inner class Inner { + // CHECK: + // Mangled name: Outer.Inner#(){} + // Public signature: /Outer.Inner.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Outer.Inner#foo(2:0;1:0){} + // Public signature: /Outer.Inner.foo|615406329799946108[0] + fun foo(x1: T1, x2: T2): Unit + + } + + // CHECK: + // Mangled name: Outer#(){} + // Public signature: /Outer.|-5645683436151566731[0] + constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/declarations/parameters/lambdas.kt b/compiler/testData/ir/irText/declarations/parameters/lambdas.kt index 28e24ef8626..956efa7d233 100644 --- a/compiler/testData/ir/irText/declarations/parameters/lambdas.kt +++ b/compiler/testData/ir/irText/declarations/parameters/lambdas.kt @@ -1,4 +1,8 @@ +// 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 -> } -val test4 = fun (i: Int, j: Int) {} \ No newline at end of file +val test4 = fun (i: Int, j: Int) {} diff --git a/compiler/testData/ir/irText/declarations/parameters/lambdas.sig.kt.txt b/compiler/testData/ir/irText/declarations/parameters/lambdas.sig.kt.txt new file mode 100644 index 00000000000..0ed06369486 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/lambdas.sig.kt.txt @@ -0,0 +1,48 @@ +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: Function1 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function1 + // Public signature: /test1.|2788097897117242625[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test1.|-5735092642142423279[0] + get + +// CHECK: +// Mangled name: {}test2 +// Public signature: /test2|2517758057000911509[0] +val test2: @ExtensionFunctionType Function2 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function2 + // Public signature: /test2.|-8953585576935292690[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test2.|-5218942532816206869[0] + get + +// CHECK: +// Mangled name: {}test3 +// Public signature: /test3|7677556066983021166[0] +val test3: Function2 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function2 + // Public signature: /test3.|7794341945053892780[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test3.|-7333791615083236686[0] + get + +// CHECK: +// Mangled name: {}test4 +// Public signature: /test4|-9115637610245762085[0] +val test4: Function2 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function2 + // Public signature: /test4.|6534158501518091161[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test4.|4166854324968284003[0] + get + diff --git a/compiler/testData/ir/irText/declarations/parameters/localFun.kt b/compiler/testData/ir/irText/declarations/parameters/localFun.kt index 5b5bb305ebb..32e8c26d579 100644 --- a/compiler/testData/ir/irText/declarations/parameters/localFun.kt +++ b/compiler/testData/ir/irText/declarations/parameters/localFun.kt @@ -1,4 +1,9 @@ // FIR_IDENTICAL +// DUMP_LOCAL_DECLARATION_SIGNATURES + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57434 + fun outer() { fun test1(i: Int, j: T) {} @@ -7,4 +12,4 @@ fun outer() { fun test3(vararg args: String) {} fun String.textExt1(i: Int, j: TT) {} -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/declarations/parameters/localFun.sig.kt.txt b/compiler/testData/ir/irText/declarations/parameters/localFun.sig.kt.txt new file mode 100644 index 00000000000..cfb286ae7b2 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/localFun.sig.kt.txt @@ -0,0 +1,20 @@ +// CHECK: +// Mangled name: #outer(){0§} +// Public signature: /outer|-6093606212547620330[0] +fun outer(): Unit + // CHECK: + // Mangled name: #outer(){0§}#test1#static(kotlin.Int;0:0){0§} + local fun test1(i: Int, j: T): Unit + + // CHECK: + // Mangled name: #outer(){0§}#test2#static(kotlin.Int;kotlin.String){} + local fun test2(i: Int, j: String): Unit + + // CHECK: + // Mangled name: #outer(){0§}#test3#static(kotlin.Array...){} + local fun test3(vararg args: String): Unit + + // CHECK: + // Mangled name: #outer(){0§}#textExt1#static@kotlin.String(kotlin.Int;1:0){} + local fun String.textExt1(i: Int, j: TT): Unit + diff --git a/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.kt b/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.kt index a0df3c1f0f9..0e25db370e6 100644 --- a/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.kt +++ b/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.kt @@ -1,5 +1,8 @@ // FIR_IDENTICAL +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57436 + val test1 get() = 42 var test2 get() = 42; set(value) {} @@ -24,4 +27,4 @@ class Host { val TT.testMemExt3 get() = 42 var TT.testMemExt4 get() = 42; set(value) {} -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.sig.kt.txt b/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.sig.kt.txt new file mode 100644 index 00000000000..959382668f6 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.sig.kt.txt @@ -0,0 +1,179 @@ +// CHECK: +// Mangled name: Host +// Public signature: /Host|null[0] +class Host { + // CHECK: + // Mangled name: Host#(){} + // Public signature: /Host.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Host{}testMem1 + // Public signature: /Host.testMem1|-1447520735631866772[0] + val testMem1: Int + // CHECK JVM_IR: + // Mangled name: Host#(){}kotlin.Int + // Public signature: /Host.testMem1.|-1232121520056352012[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#(){} + // Public signature: /Host.testMem1.|169643884510328829[0] + get(): Int + + // CHECK: + // Mangled name: Host{}testMem2 + // Public signature: /Host.testMem2|-4498711282114194633[0] + var testMem2: Int + // CHECK JVM_IR: + // Mangled name: Host#(){}kotlin.Int + // Public signature: /Host.testMem2.|5656363606698284790[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#(){} + // Public signature: /Host.testMem2.|15588222057838178[0] + get(): Int + // CHECK: + // Mangled name: Host#(kotlin.Int){} + // Public signature: /Host.testMem2.|7294485341588264545[0] + set(value: Int): Unit + + // CHECK: + // Mangled name: Host@kotlin.String{}testMemExt1 + // Public signature: /Host.testMemExt1|-6449535615988838712[0] + val String.testMemExt1: Int + // CHECK JVM_IR: + // Mangled name: Host#@kotlin.String(){}kotlin.Int + // Public signature: /Host.testMemExt1.|970738054146358000[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#@kotlin.String(){} + // Public signature: /Host.testMemExt1.|2784647792030620613[0] + get(): Int + + // CHECK: + // Mangled name: Host@kotlin.String{}testMemExt2 + // Public signature: /Host.testMemExt2|-5449149765380806845[0] + var String.testMemExt2: Int + // CHECK JVM_IR: + // Mangled name: Host#@kotlin.String(){}kotlin.Int + // Public signature: /Host.testMemExt2.|-6652427309470654819[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#@kotlin.String(){} + // Public signature: /Host.testMemExt2.|999321716720031878[0] + get(): Int + // CHECK: + // Mangled name: Host#@kotlin.String(kotlin.Int){} + // Public signature: /Host.testMemExt2.|-405928299943839949[0] + set(value: Int): Unit + + // CHECK: + // Mangled name: Host@0:0{0§}testMemExt3 + // Public signature: /Host.testMemExt3|-7874830272187415472[0] + val TT.testMemExt3: Int + // CHECK JVM_IR: + // Mangled name: Host#@0:0(){0§}kotlin.Int + // Public signature: /Host.testMemExt3.|-2586208141743908696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#@0:0(){0§} + // Public signature: /Host.testMemExt3.|-5692748676763918765[0] + get(): Int + + // CHECK: + // Mangled name: Host@0:0{0§}testMemExt4 + // Public signature: /Host.testMemExt4|-3437206671582974302[0] + var TT.testMemExt4: Int + // CHECK JVM_IR: + // Mangled name: Host#@0:0(){0§}kotlin.Int + // Public signature: /Host.testMemExt4.|5925612720392200708[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#@0:0(){0§} + // Public signature: /Host.testMemExt4.|6623275535091051762[0] + get(): Int + // CHECK: + // Mangled name: Host#@0:0(kotlin.Int){0§} + // Public signature: /Host.testMemExt4.|-4031268341673357490[0] + set(value: Int): Unit + +} + +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test1.|3978508226793108919[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test1.|-5735092642142423279[0] + get(): Int + +// CHECK: +// Mangled name: {}test2 +// Public signature: /test2|2517758057000911509[0] +var test2: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test2.|-8779933517717592707[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test2.|-5218942532816206869[0] + get(): Int + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /test2.|1925150309265265312[0] + set(value: Int): Unit + +// CHECK: +// Mangled name: @kotlin.String{}testExt1 +// Public signature: /testExt1|-249395506920620125[0] +val String.testExt1: Int + // CHECK JVM_IR: + // Mangled name: #@kotlin.String(){}kotlin.Int + // Public signature: /testExt1.|-5970184508643235487[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@kotlin.String(){} + // Public signature: /testExt1.|-5888715629225928441[0] + get(): Int + +// CHECK: +// Mangled name: @kotlin.String{}testExt2 +// Public signature: /testExt2|3677730422947849397[0] +var String.testExt2: Int + // CHECK JVM_IR: + // Mangled name: #@kotlin.String(){}kotlin.Int + // Public signature: /testExt2.|3144752879326245332[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@kotlin.String(){} + // Public signature: /testExt2.|1324590894596109610[0] + get(): Int + // CHECK: + // Mangled name: #@kotlin.String(kotlin.Int){} + // Public signature: /testExt2.|-130364836495443009[0] + set(value: Int): Unit + +// CHECK: +// Mangled name: @0:0{0§}testExt3 +// Public signature: /testExt3|5707451855742850505[0] +val T.testExt3: Int + // CHECK JVM_IR: + // Mangled name: #@0:0(){0§}kotlin.Int + // Public signature: /testExt3.|-5691037839389315263[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@0:0(){0§} + // Public signature: /testExt3.|119269900146022469[0] + get(): Int + +// CHECK: +// Mangled name: @0:0{0§}testExt4 +// Public signature: /testExt4|-8511308814916191109[0] +var T.testExt4: Int + // CHECK JVM_IR: + // Mangled name: #@0:0(){0§}kotlin.Int + // Public signature: /testExt4.|8608740534387272957[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@0:0(){0§} + // Public signature: /testExt4.|70932167769866835[0] + get(): Int + // CHECK: + // Mangled name: #@0:0(kotlin.Int){0§} + // Public signature: /testExt4.|-1753210956385230599[0] + set(value: Int): Unit + diff --git a/compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.kt b/compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.kt index e0f5e0bb1e1..0fe4a6fb27e 100644 --- a/compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.kt +++ b/compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.kt @@ -1,4 +1,8 @@ // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57436 + class Test1 fun test2() {} diff --git a/compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.sig.kt.txt b/compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.sig.kt.txt new file mode 100644 index 00000000000..5e81677b203 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.sig.kt.txt @@ -0,0 +1,29 @@ +// CHECK: +// Mangled name: Test1 +// Public signature: /Test1|null[0] +class Test1 { + // CHECK: + // Mangled name: Test1#(){} + // Public signature: /Test1.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: #test2(){0§<0:1>;1§} +// Public signature: /test2|399191830655193395[0] +fun test2(): Unit + +// CHECK: +// Mangled name: @Test1<0:0,0:1>{0§<0:1>;1§}test3 +// Public signature: /test3|3727797672191258754[0] +var Test1.test3: Unit + // CHECK: + // Mangled name: #@Test1<0:0,0:1>(){0§<0:1>;1§} + // Public signature: /test3.|-1147160124830350693[0] + get(): Unit + // CHECK: + // Mangled name: #@Test1<0:0,0:1>(kotlin.Unit){0§<0:1>;1§} + // Public signature: /test3.|-2752932164829394869[0] + set(value: Unit): Unit + diff --git a/compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.sig.kt.txt b/compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.sig.kt.txt new file mode 100644 index 00000000000..25a6ddfbd36 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.sig.kt.txt @@ -0,0 +1,54 @@ +// CHECK: +// Mangled name: Base1 +// Public signature: /Base1|null[0] +abstract class Base1 { + // CHECK: + // Mangled name: Base1#(){} + // Public signature: /Base1.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: Base2 +// Public signature: /Base2|null[0] +abstract class Base2 { + // CHECK: + // Mangled name: Base2#(){} + // Public signature: /Base2.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Base2#foo(0:0){0§} + // Public signature: /Base2.foo|-3916608809820920154[0] + fun foo(x: T): Unit + +} + +// CHECK: +// Mangled name: Derived1 +// Public signature: /Derived1|null[0] +class Derived1 : Base1 { + // CHECK: + // Mangled name: Derived1#(){} + // Public signature: /Derived1.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: Derived2 +// Public signature: /Derived2|null[0] +class Derived2 : Base2 { + // CHECK: + // Mangled name: Derived2#(){} + // Public signature: /Derived2.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Derived2#foo(0:0){0§} + // Public signature: /Derived2.foo|-3916608809820920154[0] + /* fake */ override fun foo(x: T): Unit + +} + diff --git a/compiler/testData/ir/irText/declarations/parameters/useNextParamInLambda.sig.kt.txt b/compiler/testData/ir/irText/declarations/parameters/useNextParamInLambda.sig.kt.txt new file mode 100644 index 00000000000..45431683c14 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/useNextParamInLambda.sig.kt.txt @@ -0,0 +1,16 @@ +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +// CHECK JS_IR NATIVE: +// Mangled name: #box(){} +// Public signature: /box|2173511048851971368[0] +fun box(): String + +// CHECK JVM_IR: +// Mangled name: #f(kotlin.Function0;kotlin.Function0){}kotlin.String +// Public signature: /f|3250103379442841891[0] +// CHECK JS_IR NATIVE: +// Mangled name: #f(kotlin.Function0;kotlin.Function0){} +// Public signature: /f|1185070276750380808[0] +fun f(f1: Function0, f2: Function0): String + diff --git a/compiler/testData/ir/irText/declarations/primaryCtorDefaultArguments.sig.kt.txt b/compiler/testData/ir/irText/declarations/primaryCtorDefaultArguments.sig.kt.txt new file mode 100644 index 00000000000..a435ed60165 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/primaryCtorDefaultArguments.sig.kt.txt @@ -0,0 +1,23 @@ +// CHECK: +// Mangled name: Test +// Public signature: /Test|null[0] +class Test { + // CHECK: + // Mangled name: Test{}x + // Public signature: /Test.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: Test#(){}kotlin.Int + // Public signature: /Test.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test#(){} + // Public signature: /Test.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Test#(kotlin.Int){} + // Public signature: /Test.|-5182794243525578284[0] + constructor(x: Int) /* primary */ + +} + diff --git a/compiler/testData/ir/irText/declarations/primaryCtorProperties.sig.kt.txt b/compiler/testData/ir/irText/declarations/primaryCtorProperties.sig.kt.txt new file mode 100644 index 00000000000..07ee9b66c44 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/primaryCtorProperties.sig.kt.txt @@ -0,0 +1,39 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C{}test1 + // Public signature: /C.test1|6005685442305498193[0] + val test1: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.test1.|3978508226793108919[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.test1.|-5735092642142423279[0] + get + + // CHECK: + // Mangled name: C{}test2 + // Public signature: /C.test2|2517758057000911509[0] + var test2: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.test2.|-8779933517717592707[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.test2.|-5218942532816206869[0] + get + // CHECK: + // Mangled name: C#(kotlin.Int){} + // Public signature: /C.test2.|1925150309265265312[0] + set + + // CHECK: + // Mangled name: C#(kotlin.Int;kotlin.Int){} + // Public signature: /C.|-7691762014320324121[0] + constructor(test1: Int, test2: Int) /* primary */ + +} + diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.kt b/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.kt index 71fdb748b47..cc303848e1f 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.kt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.kt @@ -1,6 +1,10 @@ // 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/differentReceivers.sig.kt.txt b/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.sig.kt.txt new file mode 100644 index 00000000000..0158a1725c2 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.sig.kt.txt @@ -0,0 +1,75 @@ +// CHECK: +// Mangled name: {}testO +// Public signature: /testO|-1722316900881071484[0] +val testO: String /* by */ + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /testO.|6508188275214307126[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testO.|-3763883097242620954[0] + get(): String + +// CHECK: +// Mangled name: {}testK +// Public signature: /testK|461235508368952777[0] +val testK: String /* by */ + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /testK.|-2909374821716432695[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testK.|-1940693732380089532[0] + get(): String + +// CHECK: +// Mangled name: {}testOK +// Public signature: /testOK|2366514158430938845[0] +val testOK: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /testOK.|-4878971389425188413[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testOK.|-5404434627257810463[0] + get + +// CHECK: +// Mangled name: MyClass +// Public signature: /MyClass|null[0] +class MyClass { + // CHECK: + // Mangled name: MyClass{}value + // Public signature: /MyClass.value|1987073854177347439[0] + val value: String + // CHECK JVM_IR: + // Mangled name: MyClass#(){}kotlin.String + // Public signature: /MyClass.value.|-7202092821145242726[0] + // CHECK JS_IR NATIVE: + // Mangled name: MyClass#(){} + // Public signature: /MyClass.value.|3260093555963109437[0] + get + + // CHECK: + // Mangled name: MyClass#(kotlin.String){} + // Public signature: /MyClass.|1280618353163213788[0] + constructor(value: String) /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #getValue@kotlin.String(kotlin.Any?;kotlin.Any){}kotlin.String +// Public signature: /getValue|-3094640188751663439[0] +// CHECK JS_IR NATIVE: +// Mangled name: #getValue@kotlin.String(kotlin.Any?;kotlin.Any){} +// Public signature: /getValue|3042257834970167256[0] +operator fun String.getValue(receiver: Any?, p: Any): String + +// CHECK JVM_IR: +// Mangled name: #provideDelegate@MyClass(kotlin.Any?;kotlin.Any){}kotlin.String +// Public signature: /provideDelegate|1258517683836483629[0] +// CHECK JS_IR NATIVE: +// Mangled name: #provideDelegate@MyClass(kotlin.Any?;kotlin.Any){} +// Public signature: /provideDelegate|-3220946013837035345[0] +operator fun MyClass.provideDelegate(host: Any?, p: Any): String + diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/javaDelegate.kt b/compiler/testData/ir/irText/declarations/provideDelegate/javaDelegate.kt index ba907d1a056..1bf5f96045d 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/javaDelegate.kt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/javaDelegate.kt @@ -2,6 +2,9 @@ // TARGET_BACKEND: JVM // SKIP_KT_DUMP +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57433 + // FILE: box.kt package k @@ -29,4 +32,4 @@ public class J { public String getFoo() { return s; } -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/javaDelegate.sig.kt.txt b/compiler/testData/ir/irText/declarations/provideDelegate/javaDelegate.sig.kt.txt new file mode 100644 index 00000000000..00ee68859e3 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/provideDelegate/javaDelegate.sig.kt.txt @@ -0,0 +1,33 @@ +package k + +// CHECK: +// Mangled name: k{}p1 +// Public signature: k/p1|7711764890799440087[0] +var p1: String? /* by */ + // CHECK JVM_IR: + // Mangled name: k#(){}kotlin.String? + // Public signature: k/p1.|5971261250566155614[0] + get(): String? + // CHECK: + // Mangled name: k#(kotlin.String?){} + // Public signature: k/p1.|3343971922772025315[0] + set(: String?): Unit + +// CHECK: +// Mangled name: k{}p2 +// Public signature: k/p2|1837305664617486052[0] +var p2: String? /* by */ + // CHECK JVM_IR: + // Mangled name: k#(){}kotlin.String? + // Public signature: k/p2.|-4091002339170091991[0] + get(): String? + // CHECK: + // Mangled name: k#(kotlin.String?){} + // Public signature: k/p2.|-4224463707988097282[0] + set(: String?): Unit + +// CHECK JVM_IR: +// Mangled name: k#box(){}kotlin.String +// Public signature: k/box|-9347091776561469[0] +fun box(): String + diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/local.kt b/compiler/testData/ir/irText/declarations/provideDelegate/local.kt index 0809981ff6c..5d8f0f79b87 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/local.kt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/local.kt @@ -1,4 +1,9 @@ // FIR_IDENTICAL +// DUMP_LOCAL_DECLARATION_SIGNATURES + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57434 + class Delegate(val value: String) { operator fun getValue(thisRef: Any?, property: Any?) = value } diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/local.sig.kt.txt b/compiler/testData/ir/irText/declarations/provideDelegate/local.sig.kt.txt new file mode 100644 index 00000000000..b4663ddcae9 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/provideDelegate/local.sig.kt.txt @@ -0,0 +1,74 @@ +// CHECK: +// Mangled name: Delegate +// Public signature: /Delegate|null[0] +class Delegate { + // CHECK: + // Mangled name: Delegate{}value + // Public signature: /Delegate.value|1987073854177347439[0] + val value: String + field + // CHECK JVM_IR: + // Mangled name: Delegate#(){}kotlin.String + // Public signature: /Delegate.value.|-7202092821145242726[0] + // CHECK JS_IR NATIVE: + // Mangled name: Delegate#(){} + // Public signature: /Delegate.value.|3260093555963109437[0] + get + + // CHECK: + // Mangled name: Delegate#(kotlin.String){} + // Public signature: /Delegate.|1280618353163213788[0] + constructor(value: String) /* primary */ + + // CHECK JVM_IR: + // Mangled name: Delegate#getValue(kotlin.Any?;kotlin.Any?){}kotlin.String + // Public signature: /Delegate.getValue|-3989854329232997863[0] + // CHECK JS_IR NATIVE: + // Mangled name: Delegate#getValue(kotlin.Any?;kotlin.Any?){} + // Public signature: /Delegate.getValue|-9077843357189755365[0] + operator fun getValue(thisRef: Any?, property: Any?): String + +} + +// CHECK: +// Mangled name: DelegateProvider +// Public signature: /DelegateProvider|null[0] +class DelegateProvider { + // CHECK: + // Mangled name: DelegateProvider{}value + // Public signature: /DelegateProvider.value|1987073854177347439[0] + val value: String + field + // CHECK JVM_IR: + // Mangled name: DelegateProvider#(){}kotlin.String + // Public signature: /DelegateProvider.value.|-7202092821145242726[0] + // CHECK JS_IR NATIVE: + // Mangled name: DelegateProvider#(){} + // Public signature: /DelegateProvider.value.|3260093555963109437[0] + get + + // CHECK: + // Mangled name: DelegateProvider#(kotlin.String){} + // Public signature: /DelegateProvider.|1280618353163213788[0] + constructor(value: String) /* primary */ + + // CHECK JVM_IR: + // Mangled name: DelegateProvider#provideDelegate(kotlin.Any?;kotlin.Any?){}Delegate + // Public signature: /DelegateProvider.provideDelegate|8347738726431448305[0] + // CHECK JS_IR NATIVE: + // Mangled name: DelegateProvider#provideDelegate(kotlin.Any?;kotlin.Any?){} + // Public signature: /DelegateProvider.provideDelegate|-8444239183469250963[0] + operator fun provideDelegate(thisRef: Any?, property: Any?): Delegate + +} + +// CHECK: +// Mangled name: #foo(){} +// Public signature: /foo|-1041209573719867811[0] +fun foo(): Unit + // CHECK JVM_IR: + // Mangled name: #foo(){}##static(){}kotlin.String + // CHECK JS_IR NATIVE: + // Mangled name: #foo(){}##static(){} + local fun (): String + diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.kt b/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.kt index 65945afe12e..bb5f76b4b00 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.kt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.kt @@ -1,5 +1,9 @@ // FIR_IDENTICAL // WITH_STDLIB +// DUMP_LOCAL_DECLARATION_SIGNATURES + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57434 class MyClass(val value: String) diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.sig.kt.txt b/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.sig.kt.txt new file mode 100644 index 00000000000..70fda7608cb --- /dev/null +++ b/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.sig.kt.txt @@ -0,0 +1,59 @@ +// CHECK: +// Mangled name: MyClass +// Public signature: /MyClass|null[0] +class MyClass { + // CHECK: + // Mangled name: MyClass{}value + // Public signature: /MyClass.value|1987073854177347439[0] + val value: String + field + // CHECK JVM_IR: + // Mangled name: MyClass#(){}kotlin.String + // Public signature: /MyClass.value.|-7202092821145242726[0] + // CHECK JS_IR NATIVE: + // Mangled name: MyClass#(){} + // Public signature: /MyClass.value.|3260093555963109437[0] + get + + // CHECK: + // Mangled name: MyClass#(kotlin.String){} + // Public signature: /MyClass.|1280618353163213788[0] + constructor(value: String) /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +// CHECK JS_IR NATIVE: +// Mangled name: #box(){} +// Public signature: /box|2173511048851971368[0] +fun box(): String + // CHECK JVM_IR: + // Mangled name: #box(){}kotlin.String##static(){}kotlin.String + // CHECK JS_IR NATIVE: + // Mangled name: #box(){}##static(){} + local fun (): String + + // CHECK JVM_IR: + // Mangled name: #box(){}kotlin.String##static(){}kotlin.String + // CHECK JS_IR NATIVE: + // Mangled name: #box(){}##static(){} + local fun (): String + +// CHECK JVM_IR: +// Mangled name: #getValue@kotlin.String(kotlin.Any?;kotlin.Any){}kotlin.String +// Public signature: /getValue|-3094640188751663439[0] +// CHECK JS_IR NATIVE: +// Mangled name: #getValue@kotlin.String(kotlin.Any?;kotlin.Any){} +// Public signature: /getValue|3042257834970167256[0] +operator fun String.getValue(receiver: Any?, p: Any): String + +// CHECK JVM_IR: +// Mangled name: #provideDelegate@MyClass(kotlin.Any?;kotlin.Any){}kotlin.String +// Public signature: /provideDelegate|1258517683836483629[0] +// CHECK JS_IR NATIVE: +// Mangled name: #provideDelegate@MyClass(kotlin.Any?;kotlin.Any){} +// Public signature: /provideDelegate|-3220946013837035345[0] +operator fun MyClass.provideDelegate(host: Any?, p: Any): String + diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/member.sig.kt.txt b/compiler/testData/ir/irText/declarations/provideDelegate/member.sig.kt.txt new file mode 100644 index 00000000000..5c7ef0a0a2f --- /dev/null +++ b/compiler/testData/ir/irText/declarations/provideDelegate/member.sig.kt.txt @@ -0,0 +1,85 @@ +// CHECK: +// Mangled name: Delegate +// Public signature: /Delegate|null[0] +class Delegate { + // CHECK: + // Mangled name: Delegate{}value + // Public signature: /Delegate.value|1987073854177347439[0] + val value: String + // CHECK JVM_IR: + // Mangled name: Delegate#(){}kotlin.String + // Public signature: /Delegate.value.|-7202092821145242726[0] + // CHECK JS_IR NATIVE: + // Mangled name: Delegate#(){} + // Public signature: /Delegate.value.|3260093555963109437[0] + get + + // CHECK: + // Mangled name: Delegate#(kotlin.String){} + // Public signature: /Delegate.|1280618353163213788[0] + constructor(value: String) /* primary */ + + // CHECK JVM_IR: + // Mangled name: Delegate#getValue(kotlin.Any?;kotlin.Any?){}kotlin.String + // Public signature: /Delegate.getValue|-3989854329232997863[0] + // CHECK JS_IR NATIVE: + // Mangled name: Delegate#getValue(kotlin.Any?;kotlin.Any?){} + // Public signature: /Delegate.getValue|-9077843357189755365[0] + operator fun getValue(thisRef: Any?, property: Any?): String + +} + +// CHECK: +// Mangled name: DelegateProvider +// Public signature: /DelegateProvider|null[0] +class DelegateProvider { + // CHECK: + // Mangled name: DelegateProvider{}value + // Public signature: /DelegateProvider.value|1987073854177347439[0] + val value: String + // CHECK JVM_IR: + // Mangled name: DelegateProvider#(){}kotlin.String + // Public signature: /DelegateProvider.value.|-7202092821145242726[0] + // CHECK JS_IR NATIVE: + // Mangled name: DelegateProvider#(){} + // Public signature: /DelegateProvider.value.|3260093555963109437[0] + get + + // CHECK: + // Mangled name: DelegateProvider#(kotlin.String){} + // Public signature: /DelegateProvider.|1280618353163213788[0] + constructor(value: String) /* primary */ + + // CHECK JVM_IR: + // Mangled name: DelegateProvider#provideDelegate(kotlin.Any?;kotlin.Any?){}Delegate + // Public signature: /DelegateProvider.provideDelegate|8347738726431448305[0] + // CHECK JS_IR NATIVE: + // Mangled name: DelegateProvider#provideDelegate(kotlin.Any?;kotlin.Any?){} + // Public signature: /DelegateProvider.provideDelegate|-8444239183469250963[0] + operator fun provideDelegate(thisRef: Any?, property: Any?): Delegate + +} + +// CHECK: +// Mangled name: Host +// Public signature: /Host|null[0] +class Host { + // CHECK: + // Mangled name: Host{}testMember + // Public signature: /Host.testMember|3596345948481629707[0] + val testMember: String /* by */ + // CHECK JVM_IR: + // Mangled name: Host#(){}kotlin.String + // Public signature: /Host.testMember.|-7542039692233990309[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#(){} + // Public signature: /Host.testMember.|-6396882948527957371[0] + get(): String + + // CHECK: + // Mangled name: Host#(){} + // Public signature: /Host.|-5645683436151566731[0] + constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.sig.kt.txt b/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.sig.kt.txt new file mode 100644 index 00000000000..153bf1b7584 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.sig.kt.txt @@ -0,0 +1,74 @@ +// CHECK: +// Mangled name: Host +// Public signature: /Host|null[0] +object Host { + // CHECK: + // Mangled name: Host@kotlin.String{}plusK + // Public signature: /Host.plusK|-5135341778615178066[0] + val String.plusK: String /* by */ + // CHECK JVM_IR: + // Mangled name: Host#@kotlin.String(){}kotlin.String + // Public signature: /Host.plusK.|3745691594714867630[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#@kotlin.String(){} + // Public signature: /Host.plusK.|9025996815801643210[0] + get(): String + + // CHECK: + // Mangled name: Host{}ok + // Public signature: /Host.ok|3084714860561867417[0] + val ok: String + // CHECK JVM_IR: + // Mangled name: Host#(){}kotlin.String + // Public signature: /Host.ok.|-4000622060828023401[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#(){} + // Public signature: /Host.ok.|6963158084917262476[0] + get + + // CHECK: + // Mangled name: Host.StringDelegate + // Public signature: /Host.StringDelegate|null[0] + class StringDelegate { + // CHECK: + // Mangled name: Host.StringDelegate{}s + // Public signature: /Host.StringDelegate.s|7217541905509134881[0] + val s: String + // CHECK JVM_IR: + // Mangled name: Host.StringDelegate#(){}kotlin.String + // Public signature: /Host.StringDelegate.s.|4142379646177092803[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host.StringDelegate#(){} + // Public signature: /Host.StringDelegate.s.|-1662172381559511151[0] + get + + // CHECK: + // Mangled name: Host.StringDelegate#(kotlin.String){} + // Public signature: /Host.StringDelegate.|1280618353163213788[0] + constructor(s: String) /* primary */ + + // CHECK JVM_IR: + // Mangled name: Host.StringDelegate#getValue(kotlin.String;kotlin.Any){}kotlin.String + // Public signature: /Host.StringDelegate.getValue|-6458230510682528416[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host.StringDelegate#getValue(kotlin.String;kotlin.Any){} + // Public signature: /Host.StringDelegate.getValue|7907668248030418959[0] + operator fun getValue(receiver: String, p: Any): String + + } + + // CHECK: + // Mangled name: Host#(){} + // Public signature: /Host.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Host#provideDelegate@kotlin.String(kotlin.Any?;kotlin.Any){}Host.StringDelegate + // Public signature: /Host.provideDelegate|8603848002271829719[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#provideDelegate@kotlin.String(kotlin.Any?;kotlin.Any){} + // Public signature: /Host.provideDelegate|-84581881633703397[0] + operator fun String.provideDelegate(host: Any?, p: Any): StringDelegate + +} + diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.kt b/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.kt index 8fe9a7930c0..fab6d278410 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.kt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.kt @@ -1,4 +1,9 @@ // 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/declarations/provideDelegate/topLevel.sig.kt.txt b/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.sig.kt.txt new file mode 100644 index 00000000000..39c17cc84d2 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.sig.kt.txt @@ -0,0 +1,74 @@ +// CHECK: +// Mangled name: {}testTopLevel +// Public signature: /testTopLevel|-3668637245724800944[0] +val testTopLevel: String /* by */ + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /testTopLevel.|2099979481809527830[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testTopLevel.|6926646903306405207[0] + get(): String + +// CHECK: +// Mangled name: Delegate +// Public signature: /Delegate|null[0] +class Delegate { + // CHECK: + // Mangled name: Delegate{}value + // Public signature: /Delegate.value|1987073854177347439[0] + val value: String + // CHECK JVM_IR: + // Mangled name: Delegate#(){}kotlin.String + // Public signature: /Delegate.value.|-7202092821145242726[0] + // CHECK JS_IR NATIVE: + // Mangled name: Delegate#(){} + // Public signature: /Delegate.value.|3260093555963109437[0] + get + + // CHECK: + // Mangled name: Delegate#(kotlin.String){} + // Public signature: /Delegate.|1280618353163213788[0] + constructor(value: String) /* primary */ + + // CHECK JVM_IR: + // Mangled name: Delegate#getValue(kotlin.Any?;kotlin.Any?){}kotlin.String + // Public signature: /Delegate.getValue|-3989854329232997863[0] + // CHECK JS_IR NATIVE: + // Mangled name: Delegate#getValue(kotlin.Any?;kotlin.Any?){} + // Public signature: /Delegate.getValue|-9077843357189755365[0] + operator fun getValue(thisRef: Any?, property: Any?): String + +} + +// CHECK: +// Mangled name: DelegateProvider +// Public signature: /DelegateProvider|null[0] +class DelegateProvider { + // CHECK: + // Mangled name: DelegateProvider{}value + // Public signature: /DelegateProvider.value|1987073854177347439[0] + val value: String + // CHECK JVM_IR: + // Mangled name: DelegateProvider#(){}kotlin.String + // Public signature: /DelegateProvider.value.|-7202092821145242726[0] + // CHECK JS_IR NATIVE: + // Mangled name: DelegateProvider#(){} + // Public signature: /DelegateProvider.value.|3260093555963109437[0] + get + + // CHECK: + // Mangled name: DelegateProvider#(kotlin.String){} + // Public signature: /DelegateProvider.|1280618353163213788[0] + constructor(value: String) /* primary */ + + // CHECK JVM_IR: + // Mangled name: DelegateProvider#provideDelegate(kotlin.Any?;kotlin.Any?){}Delegate + // Public signature: /DelegateProvider.provideDelegate|8347738726431448305[0] + // CHECK JS_IR NATIVE: + // Mangled name: DelegateProvider#provideDelegate(kotlin.Any?;kotlin.Any?){} + // Public signature: /DelegateProvider.provideDelegate|-8444239183469250963[0] + operator fun provideDelegate(thisRef: Any?, property: Any?): Delegate + +} + diff --git a/compiler/testData/ir/irText/declarations/typeAlias.kt b/compiler/testData/ir/irText/declarations/typeAlias.kt index 78a67277d76..6916c462749 100644 --- a/compiler/testData/ir/irText/declarations/typeAlias.kt +++ b/compiler/testData/ir/irText/declarations/typeAlias.kt @@ -1,3 +1,6 @@ +// SKIP_SIGNATURE_DUMP +// ^ KT-45285 + typealias Test1 = String fun foo() { @@ -8,4 +11,4 @@ fun foo() { class C { @Suppress("TOPLEVEL_TYPEALIASES_ONLY") typealias TestNested = String -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/errors/suppressedNonPublicCall.sig.kt.txt b/compiler/testData/ir/irText/errors/suppressedNonPublicCall.sig.kt.txt new file mode 100644 index 00000000000..c3c726c3d1b --- /dev/null +++ b/compiler/testData/ir/irText/errors/suppressedNonPublicCall.sig.kt.txt @@ -0,0 +1,21 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: C#bar(){} + // Public signature: /C.bar|496682602797471549[0] + internal fun bar(): Unit + +} + +// CHECK: +// Mangled name: #foo@C(){} +// Public signature: /foo|-8448020621019557006[0] +inline fun C.foo(): Unit + diff --git a/compiler/testData/ir/irText/errors/unresolvedReference.sig.kt.txt b/compiler/testData/ir/irText/errors/unresolvedReference.sig.kt.txt new file mode 100644 index 00000000000..3b85a2ab99a --- /dev/null +++ b/compiler/testData/ir/irText/errors/unresolvedReference.sig.kt.txt @@ -0,0 +1,40 @@ +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: ErrorType + // CHECK JVM_IR: + // Mangled name computed from Ir: #(){} + // Mangled name computed from Descriptor: #(){} + // Public signature: /test1.|-4817139884021780494[0] + get + +// CHECK: +// Mangled name: {}test2 +// Public signature: /test2|2517758057000911509[0] +val test2: ErrorType + // CHECK JVM_IR: + // Mangled name computed from Ir: #(){} + // Mangled name computed from Descriptor: #(){} + // Public signature: /test2.|1859255286326922853[0] + get + +// CHECK: +// Mangled name: {}test3 +// Public signature: /test3|7677556066983021166[0] +val test3: ErrorType + // CHECK JVM_IR: + // Mangled name computed from Ir: #(){} + // Mangled name computed from Descriptor: #(){} + // Public signature: /test3.|-2322568342617474229[0] + get + +// CHECK: +// Mangled name: {}test4 +// Public signature: /test4|-9115637610245762085[0] +val test4: ErrorType + // CHECK JVM_IR: + // Mangled name computed from Ir: #(){} + // Mangled name computed from Descriptor: #(){} + // Public signature: /test4.|-5181690683324812065[0] + get + diff --git a/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.kt b/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.kt index 67091bde2cc..f7f2bd795d5 100644 --- a/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.kt +++ b/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.kt @@ -1,6 +1,10 @@ // TARGET_BACKEND: JVM_IR // SKIP_KLIB_TEST // Related to KT-49507 + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57433 + // FILE: A.java public class A { protected String x = "1"; diff --git a/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.sig.kt.txt b/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.sig.kt.txt new file mode 100644 index 00000000000..668bff4b04f --- /dev/null +++ b/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.sig.kt.txt @@ -0,0 +1,28 @@ +package test + +// CHECK: +// Mangled name: test.C +// Public signature: test/C|null[0] +class C : B { + // CHECK: + // Mangled name: test.C#(){} + // Public signature: test/C.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: test.C#f(){}kotlin.String? + // Public signature: test/C.f|6718023650115810455[0] + fun f(): String? + + // CHECK JVM_IR: + // Mangled name: test.C#g(){}kotlin.String? + // Public signature: test/C.g|-377144927952738440[0] + fun g(): String? + +} + +// CHECK JVM_IR: +// Mangled name: test#eval(kotlin.Function0<0:0>){0§}0:0 +// Public signature: test/eval|-3571752498880916343[0] +fun eval(f: Function0): T + diff --git a/compiler/testData/ir/irText/expressions/argumentMappedWithError.kt b/compiler/testData/ir/irText/expressions/argumentMappedWithError.kt index e6fcf9086de..9ff8b3a5143 100644 --- a/compiler/testData/ir/irText/expressions/argumentMappedWithError.kt +++ b/compiler/testData/ir/irText/expressions/argumentMappedWithError.kt @@ -2,6 +2,9 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57755 + fun Number.convert(): R = TODO() fun foo(arg: Number) { diff --git a/compiler/testData/ir/irText/expressions/argumentMappedWithError.sig.kt.txt b/compiler/testData/ir/irText/expressions/argumentMappedWithError.sig.kt.txt new file mode 100644 index 00000000000..440374caf3b --- /dev/null +++ b/compiler/testData/ir/irText/expressions/argumentMappedWithError.sig.kt.txt @@ -0,0 +1,22 @@ +// CHECK JVM_IR: +// Mangled name: #convert@kotlin.Number(){0§}0:0 +// Public signature: /convert|-8929373318028206908[0] +// CHECK JS_IR NATIVE: +// Mangled name: #convert@kotlin.Number(){0§} +// Public signature: /convert|1202542150258287198[0] +fun Number.convert(): R + +// CHECK: +// Mangled name: #foo(kotlin.Number){} +// Public signature: /foo|97687418835402471[0] +fun foo(arg: Number): Unit + +// CHECK JVM_IR: +// Mangled name computed from Ir: #main(kotlin.Array){} +// Mangled name computed from Descriptor: #main(kotlin.Array){}%argumentMappedWithError.kt +// Public signature: /main|5561668743171252170[0] +// CHECK JS_IR NATIVE: +// Mangled name: #main(kotlin.Array){} +// Public signature: /main|5976701115139892152[0] +fun main(args: Array): Unit + diff --git a/compiler/testData/ir/irText/expressions/arrayAccess.kt b/compiler/testData/ir/irText/expressions/arrayAccess.kt index aea4a7cc602..28b16d03c99 100644 --- a/compiler/testData/ir/irText/expressions/arrayAccess.kt +++ b/compiler/testData/ir/irText/expressions/arrayAccess.kt @@ -1,5 +1,9 @@ +// MUTE_SIGNATURE_COMPARISON_K2: JS_IR +// MUTE_SIGNATURE_COMPARISON_K2: NATIVE +// ^ KT-57818 + val p = 0 fun foo() = 1 fun test(a: IntArray) = - a[0] + a[p] + a[foo()] \ No newline at end of file + a[0] + a[p] + a[foo()] diff --git a/compiler/testData/ir/irText/expressions/arrayAccess.sig.kt.txt b/compiler/testData/ir/irText/expressions/arrayAccess.sig.kt.txt new file mode 100644 index 00000000000..ec605dfeb20 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/arrayAccess.sig.kt.txt @@ -0,0 +1,28 @@ +// CHECK: +// Mangled name: {}p +// Public signature: /p|6715504260787941082[0] +val p: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /p.|5329635969197638839[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /p.|-1162552463316289847[0] + get + +// CHECK JVM_IR: +// Mangled name: #foo(){}kotlin.Int +// Public signature: /foo|-1256155405684507276[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo(){} +// Public signature: /foo|-1041209573719867811[0] +fun foo(): Int + +// CHECK JVM_IR: +// Mangled name: #test(kotlin.IntArray){}kotlin.Int +// Public signature: /test|3593442840675733055[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test(kotlin.IntArray){} +// Public signature: /test|7529327046024896503[0] +fun test(a: IntArray): Int + diff --git a/compiler/testData/ir/irText/expressions/arrayAssignment.sig.kt.txt b/compiler/testData/ir/irText/expressions/arrayAssignment.sig.kt.txt new file mode 100644 index 00000000000..91cc3ef84f4 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/arrayAssignment.sig.kt.txt @@ -0,0 +1,18 @@ +// CHECK JVM_IR: +// Mangled name: #foo(){}kotlin.Int +// Public signature: /foo|-1256155405684507276[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo(){} +// Public signature: /foo|-1041209573719867811[0] +fun foo(): Int + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + +// CHECK: +// Mangled name: #test2(){} +// Public signature: /test2|4279114864133353152[0] +fun test2(): Unit + diff --git a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.sig.kt.txt b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.sig.kt.txt new file mode 100644 index 00000000000..de2f368dc65 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.sig.kt.txt @@ -0,0 +1,54 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C{}x + // Public signature: /C.x|-8060530855978347579[0] + val x: IntArray + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.IntArray + // Public signature: /C.x.|-5699461780158713262[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: C#(kotlin.IntArray){} + // Public signature: /C.|6811679238332965682[0] + constructor(x: IntArray) /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #bar(){}kotlin.Int +// Public signature: /bar|-6436649210114349217[0] +// CHECK JS_IR NATIVE: +// Mangled name: #bar(){} +// Public signature: /bar|496682602797471549[0] +fun bar(): Int + +// CHECK JVM_IR: +// Mangled name: #foo(){}kotlin.IntArray +// Public signature: /foo|-7128217666146299316[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo(){} +// Public signature: /foo|-1041209573719867811[0] +fun foo(): IntArray + +// CHECK: +// Mangled name: #testCall(){} +// Public signature: /testCall|-7871976205737309252[0] +fun testCall(): Unit + +// CHECK: +// Mangled name: #testMember(C){} +// Public signature: /testMember|-6666493840981303553[0] +fun testMember(c: C): Unit + +// CHECK: +// Mangled name: #testVariable(){} +// Public signature: /testVariable|660968387512033895[0] +fun testVariable(): Unit + diff --git a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.sig.kt.txt b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.sig.kt.txt new file mode 100644 index 00000000000..1d708c8e260 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.sig.kt.txt @@ -0,0 +1,32 @@ +// CHECK: +// Mangled name: IA +// Public signature: /IA|null[0] +interface IA { + + // CHECK JVM_IR: + // Mangled name: IA#get(kotlin.String){}kotlin.Int + // Public signature: /IA.get|8115151130332405730[0] + // CHECK JS_IR NATIVE: + // Mangled name: IA#get(kotlin.String){} + // Public signature: /IA.get|-2844435113185872994[0] + abstract operator fun get(index: String): Int + +} + +// CHECK: +// Mangled name: IB +// Public signature: /IB|null[0] +interface IB { + + // CHECK: + // Mangled name: IB#set@IA(kotlin.String;kotlin.Int){} + // Public signature: /IB.set|-3878244067281394744[0] + abstract operator fun IA.set(index: String, value: Int): Unit + +} + +// CHECK: +// Mangled name: #test@IB(IA){} +// Public signature: /test|-3494937446551267445[0] +fun IB.test(a: IA): Unit + diff --git a/compiler/testData/ir/irText/expressions/assignments.sig.kt.txt b/compiler/testData/ir/irText/expressions/assignments.sig.kt.txt new file mode 100644 index 00000000000..d92937eaf6b --- /dev/null +++ b/compiler/testData/ir/irText/expressions/assignments.sig.kt.txt @@ -0,0 +1,37 @@ +// CHECK: +// Mangled name: Ref +// Public signature: /Ref|null[0] +class Ref { + // CHECK: + // Mangled name: Ref{}x + // Public signature: /Ref.x|-8060530855978347579[0] + var x: Int + // CHECK JVM_IR: + // Mangled name: Ref#(){}kotlin.Int + // Public signature: /Ref.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Ref#(){} + // Public signature: /Ref.x.|1482705010654679335[0] + get + // CHECK: + // Mangled name: Ref#(kotlin.Int){} + // Public signature: /Ref.x.|-740209739415615559[0] + set + + // CHECK: + // Mangled name: Ref#(kotlin.Int){} + // Public signature: /Ref.|-5182794243525578284[0] + constructor(x: Int) /* primary */ + +} + +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +fun test1(): Unit + +// CHECK: +// Mangled name: #test2(Ref){} +// Public signature: /test2|-2139715783370980088[0] +fun test2(r: Ref): Unit + diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignment1.kt b/compiler/testData/ir/irText/expressions/augmentedAssignment1.kt index 3456297b053..87c5f51cf9b 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignment1.kt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignment1.kt @@ -1,3 +1,7 @@ +// 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/augmentedAssignment1.sig.kt.txt b/compiler/testData/ir/irText/expressions/augmentedAssignment1.sig.kt.txt new file mode 100644 index 00000000000..7caa05a46aa --- /dev/null +++ b/compiler/testData/ir/irText/expressions/augmentedAssignment1.sig.kt.txt @@ -0,0 +1,26 @@ +// CHECK: +// Mangled name: {}p +// Public signature: /p|6715504260787941082[0] +var p: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /p.|5329635969197638839[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /p.|-1162552463316289847[0] + get + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /p.|-6346582004572228570[0] + set + +// CHECK: +// Mangled name: #testProperty(){} +// Public signature: /testProperty|5285658686723604291[0] +fun testProperty(): Unit + +// CHECK: +// Mangled name: #testVariable(){} +// Public signature: /testVariable|660968387512033895[0] +fun testVariable(): Unit + diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignment2.kt b/compiler/testData/ir/irText/expressions/augmentedAssignment2.kt index f6361352b7a..f7e556e10a1 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignment2.kt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignment2.kt @@ -1,3 +1,7 @@ +// 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/augmentedAssignment2.sig.kt.txt b/compiler/testData/ir/irText/expressions/augmentedAssignment2.sig.kt.txt new file mode 100644 index 00000000000..4ed40d20ef8 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/augmentedAssignment2.sig.kt.txt @@ -0,0 +1,58 @@ +// CHECK: +// Mangled name: {}p +// Public signature: /p|6715504260787941082[0] +val p: A + // CHECK JVM_IR: + // Mangled name: #(){}A + // Public signature: /p.|2133879666814551157[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /p.|-1162552463316289847[0] + get + +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: #divAssign@A(kotlin.String){} +// Public signature: /divAssign|8861164861689844119[0] +operator fun A.divAssign(s: String): Unit + +// CHECK: +// Mangled name: #minusAssign@A(kotlin.String){} +// Public signature: /minusAssign|7280125346699981355[0] +operator fun A.minusAssign(s: String): Unit + +// CHECK: +// Mangled name: #plusAssign@A(kotlin.String){} +// Public signature: /plusAssign|-3878040514225458311[0] +operator fun A.plusAssign(s: String): Unit + +// CHECK: +// Mangled name: #remAssign@A(kotlin.String){} +// Public signature: /remAssign|-6176434065111215580[0] +operator fun A.remAssign(s: String): Unit + +// CHECK: +// Mangled name: #testProperty(){} +// Public signature: /testProperty|5285658686723604291[0] +fun testProperty(): Unit + +// CHECK: +// Mangled name: #testVariable(){} +// Public signature: /testVariable|660968387512033895[0] +fun testVariable(): Unit + +// CHECK: +// Mangled name: #timesAssign@A(kotlin.String){} +// Public signature: /timesAssign|-8299603771166721739[0] +operator fun A.timesAssign(s: String): Unit + diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.sig.kt.txt b/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.sig.kt.txt new file mode 100644 index 00000000000..359d3573e25 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.sig.kt.txt @@ -0,0 +1,44 @@ +// CHECK: +// Mangled name: Host +// Public signature: /Host|null[0] +class Host { + // CHECK: + // Mangled name: Host#(){} + // Public signature: /Host.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Host#plusAssign(kotlin.Int){} + // Public signature: /Host.plusAssign|3258359553712471205[0] + operator fun plusAssign(x: Int): Unit + + // CHECK: + // Mangled name: Host#test1(){} + // Public signature: /Host.test1|4297044443957252634[0] + fun test1(): Unit + +} + +// CHECK JVM_IR: +// Mangled name: #foo(){}Host +// Public signature: /foo|-9155687047523720482[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo(){} +// Public signature: /foo|-1041209573719867811[0] +fun foo(): Host + +// CHECK: +// Mangled name: #test2@Host(){} +// Public signature: /test2|-8326697418267123126[0] +fun Host.test2(): Unit + +// CHECK: +// Mangled name: #test3(){} +// Public signature: /test3|-3759735065270951803[0] +fun test3(): Unit + +// CHECK: +// Mangled name: #test4(kotlin.Function0){} +// Public signature: /test4|1361778723589440005[0] +fun test4(a: Function0): Unit + diff --git a/compiler/testData/ir/irText/expressions/badBreakContinue.sig.kt.txt b/compiler/testData/ir/irText/expressions/badBreakContinue.sig.kt.txt new file mode 100644 index 00000000000..2931e8ccb5e --- /dev/null +++ b/compiler/testData/ir/irText/expressions/badBreakContinue.sig.kt.txt @@ -0,0 +1,20 @@ +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +fun test1(): Unit + +// CHECK: +// Mangled name: #test2(){} +// Public signature: /test2|4279114864133353152[0] +fun test2(): Unit + +// CHECK: +// Mangled name: #test3(){} +// Public signature: /test3|-3759735065270951803[0] +fun test3(): Unit + +// CHECK: +// Mangled name: #test4(){} +// Public signature: /test4|5588455914500386239[0] +fun test4(): Unit + diff --git a/compiler/testData/ir/irText/expressions/badInlinedBreakContinue.sig.kt.txt b/compiler/testData/ir/irText/expressions/badInlinedBreakContinue.sig.kt.txt new file mode 100644 index 00000000000..65354872e31 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/badInlinedBreakContinue.sig.kt.txt @@ -0,0 +1,60 @@ +// CHECK: +// Mangled name: #bar(kotlin.Function0;kotlin.Function0){} +// Public signature: /bar|1436837239648519468[0] +inline fun bar(block1: Function0, noinline block2: Function0): Unit + +// CHECK: +// Mangled name: #baz(kotlin.Function0){} +// Public signature: /baz|-1086471891001796248[0] +inline fun baz(crossinline block: Function0): Unit + +// CHECK: +// Mangled name: #foo(kotlin.Function0){} +// Public signature: /foo|251397761749529488[0] +inline fun foo(block: Function0): Unit + +// CHECK: +// Mangled name: #myForEach@kotlin.collections.Iterable<0:0>(kotlin.Function1<0:0,kotlin.Unit>){0§} +// Public signature: /myForEach|-478947801945904451[0] +inline fun Iterable.myForEach(action: Function1): Unit + +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +fun test1(): Unit + +// CHECK: +// Mangled name: #test2(){} +// Public signature: /test2|4279114864133353152[0] +fun test2(): Unit + +// CHECK: +// Mangled name: #test3(){} +// Public signature: /test3|-3759735065270951803[0] +fun test3(): Unit + +// CHECK: +// Mangled name: #test4(){} +// Public signature: /test4|5588455914500386239[0] +fun test4(): Unit + +// CHECK: +// Mangled name: #test5(){} +// Public signature: /test5|-2461239215881954159[0] +fun test5(): Unit + +// CHECK: +// Mangled name: #test6(){} +// Public signature: /test6|-6357717956567725919[0] +fun test6(): Unit + +// CHECK: +// Mangled name: #test7(){} +// Public signature: /test7|-8173197202779127520[0] +fun test7(): Unit + +// CHECK: +// Mangled name: #test8(){} +// Public signature: /test8|70876202459738419[0] +fun test8(): Unit + diff --git a/compiler/testData/ir/irText/expressions/bangbang.sig.kt.txt b/compiler/testData/ir/irText/expressions/bangbang.sig.kt.txt new file mode 100644 index 00000000000..ac8d155938e --- /dev/null +++ b/compiler/testData/ir/irText/expressions/bangbang.sig.kt.txt @@ -0,0 +1,34 @@ +// CHECK JVM_IR: +// Mangled name: #test1(kotlin.Any?){}kotlin.Any +// Public signature: /test1|3740103800770013069[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1(kotlin.Any?){} +// Public signature: /test1|5022087227201313016[0] +fun test1(a: Any?): Any + +// CHECK JVM_IR: +// Mangled name: #test2(kotlin.Any?){}kotlin.Int +// Public signature: /test2|5851677675624690854[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2(kotlin.Any?){} +// Public signature: /test2|7269867005815420933[0] +fun test2(a: Any?): Int + +// CHECK JVM_IR: +// Mangled name: #test3(0:0){0§}0:0 +// Public signature: /test3|6230015698608081924[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3(0:0){0§} +// Public signature: /test3|-7928313088684974141[0] +fun test3(a: X): (X & Any) + +// CHECK: +// Mangled name: #test4(0:0){0§} +// Public signature: /test4|5293645353028387515[0] +fun test4(a: X): Unit + +// CHECK: +// Mangled name: #useString(kotlin.String){} +// Public signature: /useString|2275790659251057343[0] +fun useString(s: String): Unit + diff --git a/compiler/testData/ir/irText/expressions/booleanConstsInAndAndOrOr.sig.kt.txt b/compiler/testData/ir/irText/expressions/booleanConstsInAndAndOrOr.sig.kt.txt new file mode 100644 index 00000000000..317d35b43e1 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/booleanConstsInAndAndOrOr.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #test1(kotlin.Boolean){} +// Public signature: /test1|-5145024389903460958[0] +fun test1(b: Boolean): Unit + +// CHECK: +// Mangled name: #test2(kotlin.Boolean){} +// Public signature: /test2|-1465977587350129281[0] +fun test2(b: Boolean): Unit + diff --git a/compiler/testData/ir/irText/expressions/booleanOperators.sig.kt.txt b/compiler/testData/ir/irText/expressions/booleanOperators.sig.kt.txt new file mode 100644 index 00000000000..cb05c571d0d --- /dev/null +++ b/compiler/testData/ir/irText/expressions/booleanOperators.sig.kt.txt @@ -0,0 +1,32 @@ +// CHECK JVM_IR: +// Mangled name: #test1(kotlin.Boolean;kotlin.Boolean){}kotlin.Boolean +// Public signature: /test1|1784310317697180459[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1(kotlin.Boolean;kotlin.Boolean){} +// Public signature: /test1|4334636876570982581[0] +fun test1(a: Boolean, b: Boolean): Boolean + +// CHECK JVM_IR: +// Mangled name: #test1x(kotlin.Boolean;kotlin.Boolean){}kotlin.Boolean +// Public signature: /test1x|-1515408322066060577[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1x(kotlin.Boolean;kotlin.Boolean){} +// Public signature: /test1x|5571934274519213675[0] +fun test1x(a: Boolean, b: Boolean): Boolean + +// CHECK JVM_IR: +// Mangled name: #test2(kotlin.Boolean;kotlin.Boolean){}kotlin.Boolean +// Public signature: /test2|799203320988960255[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2(kotlin.Boolean;kotlin.Boolean){} +// Public signature: /test2|7186870617663885862[0] +fun test2(a: Boolean, b: Boolean): Boolean + +// CHECK JVM_IR: +// Mangled name: #test2x(kotlin.Boolean;kotlin.Boolean){}kotlin.Boolean +// Public signature: /test2x|-4460874089779287126[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2x(kotlin.Boolean;kotlin.Boolean){} +// Public signature: /test2x|-6733438950512439356[0] +fun test2x(a: Boolean, b: Boolean): Boolean + diff --git a/compiler/testData/ir/irText/expressions/boundCallableReferences.kt b/compiler/testData/ir/irText/expressions/boundCallableReferences.kt index 6ceef2eb444..74862ab22a4 100644 --- a/compiler/testData/ir/irText/expressions/boundCallableReferences.kt +++ b/compiler/testData/ir/irText/expressions/boundCallableReferences.kt @@ -1,4 +1,9 @@ // 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/boundCallableReferences.sig.kt.txt b/compiler/testData/ir/irText/expressions/boundCallableReferences.sig.kt.txt new file mode 100644 index 00000000000..bdb895d8483 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/boundCallableReferences.sig.kt.txt @@ -0,0 +1,69 @@ +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: KFunction0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KFunction0 + // Public signature: /test1.|-3212001184270190599[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test1.|-5735092642142423279[0] + get + +// CHECK: +// Mangled name: {}test2 +// Public signature: /test2|2517758057000911509[0] +val test2: KProperty0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KProperty0 + // Public signature: /test2.|7095906335176274261[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test2.|-5218942532816206869[0] + get + +// CHECK: +// Mangled name: {}test3 +// Public signature: /test3|7677556066983021166[0] +val test3: KFunction0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KFunction0 + // Public signature: /test3.|-4039299570509212380[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test3.|-7333791615083236686[0] + get + +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A { + // CHECK: + // Mangled name: A{}bar + // Public signature: /A.bar|-7864284097863469857[0] + val bar: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.bar.|-7403724005139201014[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.bar.|6880642144337645699[0] + get + + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: A#foo(){} + // Public signature: /A.foo|-1041209573719867811[0] + fun foo(): Unit + +} + +// CHECK: +// Mangled name: #qux@A(){} +// Public signature: /qux|-6354945730448165600[0] +fun A.qux(): Unit + diff --git a/compiler/testData/ir/irText/expressions/boxOk.sig.kt.txt b/compiler/testData/ir/irText/expressions/boxOk.sig.kt.txt new file mode 100644 index 00000000000..db9fda4185d --- /dev/null +++ b/compiler/testData/ir/irText/expressions/boxOk.sig.kt.txt @@ -0,0 +1,8 @@ +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +// CHECK JS_IR NATIVE: +// Mangled name: #box(){} +// Public signature: /box|2173511048851971368[0] +fun box(): String + diff --git a/compiler/testData/ir/irText/expressions/breakContinue.sig.kt.txt b/compiler/testData/ir/irText/expressions/breakContinue.sig.kt.txt new file mode 100644 index 00000000000..358119907bd --- /dev/null +++ b/compiler/testData/ir/irText/expressions/breakContinue.sig.kt.txt @@ -0,0 +1,15 @@ +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +fun test1(): Unit + +// CHECK: +// Mangled name: #test2(){} +// Public signature: /test2|4279114864133353152[0] +fun test2(): Unit + +// CHECK: +// Mangled name: #test3(){} +// Public signature: /test3|-3759735065270951803[0] +fun test3(): Unit + diff --git a/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.sig.kt.txt b/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.sig.kt.txt new file mode 100644 index 00000000000..0c2122df4dc --- /dev/null +++ b/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.sig.kt.txt @@ -0,0 +1,25 @@ +// CHECK: +// Mangled name: #test1(kotlin.Boolean?){} +// Public signature: /test1|-614655814357645647[0] +fun test1(c: Boolean?): Unit + +// CHECK: +// Mangled name: #test2(kotlin.Boolean?){} +// Public signature: /test2|433529625541321478[0] +fun test2(c: Boolean?): Unit + +// CHECK: +// Mangled name: #test3(kotlin.collections.List?){} +// Public signature: /test3|7517805814041019716[0] +fun test3(ss: List?): Unit + +// CHECK: +// Mangled name: #test4(kotlin.collections.List?){} +// Public signature: /test4|1371726193385654339[0] +fun test4(ss: List?): Unit + +// CHECK: +// Mangled name: #test5(){} +// Public signature: /test5|-2461239215881954159[0] +fun test5(): Unit + diff --git a/compiler/testData/ir/irText/expressions/breakContinueInWhen.sig.kt.txt b/compiler/testData/ir/irText/expressions/breakContinueInWhen.sig.kt.txt new file mode 100644 index 00000000000..29171e8abf7 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/breakContinueInWhen.sig.kt.txt @@ -0,0 +1,30 @@ +// CHECK: +// Mangled name: #testBreakDoWhile(){} +// Public signature: /testBreakDoWhile|-1704674514591918334[0] +fun testBreakDoWhile(): Unit + +// CHECK: +// Mangled name: #testBreakFor(){} +// Public signature: /testBreakFor|-7772840210562213149[0] +fun testBreakFor(): Unit + +// CHECK: +// Mangled name: #testBreakWhile(){} +// Public signature: /testBreakWhile|3882710933639253522[0] +fun testBreakWhile(): Unit + +// CHECK: +// Mangled name: #testContinueDoWhile(){} +// Public signature: /testContinueDoWhile|-1939470436794612956[0] +fun testContinueDoWhile(): Unit + +// CHECK: +// Mangled name: #testContinueFor(){} +// Public signature: /testContinueFor|-6520729324717708312[0] +fun testContinueFor(): Unit + +// CHECK: +// Mangled name: #testContinueWhile(){} +// Public signature: /testContinueWhile|2151596509430082894[0] +fun testContinueWhile(): Unit + diff --git a/compiler/testData/ir/irText/expressions/builtinOperators.kt b/compiler/testData/ir/irText/expressions/builtinOperators.kt index 5155c49588c..57087f30416 100644 --- a/compiler/testData/ir/irText/expressions/builtinOperators.kt +++ b/compiler/testData/ir/irText/expressions/builtinOperators.kt @@ -1,4 +1,8 @@ // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR +// ^ KT-57433 + // FILE: test.kt package test diff --git a/compiler/testData/ir/irText/expressions/builtinOperators.sig.kt.txt b/compiler/testData/ir/irText/expressions/builtinOperators.sig.kt.txt new file mode 100644 index 00000000000..642a2902874 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/builtinOperators.sig.kt.txt @@ -0,0 +1,7 @@ +package test + +// CHECK: +// Mangled name: test#callBuiltinFunctions(kotlin.Int;kotlin.Int){} +// Public signature: test/callBuiltinFunctions|7396310918419190407[0] +fun callBuiltinFunctions(a: Int, b: Int): Unit + diff --git a/compiler/testData/ir/irText/expressions/callWithReorderedArguments.sig.kt.txt b/compiler/testData/ir/irText/expressions/callWithReorderedArguments.sig.kt.txt new file mode 100644 index 00000000000..b6060ece8f2 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callWithReorderedArguments.sig.kt.txt @@ -0,0 +1,42 @@ +// CHECK: +// Mangled name: #foo(kotlin.Int;kotlin.Int){} +// Public signature: /foo|-5894601321690082118[0] +fun foo(a: Int, b: Int): Unit + +// CHECK JVM_IR: +// Mangled name: #noReorder1(){}kotlin.Int +// Public signature: /noReorder1|8490746646819369513[0] +// CHECK JS_IR NATIVE: +// Mangled name: #noReorder1(){} +// Public signature: /noReorder1|2041802031203244090[0] +fun noReorder1(): Int + +// CHECK JVM_IR: +// Mangled name: #noReorder2(){}kotlin.Int +// Public signature: /noReorder2|1318805316632640434[0] +// CHECK JS_IR NATIVE: +// Mangled name: #noReorder2(){} +// Public signature: /noReorder2|-4183322961147077454[0] +fun noReorder2(): Int + +// CHECK JVM_IR: +// Mangled name: #reordered1(){}kotlin.Int +// Public signature: /reordered1|-3373748716222518893[0] +// CHECK JS_IR NATIVE: +// Mangled name: #reordered1(){} +// Public signature: /reordered1|3363717619618452144[0] +fun reordered1(): Int + +// CHECK JVM_IR: +// Mangled name: #reordered2(){}kotlin.Int +// Public signature: /reordered2|-1663811084556182906[0] +// CHECK JS_IR NATIVE: +// Mangled name: #reordered2(){} +// Public signature: /reordered2|8960515960707640681[0] +fun reordered2(): Int + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.sig.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.sig.kt.txt new file mode 100644 index 00000000000..74415d86f5b --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.sig.kt.txt @@ -0,0 +1,46 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: #extensionBoth@C(kotlin.Int;kotlin.String;kotlin.Array...){} +// Public signature: /extensionBoth|-2642733408340966988[0] +fun C.extensionBoth(i: Int, s: String, vararg t: String): Unit + +// CHECK: +// Mangled name: #extensionDefault@C(kotlin.Int;kotlin.String){} +// Public signature: /extensionDefault|-2068501962137011033[0] +fun C.extensionDefault(i: Int, s: String): Unit + +// CHECK: +// Mangled name: #extensionVararg@C(kotlin.Int;kotlin.Array...){} +// Public signature: /extensionVararg|6428350929057458618[0] +fun C.extensionVararg(i: Int, vararg s: String): Unit + +// CHECK: +// Mangled name: #testExtensionBoth(){} +// Public signature: /testExtensionBoth|-9046612088279185180[0] +fun testExtensionBoth(): Unit + +// CHECK: +// Mangled name: #testExtensionDefault(){} +// Public signature: /testExtensionDefault|412398110121818525[0] +fun testExtensionDefault(): Unit + +// CHECK: +// Mangled name: #testExtensionVararg(){} +// Public signature: /testExtensionVararg|3578031816468213112[0] +fun testExtensionVararg(): Unit + +// CHECK: +// Mangled name: #use(kotlin.Function2){} +// Public signature: /use|-4652353913536286192[0] +fun use(f: @ExtensionFunctionType Function2): Unit + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/adaptedWithCoercionToUnit.sig.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/adaptedWithCoercionToUnit.sig.kt.txt new file mode 100644 index 00000000000..afe61fbfb2b --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callableReferences/adaptedWithCoercionToUnit.sig.kt.txt @@ -0,0 +1,54 @@ +// CHECK JVM_IR: +// Mangled name: #fn0(){}kotlin.Int +// Public signature: /fn0|-3364598877649792431[0] +// CHECK JS_IR NATIVE: +// Mangled name: #fn0(){} +// Public signature: /fn0|-2043665824144278007[0] +fun fn0(): Int + +// CHECK JVM_IR: +// Mangled name: #fn1(kotlin.Int){}kotlin.Int +// Public signature: /fn1|-2634385227090463147[0] +// CHECK JS_IR NATIVE: +// Mangled name: #fn1(kotlin.Int){} +// Public signature: /fn1|-2712608382334902272[0] +fun fn1(x: Int): Int + +// CHECK JVM_IR: +// Mangled name: #fnv(kotlin.IntArray...){}kotlin.Int +// Public signature: /fnv|7629192376934713891[0] +// CHECK JS_IR NATIVE: +// Mangled name: #fnv(kotlin.IntArray...){} +// Public signature: /fnv|2422608309256790418[0] +fun fnv(vararg xs: Int): Int + +// CHECK: +// Mangled name: #test0(){} +// Public signature: /test0|-2819007353171228053[0] +fun test0(): Unit + +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +fun test1(): Unit + +// CHECK: +// Mangled name: #testV0(){} +// Public signature: /testV0|-8921284502747635947[0] +fun testV0(): Unit + +// CHECK: +// Mangled name: #testV1(){} +// Public signature: /testV1|3830223062623947245[0] +fun testV1(): Unit + +// CHECK: +// Mangled name: #useUnit0(kotlin.Function0){} +// Public signature: /useUnit0|5614361260644496254[0] +fun useUnit0(fn: Function0): Unit + +// CHECK: +// Mangled name: #useUnit1(kotlin.Function1){} +// Public signature: /useUnit1|-3238349347224683286[0] +fun useUnit1(fn: Function1): Unit + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/boundInlineAdaptedReference.kt b/compiler/testData/ir/irText/expressions/callableReferences/boundInlineAdaptedReference.kt index 3282a8c221f..60f7e41fac7 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/boundInlineAdaptedReference.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/boundInlineAdaptedReference.kt @@ -1,3 +1,6 @@ +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR +// ^ KT-57433 + package test inline fun foo(x: () -> Unit) {} diff --git a/compiler/testData/ir/irText/expressions/callableReferences/boundInlineAdaptedReference.sig.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/boundInlineAdaptedReference.sig.kt.txt new file mode 100644 index 00000000000..e378005cff3 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callableReferences/boundInlineAdaptedReference.sig.kt.txt @@ -0,0 +1,20 @@ +package test + +// CHECK: +// Mangled name: test#foo(kotlin.Function0){} +// Public signature: test/foo|251397761749529488[0] +inline fun foo(x: Function0): Unit + +// CHECK JVM_IR: +// Mangled name: test#id@kotlin.String(kotlin.String;kotlin.IntArray...){}kotlin.String +// Public signature: test/id|-8103162913932729860[0] +// CHECK JS_IR NATIVE: +// Mangled name: test#id@kotlin.String(kotlin.String;kotlin.IntArray...){} +// Public signature: test/id|58840929144244075[0] +fun String.id(s: String, vararg xs: Int): String + +// CHECK: +// Mangled name: test#test(){} +// Public signature: test/test|6620506149988718649[0] +fun test(): Unit + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.kt b/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.kt index d6d807a168a..dc782ef7b3b 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.kt @@ -1,4 +1,8 @@ // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR +// ^ KT-57433, KT-57429 + package test class Foo { diff --git a/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.sig.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.sig.kt.txt new file mode 100644 index 00000000000..9f33c1012d4 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.sig.kt.txt @@ -0,0 +1,64 @@ +package test + +// CHECK: +// Mangled name: test.Foo +// Public signature: test/Foo|null[0] +class Foo { + // CHECK: + // Mangled name: test.Foo.Inner + // Public signature: test/Foo.Inner|null[0] + inner class Inner

{ + // CHECK: + // Mangled name: test.Foo.Inner{}a + // Public signature: test/Foo.Inner.a|-1200697420457237799[0] + val a: T + // CHECK JVM_IR: + // Mangled name: test.Foo.Inner#(){}2:0 + // Public signature: test/Foo.Inner.a.|6634660852321063487[0] + // CHECK JS_IR NATIVE: + // Mangled name: test.Foo.Inner#(){} + // Public signature: test/Foo.Inner.a.|6785176174175479410[0] + get + + // CHECK: + // Mangled name: test.Foo.Inner{}b + // Public signature: test/Foo.Inner.b|772347207915745207[0] + val b: P + // CHECK JVM_IR: + // Mangled name: test.Foo.Inner#(){}1:0 + // Public signature: test/Foo.Inner.b.|-8930371436958509614[0] + // CHECK JS_IR NATIVE: + // Mangled name: test.Foo.Inner#(){} + // Public signature: test/Foo.Inner.b.|812004636995167743[0] + get + + // CHECK: + // Mangled name: test.Foo.Inner#(2:0;1:0){} + // Public signature: test/Foo.Inner.|-2512702059187080850[0] + constructor(a: T, b: P) /* primary */ + + } + + // CHECK: + // Mangled name: test.Foo#(){} + // Public signature: test/Foo.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: test#box(){}kotlin.String +// Public signature: test/box|-9347091776561469[0] +// CHECK JS_IR NATIVE: +// Mangled name: test#box(){} +// Public signature: test/box|2173511048851971368[0] +fun box(): String + +// CHECK JVM_IR: +// Mangled name: test#foo(0:0;0:1;kotlin.Function2<0:0,0:1,test.Foo.Inner<0:1,0:0>>){0§;1§}test.Foo.Inner<0:1,0:0> +// Public signature: test/foo|-4791591590952018519[0] +// CHECK JS_IR NATIVE: +// Mangled name: test#foo(0:0;0:1;kotlin.Function2<0:0,0:1,test.Foo.Inner<0:1,0:0>>){0§;1§} +// Public signature: test/foo|-2625863985883503743[0] +inline fun foo(a: A, b: B, x: Function2>): Inner + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.sig.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.sig.kt.txt new file mode 100644 index 00000000000..0bfdf82ce02 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.sig.kt.txt @@ -0,0 +1,110 @@ +// CHECK: +// Mangled name: IFoo +// Public signature: /IFoo|null[0] +fun interface IFoo { + + // CHECK: + // Mangled name: IFoo#foo(kotlin.Int){} + // Public signature: /IFoo.foo|-104159190164110731[0] + abstract fun foo(i: Int): Unit + +} + +// CHECK: +// Mangled name: IFoo2 +// Public signature: /IFoo2|null[0] +fun interface IFoo2 : IFoo { + + // CHECK: + // Mangled name: IFoo2#foo(kotlin.Int){} + // Public signature: /IFoo2.foo|-104159190164110731[0] + abstract /* fake */ override fun foo(i: Int): Unit + +} + +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +object A { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + private constructor() /* primary */ + +} + +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +object B { + // CHECK: + // Mangled name: B#(){} + // Public signature: /B.|-5645683436151566731[0] + private constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #get@A(IFoo){}kotlin.Int +// Public signature: /get|-3861638864893341854[0] +// CHECK JS_IR NATIVE: +// Mangled name: #get@A(IFoo){} +// Public signature: /get|-2254127918202281135[0] +operator fun A.get(i: IFoo): Int + +// CHECK JVM_IR: +// Mangled name: #get@B(IFoo){}kotlin.Int +// Public signature: /get|-7877609025632018899[0] +// CHECK JS_IR NATIVE: +// Mangled name: #get@B(IFoo){} +// Public signature: /get|4390292684640882975[0] +operator fun B.get(i: IFoo): Int + +// CHECK: +// Mangled name: #set@A(IFoo;kotlin.Int){} +// Public signature: /set|2215990406215766902[0] +operator fun A.set(i: IFoo, newValue: Int): Unit + +// CHECK: +// Mangled name: #set@B(IFoo2;kotlin.Int){} +// Public signature: /set|-3309277558159597845[0] +operator fun B.set(i: IFoo2, newValue: Int): Unit + +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +fun test1(): Unit + +// CHECK: +// Mangled name: #test2(){} +// Public signature: /test2|4279114864133353152[0] +fun test2(): Unit + +// CHECK: +// Mangled name: #test3(kotlin.Function1){} +// Public signature: /test3|-2027394029153051749[0] +fun test3(fn: Function1): Unit + +// CHECK: +// Mangled name: #test4(kotlin.Function1){} +// Public signature: /test4|5380102774610726252[0] +fun test4(fn: Function1): Unit + +// CHECK: +// Mangled name: #test5(kotlin.Any){} +// Public signature: /test5|4504681808078971124[0] +fun test5(a: Any): Unit + +// CHECK: +// Mangled name: #test6(kotlin.Any){} +// Public signature: /test6|-7590017673454141671[0] +fun test6(a: Any): Unit + +// CHECK JVM_IR: +// Mangled name: #withVararg(kotlin.IntArray...){}kotlin.Int +// Public signature: /withVararg|2262699225692856772[0] +// CHECK JS_IR NATIVE: +// Mangled name: #withVararg(kotlin.IntArray...){} +// Public signature: /withVararg|2511032413940817176[0] +fun withVararg(vararg xs: Int): Int + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.sig.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.sig.kt.txt new file mode 100644 index 00000000000..021e4a6afe6 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.sig.kt.txt @@ -0,0 +1,65 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C#(kotlin.IntArray...){} + // Public signature: /C.|3304157197881351514[0] + constructor(vararg xs: Int) /* primary */ + +} + +// CHECK: +// Mangled name: Outer +// Public signature: /Outer|null[0] +class Outer { + // CHECK: + // Mangled name: Outer.Inner + // Public signature: /Outer.Inner|null[0] + inner class Inner { + // CHECK: + // Mangled name: Outer.Inner#(kotlin.IntArray...){} + // Public signature: /Outer.Inner.|3304157197881351514[0] + constructor(vararg xs: Int) /* primary */ + + } + + // CHECK: + // Mangled name: Outer#(){} + // Public signature: /Outer.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #testConstructor(){}kotlin.Any +// Public signature: /testConstructor|-8265230471442733237[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testConstructor(){} +// Public signature: /testConstructor|2230958656416821461[0] +fun testConstructor(): Any + +// CHECK JVM_IR: +// Mangled name: #testInnerClassConstructor(Outer){}kotlin.Any +// Public signature: /testInnerClassConstructor|7325530570703424818[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testInnerClassConstructor(Outer){} +// Public signature: /testInnerClassConstructor|8390561746269240962[0] +fun testInnerClassConstructor(outer: Outer): Any + +// CHECK JVM_IR: +// Mangled name: #testInnerClassConstructorCapturingOuter(){}kotlin.Any +// Public signature: /testInnerClassConstructorCapturingOuter|-5884857333600375021[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testInnerClassConstructorCapturingOuter(){} +// Public signature: /testInnerClassConstructorCapturingOuter|4579094401940051727[0] +fun testInnerClassConstructorCapturingOuter(): Any + +// CHECK JVM_IR: +// Mangled name: #use(kotlin.Function1){}kotlin.Any +// Public signature: /use|1574437315632336940[0] +// CHECK JS_IR NATIVE: +// Mangled name: #use(kotlin.Function1){} +// Public signature: /use|-5469365388493164049[0] +fun use(fn: Function1): Any + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/funWithDefaultParametersAsKCallableStar.sig.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/funWithDefaultParametersAsKCallableStar.sig.kt.txt new file mode 100644 index 00000000000..c87134bf658 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callableReferences/funWithDefaultParametersAsKCallableStar.sig.kt.txt @@ -0,0 +1,72 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C{}x + // Public signature: /C.x|-8060530855978347579[0] + val x: String + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.String + // Public signature: /C.x.|316111172223894646[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: C#(kotlin.String){} + // Public signature: /C.|1280618353163213788[0] + constructor(x: String) /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #defaultsOnly(kotlin.String){}kotlin.Int +// Public signature: /defaultsOnly|4494765395390675935[0] +// CHECK JS_IR NATIVE: +// Mangled name: #defaultsOnly(kotlin.String){} +// Public signature: /defaultsOnly|-7244666068765377321[0] +fun defaultsOnly(x: String): Int + +// CHECK JVM_IR: +// Mangled name: #regularAndDefaults(kotlin.String;kotlin.String){}kotlin.Int +// Public signature: /regularAndDefaults|5576798369123640728[0] +// CHECK JS_IR NATIVE: +// Mangled name: #regularAndDefaults(kotlin.String;kotlin.String){} +// Public signature: /regularAndDefaults|-7839345972361254384[0] +fun regularAndDefaults(x1: String, x2: String): Int + +// CHECK: +// Mangled name: #testCtorStar(){} +// Public signature: /testCtorStar|-4590755602285114659[0] +fun testCtorStar(): Unit + +// CHECK: +// Mangled name: #testDefaultsOnlyStar(){} +// Public signature: /testDefaultsOnlyStar|6030377692452868527[0] +fun testDefaultsOnlyStar(): Unit + +// CHECK: +// Mangled name: #testRegularAndDefaultsStar(){} +// Public signature: /testRegularAndDefaultsStar|-2047981816963711456[0] +fun testRegularAndDefaultsStar(): Unit + +// CHECK: +// Mangled name: #testVarargsStar(){} +// Public signature: /testVarargsStar|7637113077643006205[0] +fun testVarargsStar(): Unit + +// CHECK: +// Mangled name: #useKCallableStar(kotlin.reflect.KCallable<*>){} +// Public signature: /useKCallableStar|-9105337902957696086[0] +fun useKCallableStar(fn: KCallable<*>): Unit + +// CHECK JVM_IR: +// Mangled name: #varargs(kotlin.Array...){}kotlin.Int +// Public signature: /varargs|-1029748167171123081[0] +// CHECK JS_IR NATIVE: +// Mangled name: #varargs(kotlin.Array...){} +// Public signature: /varargs|1577881396515650516[0] +fun varargs(vararg xs: String): Int + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.kt b/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.kt index d76e23d033a..7e915b754c3 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.kt @@ -1,3 +1,6 @@ +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429, KT-57436 + open class L(val ll: LL) class Rec(val rt: T) @@ -13,4 +16,4 @@ fun Rec.fn(): L { return foo2(rt, rt, ::FLocal) } -fun foo2(t1: T1, t2: T2, bb: (T1, T2) -> R): R = bb(t1, t2) \ No newline at end of file +fun foo2(t1: T1, t2: T2, bb: (T1, T2) -> R): R = bb(t1, t2) diff --git a/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.sig.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.sig.kt.txt new file mode 100644 index 00000000000..095a5361d42 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.sig.kt.txt @@ -0,0 +1,74 @@ +// CHECK: +// Mangled name: L +// Public signature: /L|null[0] +open class L { + // CHECK: + // Mangled name: L{}ll + // Public signature: /L.ll|-6205844342928411776[0] + val ll: LL + // CHECK JVM_IR: + // Mangled name: L#(){}1:0 + // Public signature: /L.ll.|3292228176841932804[0] + // CHECK JS_IR NATIVE: + // Mangled name: L#(){} + // Public signature: /L.ll.|-3038615916069329440[0] + get + + // CHECK: + // Mangled name: L#(1:0){} + // Public signature: /L.|-8731461708390519279[0] + constructor(ll: LL) /* primary */ + +} + +// CHECK: +// Mangled name: Rec +// Public signature: /Rec|null[0] +class Rec { + // CHECK: + // Mangled name: Rec{}rt + // Public signature: /Rec.rt|-2445570895924930609[0] + val rt: T + // CHECK JVM_IR: + // Mangled name: Rec#(){}1:0 + // Public signature: /Rec.rt.|4833941673195700440[0] + // CHECK JS_IR NATIVE: + // Mangled name: Rec#(){} + // Public signature: /Rec.rt.|2938093614484966158[0] + get + + // CHECK: + // Mangled name: Rec#(1:0){} + // Public signature: /Rec.|-8731461708390519279[0] + constructor(rt: T) /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #fn@Rec<0:0>(){0§}L<0:0> +// Public signature: /fn|458419256100465624[0] +// CHECK JS_IR NATIVE: +// Mangled name: #fn@Rec<0:0>(){0§} +// Public signature: /fn|-2196095281162048366[0] +fun Rec.fn(): L + +// CHECK JVM_IR: +// Mangled name: #foo2(0:0;0:1;kotlin.Function2<0:0,0:1,0:2>){0§;1§;2§}0:2 +// Public signature: /foo2|-6186734139379933811[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo2(0:0;0:1;kotlin.Function2<0:0,0:1,0:2>){0§;1§;2§} +// Public signature: /foo2|6240807387010061447[0] +fun foo2(t1: T1, t2: T2, bb: Function2): R + +// CHECK: +// Mangled name: @Rec<0:0>{0§}p +// Public signature: /p|1337333823224750046[0] +val Rec.p: L + // CHECK JVM_IR: + // Mangled name: #@Rec<0:0>(){0§}L<0:0> + // Public signature: /p.|-439714386562020387[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@Rec<0:0>(){0§} + // Public signature: /p.|-3789410829860408186[0] + get(): L + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/genericMember.kt b/compiler/testData/ir/irText/expressions/callableReferences/genericMember.kt index 3e1547167e1..c303a0f8a9b 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/genericMember.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/genericMember.kt @@ -1,8 +1,13 @@ // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: JS_IR +// MUTE_SIGNATURE_COMPARISON_K2: NATIVE +// ^ KT-57818 + class A { fun foo() {} val bar = 42 } val test1 = A::foo -val test2 = A::bar \ No newline at end of file +val test2 = A::bar diff --git a/compiler/testData/ir/irText/expressions/callableReferences/genericMember.sig.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/genericMember.sig.kt.txt new file mode 100644 index 00000000000..f2ec3ffdb8d --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callableReferences/genericMember.sig.kt.txt @@ -0,0 +1,52 @@ +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: KFunction1, Unit> + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KFunction1,kotlin.Unit> + // Public signature: /test1.|-8244328064209217442[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test1.|-5735092642142423279[0] + get + +// CHECK: +// Mangled name: {}test2 +// Public signature: /test2|2517758057000911509[0] +val test2: KProperty1, Int> + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KProperty1,kotlin.Int> + // Public signature: /test2.|7010452964682738138[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test2.|-5218942532816206869[0] + get + +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A { + // CHECK: + // Mangled name: A{}bar + // Public signature: /A.bar|-7864284097863469857[0] + val bar: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.bar.|-7403724005139201014[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.bar.|6880642144337645699[0] + get + + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: A#foo(){} + // Public signature: /A.foo|-1041209573719867811[0] + fun foo(): Unit + +} + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.kt b/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.kt index ff3f18b84d7..ba4f7c557e0 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.kt @@ -1,4 +1,8 @@ // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57433 + package test import test.Foo.a @@ -12,4 +16,4 @@ object Foo { val test1 = ::a val test1a = Foo::a val test2 = ::foo -val test2a = Foo::foo \ No newline at end of file +val test2a = Foo::foo diff --git a/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.sig.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.sig.kt.txt new file mode 100644 index 00000000000..c92290d91a5 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.sig.kt.txt @@ -0,0 +1,81 @@ +package test + +// CHECK: +// Mangled name: test{}test1 +// Public signature: test/test1|6005685442305498193[0] +val test1: KProperty0 + // CHECK JVM_IR: + // Mangled name: test#(){}kotlin.reflect.KProperty0 + // Public signature: test/test1.|-8479602068466013638[0] + // CHECK JS_IR NATIVE: + // Mangled name: test#(){} + // Public signature: test/test1.|-5735092642142423279[0] + get + +// CHECK: +// Mangled name: test{}test1a +// Public signature: test/test1a|-8868958804106173806[0] +val test1a: KProperty0 + // CHECK JVM_IR: + // Mangled name: test#(){}kotlin.reflect.KProperty0 + // Public signature: test/test1a.|-8261804722444217546[0] + // CHECK JS_IR NATIVE: + // Mangled name: test#(){} + // Public signature: test/test1a.|-4215972589981113049[0] + get + +// CHECK: +// Mangled name: test{}test2 +// Public signature: test/test2|2517758057000911509[0] +val test2: KFunction0 + // CHECK JVM_IR: + // Mangled name: test#(){}kotlin.reflect.KFunction0 + // Public signature: test/test2.|1526537700116765606[0] + // CHECK JS_IR NATIVE: + // Mangled name: test#(){} + // Public signature: test/test2.|-5218942532816206869[0] + get + +// CHECK: +// Mangled name: test{}test2a +// Public signature: test/test2a|-1407081977148194425[0] +val test2a: KFunction0 + // CHECK JVM_IR: + // Mangled name: test#(){}kotlin.reflect.KFunction0 + // Public signature: test/test2a.|-1352924861862764837[0] + // CHECK JS_IR NATIVE: + // Mangled name: test#(){} + // Public signature: test/test2a.|7164864074197438240[0] + get + +// CHECK: +// Mangled name: test.Foo +// Public signature: test/Foo|null[0] +object Foo { + // CHECK: + // Mangled name: test.Foo{}a + // Public signature: test/Foo.a|-1200697420457237799[0] + val a: String + // CHECK JVM_IR: + // Mangled name: test.Foo#(){}kotlin.String + // Public signature: test/Foo.a.|-6318309956076983327[0] + // CHECK JS_IR NATIVE: + // Mangled name: test.Foo#(){} + // Public signature: test/Foo.a.|6785176174175479410[0] + get + + // CHECK: + // Mangled name: test.Foo#(){} + // Public signature: test/Foo.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: test.Foo#foo(){}kotlin.String + // Public signature: test/Foo.foo|485335955883620819[0] + // CHECK JS_IR NATIVE: + // Mangled name: test.Foo#foo(){} + // Public signature: test/Foo.foo|-1041209573719867811[0] + fun foo(): String + +} + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/kt37131.sig.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/kt37131.sig.kt.txt new file mode 100644 index 00000000000..d2aca41bef6 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callableReferences/kt37131.sig.kt.txt @@ -0,0 +1,55 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C{}x + // Public signature: /C.x|-8060530855978347579[0] + val x: String + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.String + // Public signature: /C.x.|316111172223894646[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: C#(kotlin.String){} + // Public signature: /C.|1280618353163213788[0] + constructor(x: String) /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #foo(kotlin.String){}kotlin.String +// Public signature: /foo|-5534735991146511619[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo(kotlin.String){} +// Public signature: /foo|1351044947738582195[0] +fun foo(x: String): String + +// CHECK JVM_IR: +// Mangled name: #testCtor(){}kotlin.Any +// Public signature: /testCtor|3044873605974435250[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testCtor(){} +// Public signature: /testCtor|3811619636113238850[0] +fun testCtor(): Any + +// CHECK JVM_IR: +// Mangled name: #testFn(){}kotlin.Any +// Public signature: /testFn|-7705393787943646360[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testFn(){} +// Public signature: /testFn|-8314695367743779873[0] +fun testFn(): Any + +// CHECK JVM_IR: +// Mangled name: #use(kotlin.Function0){}kotlin.Any +// Public signature: /use|2706182574849638898[0] +// CHECK JS_IR NATIVE: +// Mangled name: #use(kotlin.Function0){} +// Public signature: /use|-6442695911656516766[0] +fun use(fn: Function0): Any + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/kt46069.sig.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/kt46069.sig.kt.txt new file mode 100644 index 00000000000..535f18725b9 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callableReferences/kt46069.sig.kt.txt @@ -0,0 +1,43 @@ +// CHECK: +// Mangled name: ObjectAssert +// Public signature: /ObjectAssert|null[0] +class ObjectAssert { + // CHECK: + // Mangled name: ObjectAssert#(){} + // Public signature: /ObjectAssert.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: ObjectAssert#describedAs(kotlin.String?;kotlin.Array...){}ObjectAssert<1:0>? + // Public signature: /ObjectAssert.describedAs|2640805776853081848[0] + // CHECK JS_IR NATIVE: + // Mangled name: ObjectAssert#describedAs(kotlin.String?;kotlin.Array...){} + // Public signature: /ObjectAssert.describedAs|-4390537078786909003[0] + fun describedAs(description: String?, vararg args: Any?): ObjectAssert? + +} + +// CHECK: +// Mangled name: Assertions +// Public signature: /Assertions|null[0] +object Assertions { + // CHECK: + // Mangled name: Assertions#(){} + // Public signature: /Assertions.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Assertions#assertThat(0:0){0§}ObjectAssert<0:0> + // Public signature: /Assertions.assertThat|4423159698393343609[0] + // CHECK JS_IR NATIVE: + // Mangled name: Assertions#assertThat(0:0){0§} + // Public signature: /Assertions.assertThat|4526101325959638422[0] + fun assertThat(actual: S): ObjectAssert + +} + +// CHECK: +// Mangled name: #assertNotNull@0:0?(kotlin.String?){0§} +// Public signature: /assertNotNull|-8507040693411793741[0] +fun T?.assertNotNull(description: String?): Unit + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.sig.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.sig.kt.txt new file mode 100644 index 00000000000..b40ebba1c51 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.sig.kt.txt @@ -0,0 +1,124 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: C#bar(){} + // Public signature: /C.bar|496682602797471549[0] + fun bar(): Unit + +} + +// CHECK: +// Mangled name: #foo0(){} +// Public signature: /foo0|854950155582184407[0] +suspend fun foo0(): Unit + +// CHECK: +// Mangled name: #foo1(){} +// Public signature: /foo1|-8639587189244574023[0] +fun foo1(): Unit + +// CHECK: +// Mangled name: #foo2(kotlin.IntArray...){} +// Public signature: /foo2|5922411859677377366[0] +fun foo2(vararg xs: Int): Unit + +// CHECK JVM_IR: +// Mangled name: #foo3(){}kotlin.Int +// Public signature: /foo3|8491530264469693037[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo3(){} +// Public signature: /foo3|-7010019271447432065[0] +fun foo3(): Int + +// CHECK: +// Mangled name: #foo4(kotlin.Int){} +// Public signature: /foo4|2900723419202106229[0] +fun foo4(i: Int): Unit + +// CHECK: +// Mangled name: #fooInt(kotlin.Int){} +// Public signature: /fooInt|-6183432728780744676[0] +fun fooInt(x: Int): Unit + +// CHECK: +// Mangled name: #testLambda(){} +// Public signature: /testLambda|-124997257399938843[0] +fun testLambda(): Unit + +// CHECK: +// Mangled name: #testNestedNullableParam(){} +// Public signature: /testNestedNullableParam|-2012116353768946084[0] +fun testNestedNullableParam(): Unit + +// CHECK: +// Mangled name: #testNoCoversion(){} +// Public signature: /testNoCoversion|-8699135843773409510[0] +fun testNoCoversion(): Unit + +// CHECK: +// Mangled name: #testNullableParam(){} +// Public signature: /testNullableParam|-2995936548663185551[0] +fun testNullableParam(): Unit + +// CHECK: +// Mangled name: #testSuspendPlain(){} +// Public signature: /testSuspendPlain|8964987636066532028[0] +fun testSuspendPlain(): Unit + +// CHECK: +// Mangled name: #testSuspendWithArgs(){} +// Public signature: /testSuspendWithArgs|5693690156127811203[0] +fun testSuspendWithArgs(): Unit + +// CHECK: +// Mangled name: #testWithBoundReceiver(){} +// Public signature: /testWithBoundReceiver|7823514110875059394[0] +fun testWithBoundReceiver(): Unit + +// CHECK: +// Mangled name: #testWithCoercionToUnit(){} +// Public signature: /testWithCoercionToUnit|7796968706461873316[0] +fun testWithCoercionToUnit(): Unit + +// CHECK: +// Mangled name: #testWithDefaults(){} +// Public signature: /testWithDefaults|-448085806147000561[0] +fun testWithDefaults(): Unit + +// CHECK: +// Mangled name: #testWithVararg(){} +// Public signature: /testWithVararg|-4416299807822127184[0] +fun testWithVararg(): Unit + +// CHECK: +// Mangled name: #testWithVarargMapped(){} +// Public signature: /testWithVarargMapped|-7339035095379549066[0] +fun testWithVarargMapped(): Unit + +// CHECK: +// Mangled name: #useSuspend(kotlin.coroutines.SuspendFunction0){} +// Public signature: /useSuspend|60604456614172212[0] +fun useSuspend(fn: SuspendFunction0): Unit + +// CHECK: +// Mangled name: #useSuspendInt(kotlin.coroutines.SuspendFunction1){} +// Public signature: /useSuspendInt|6677445730045728976[0] +fun useSuspendInt(fn: SuspendFunction1): Unit + +// CHECK: +// Mangled name: #useSuspendNestedNullable(kotlin.coroutines.SuspendFunction0?){} +// Public signature: /useSuspendNestedNullable|4549127976714545272[0] +fun useSuspendNestedNullable(fn: SuspendFunction0?): Unit + +// CHECK: +// Mangled name: #useSuspendNullable(kotlin.coroutines.SuspendFunction0?){} +// Public signature: /useSuspendNullable|967374217920293410[0] +fun useSuspendNullable(fn: SuspendFunction0?): Unit + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.kt b/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.kt index 4394fbc63c2..affba97989d 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.kt @@ -1,3 +1,7 @@ +// 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/callableReferences/typeArguments.sig.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.sig.kt.txt new file mode 100644 index 00000000000..04a627dc03e --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callableReferences/typeArguments.sig.kt.txt @@ -0,0 +1,62 @@ +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: Function1 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function1 + // Public signature: /test1.|-2250341495239737904[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test1.|-5735092642142423279[0] + get + +// CHECK: +// Mangled name: {}test2 +// Public signature: /test2|2517758057000911509[0] +val test2: Function1, Unit> + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function1,kotlin.Unit> + // Public signature: /test2.|1660110416035319894[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test2.|-5218942532816206869[0] + get + +// CHECK: +// Mangled name: {}test3 +// Public signature: /test3|7677556066983021166[0] +val test3: Function1 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function1 + // Public signature: /test3.|6318789892361697174[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test3.|-7333791615083236686[0] + get + +// CHECK: +// Mangled name: Host +// Public signature: /Host|null[0] +object Host { + // CHECK: + // Mangled name: Host#(){} + // Public signature: /Host.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK: + // Mangled name: Host#objectMember(0:0){0§} + // Public signature: /Host.objectMember|-2876712893052428879[0] + inline fun objectMember(x: T): Unit + +} + +// CHECK: +// Mangled name: #topLevel1(0:0){0§} +// Public signature: /topLevel1|-1179785015028179967[0] +inline fun topLevel1(x: T): Unit + +// CHECK: +// Mangled name: #topLevel2(kotlin.collections.List<0:0>){0§} +// Public signature: /topLevel2|-3665063920454112526[0] +inline fun topLevel2(x: List): Unit + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.sig.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.sig.kt.txt new file mode 100644 index 00000000000..e085d349ab8 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.sig.kt.txt @@ -0,0 +1,63 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +open class A { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: A#foo(kotlin.IntArray...){}kotlin.Int + // Public signature: /A.foo|-3529930544137592433[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#foo(kotlin.IntArray...){} + // Public signature: /A.foo|112986931506401688[0] + open fun foo(vararg xs: Int): Int + +} + +// CHECK: +// Mangled name: Obj +// Public signature: /Obj|null[0] +object Obj : A { + // CHECK: + // Mangled name: Obj#(){} + // Public signature: /Obj.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Obj#foo(kotlin.IntArray...){}kotlin.Int + // Public signature: /Obj.foo|-3529930544137592433[0] + // CHECK JS_IR NATIVE: + // Mangled name: Obj#foo(kotlin.IntArray...){} + // Public signature: /Obj.foo|112986931506401688[0] + override fun foo(vararg xs: Int): Int + +} + +// CHECK: +// Mangled name: #testBound(A){} +// Public signature: /testBound|1636169933869733015[0] +fun testBound(a: A): Unit + +// CHECK: +// Mangled name: #testObject(){} +// Public signature: /testObject|-3988286999538388748[0] +fun testObject(): Unit + +// CHECK: +// Mangled name: #testUnbound(){} +// Public signature: /testUnbound|-7514176206479207862[0] +fun testUnbound(): Unit + +// CHECK: +// Mangled name: #use1(kotlin.Function2){} +// Public signature: /use1|-4462422680581088517[0] +fun use1(fn: Function2): Unit + +// CHECK: +// Mangled name: #use2(kotlin.Function1){} +// Public signature: /use2|-4849598794733123366[0] +fun use2(fn: Function1): Unit + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/varargFunImportedFromObject.sig.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/varargFunImportedFromObject.sig.kt.txt new file mode 100644 index 00000000000..26d368c20f6 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callableReferences/varargFunImportedFromObject.sig.kt.txt @@ -0,0 +1,43 @@ +// CHECK: +// Mangled name: Host +// Public signature: /Host|null[0] +object Host { + // CHECK: + // Mangled name: Host#(){} + // Public signature: /Host.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Host#foo(kotlin.Array...){}kotlin.String + // Public signature: /Host.foo|-204629006600469165[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#foo(kotlin.Array...){} + // Public signature: /Host.foo|7137812470563281312[0] + fun foo(vararg x: String): String + +} + +// CHECK JVM_IR: +// Mangled name: #test1(){}kotlin.String +// Public signature: /test1|5794939649815924341[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +fun test1(): String + +// CHECK JVM_IR: +// Mangled name: #test2(){}kotlin.String +// Public signature: /test2|7756882030981116149[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2(){} +// Public signature: /test2|4279114864133353152[0] +fun test2(): String + +// CHECK JVM_IR: +// Mangled name: #withO(kotlin.Function1){}kotlin.String +// Public signature: /withO|-2767877202488996611[0] +// CHECK JS_IR NATIVE: +// Mangled name: #withO(kotlin.Function1){} +// Public signature: /withO|2914129526547888389[0] +fun withO(fn: Function1): String + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.sig.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.sig.kt.txt new file mode 100644 index 00000000000..fad5f348870 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.sig.kt.txt @@ -0,0 +1,30 @@ +// CHECK: +// Mangled name: IFoo +// Public signature: /IFoo|null[0] +fun interface IFoo { + + // CHECK: + // Mangled name: IFoo#foo(kotlin.Int){} + // Public signature: /IFoo.foo|-104159190164110731[0] + abstract fun foo(i: Int): Unit + +} + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + +// CHECK: +// Mangled name: #useFoo(IFoo){} +// Public signature: /useFoo|-5008863146598304258[0] +fun useFoo(foo: IFoo): Unit + +// CHECK JVM_IR: +// Mangled name: #withVararg(kotlin.IntArray...){}kotlin.Int +// Public signature: /withVararg|2262699225692856772[0] +// CHECK JS_IR NATIVE: +// Mangled name: #withVararg(kotlin.IntArray...){} +// Public signature: /withVararg|2511032413940817176[0] +fun withVararg(vararg xs: Int): Int + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.sig.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.sig.kt.txt new file mode 100644 index 00000000000..ff238112d1c --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.sig.kt.txt @@ -0,0 +1,109 @@ +// CHECK: +// Mangled name: Host +// Public signature: /Host|null[0] +object Host { + // CHECK: + // Mangled name: Host#(){} + // Public signature: /Host.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Host#importedObjectMemberWithVarargs(kotlin.IntArray...){}kotlin.String + // Public signature: /Host.importedObjectMemberWithVarargs|7476492663444631478[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#importedObjectMemberWithVarargs(kotlin.IntArray...){} + // Public signature: /Host.importedObjectMemberWithVarargs|-6707689478577439496[0] + fun importedObjectMemberWithVarargs(vararg xs: Int): String + +} + +// CHECK: +// Mangled name: #coerceToUnit(kotlin.Function1){} +// Public signature: /coerceToUnit|-7636359994506321399[0] +fun coerceToUnit(fn: Function1): Unit + +// CHECK JVM_IR: +// Mangled name: #fnWithDefault(kotlin.Int;kotlin.Int){}kotlin.String +// Public signature: /fnWithDefault|615312624340614007[0] +// CHECK JS_IR NATIVE: +// Mangled name: #fnWithDefault(kotlin.Int;kotlin.Int){} +// Public signature: /fnWithDefault|4463734860376909437[0] +fun fnWithDefault(a: Int, b: Int): String + +// CHECK JVM_IR: +// Mangled name: #fnWithDefaults(kotlin.Int;kotlin.Int){}kotlin.String +// Public signature: /fnWithDefaults|684786503990558671[0] +// CHECK JS_IR NATIVE: +// Mangled name: #fnWithDefaults(kotlin.Int;kotlin.Int){} +// Public signature: /fnWithDefaults|-7235704441165534247[0] +fun fnWithDefaults(a: Int, b: Int): String + +// CHECK JVM_IR: +// Mangled name: #fnWithVarargs(kotlin.IntArray...){}kotlin.String +// Public signature: /fnWithVarargs|-2554710779226431969[0] +// CHECK JS_IR NATIVE: +// Mangled name: #fnWithVarargs(kotlin.IntArray...){} +// Public signature: /fnWithVarargs|3976112711378731544[0] +fun fnWithVarargs(vararg xs: Int): String + +// CHECK: +// Mangled name: #testCoercionToUnit(){} +// Public signature: /testCoercionToUnit|5471888531952545525[0] +fun testCoercionToUnit(): Unit + +// CHECK JVM_IR: +// Mangled name: #testDefault(){}kotlin.String +// Public signature: /testDefault|-5176015430445505410[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testDefault(){} +// Public signature: /testDefault|3818133201085041648[0] +fun testDefault(): String + +// CHECK JVM_IR: +// Mangled name: #testDefault0(){}kotlin.String +// Public signature: /testDefault0|6498614662521529564[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testDefault0(){} +// Public signature: /testDefault0|-915023763116368991[0] +fun testDefault0(): String + +// CHECK JVM_IR: +// Mangled name: #testImportedObjectMember(){}kotlin.String +// Public signature: /testImportedObjectMember|-2324367102610217786[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testImportedObjectMember(){} +// Public signature: /testImportedObjectMember|-2303712063541498691[0] +fun testImportedObjectMember(): String + +// CHECK JVM_IR: +// Mangled name: #testVararg(){}kotlin.String +// Public signature: /testVararg|-987920175184523683[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testVararg(){} +// Public signature: /testVararg|-5161893703415149761[0] +fun testVararg(): String + +// CHECK JVM_IR: +// Mangled name: #testVararg0(){}kotlin.String +// Public signature: /testVararg0|-3604981276033465673[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testVararg0(){} +// Public signature: /testVararg0|2721664056984839243[0] +fun testVararg0(): String + +// CHECK JVM_IR: +// Mangled name: #use(kotlin.Function1){}kotlin.String +// Public signature: /use|6965134968711081892[0] +// CHECK JS_IR NATIVE: +// Mangled name: #use(kotlin.Function1){} +// Public signature: /use|-5628727036913455711[0] +fun use(fn: Function1): String + +// CHECK JVM_IR: +// Mangled name: #use0(kotlin.Function0){}kotlin.String +// Public signature: /use0|-1882178247581270166[0] +// CHECK JS_IR NATIVE: +// Mangled name: #use0(kotlin.Function0){} +// Public signature: /use0|1837102046920892382[0] +fun use0(fn: Function0): String + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.sig.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.sig.kt.txt new file mode 100644 index 00000000000..999af080e02 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.sig.kt.txt @@ -0,0 +1,49 @@ +// CHECK: +// Mangled name: Host +// Public signature: /Host|null[0] +class Host { + // CHECK: + // Mangled name: Host#(){} + // Public signature: /Host.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Host#testBoundReceiverExpression(){} + // Public signature: /Host.testBoundReceiverExpression|4527152464563403382[0] + fun testBoundReceiverExpression(): Unit + + // CHECK: + // Mangled name: Host#testBoundReceiverLocalVal(){} + // Public signature: /Host.testBoundReceiverLocalVal|5089842263939902901[0] + fun testBoundReceiverLocalVal(): Unit + + // CHECK: + // Mangled name: Host#testBoundReceiverLocalVar(){} + // Public signature: /Host.testBoundReceiverLocalVar|7082315393387759929[0] + fun testBoundReceiverLocalVar(): Unit + + // CHECK: + // Mangled name: Host#testBoundReceiverParameter(Host){} + // Public signature: /Host.testBoundReceiverParameter|2962165494345239444[0] + fun testBoundReceiverParameter(h: Host): Unit + + // CHECK: + // Mangled name: Host#testImplicitThis(){} + // Public signature: /Host.testImplicitThis|-6601040006825871356[0] + fun testImplicitThis(): Unit + + // CHECK JVM_IR: + // Mangled name: Host#withVararg(kotlin.IntArray...){}kotlin.String + // Public signature: /Host.withVararg|3343284378880347768[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#withVararg(kotlin.IntArray...){} + // Public signature: /Host.withVararg|2511032413940817176[0] + fun withVararg(vararg xs: Int): String + +} + +// CHECK: +// Mangled name: #use(kotlin.Function1){} +// Public signature: /use|4736665629979262606[0] +fun use(fn: Function1): Unit + diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.sig.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.sig.kt.txt new file mode 100644 index 00000000000..0fd1b00263e --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.sig.kt.txt @@ -0,0 +1,61 @@ +// CHECK JVM_IR: +// Mangled name: #nsum(kotlin.Array...){}kotlin.Int +// Public signature: /nsum|849274247512080219[0] +// CHECK JS_IR NATIVE: +// Mangled name: #nsum(kotlin.Array...){} +// Public signature: /nsum|1669670680890244180[0] +fun nsum(vararg args: Number): Int + +// CHECK JVM_IR: +// Mangled name: #sum(kotlin.IntArray...){}kotlin.Int +// Public signature: /sum|7786429240262788644[0] +// CHECK JS_IR NATIVE: +// Mangled name: #sum(kotlin.IntArray...){} +// Public signature: /sum|2467160042393820864[0] +fun sum(vararg args: Int): Int + +// CHECK: +// Mangled name: #testArrayAndDefaults(){} +// Public signature: /testArrayAndDefaults|-7178960797889847684[0] +fun testArrayAndDefaults(): Unit + +// CHECK: +// Mangled name: #testArrayAsVararg(){} +// Public signature: /testArrayAsVararg|-3169605914862197201[0] +fun testArrayAsVararg(): Unit + +// CHECK: +// Mangled name: #testPlainArgs(){} +// Public signature: /testPlainArgs|2446557808710455455[0] +fun testPlainArgs(): Unit + +// CHECK: +// Mangled name: #testPrimitiveArrayAsVararg(){} +// Public signature: /testPrimitiveArrayAsVararg|-8111480002705343386[0] +fun testPrimitiveArrayAsVararg(): Unit + +// CHECK: +// Mangled name: #useArray(kotlin.Function1,kotlin.Int>){} +// Public signature: /useArray|7556411346761547128[0] +fun useArray(fn: Function1, Int>): Unit + +// CHECK: +// Mangled name: #usePlainArgs(kotlin.Function2){} +// Public signature: /usePlainArgs|-2723039808667754959[0] +fun usePlainArgs(fn: Function2): Unit + +// CHECK: +// Mangled name: #usePrimitiveArray(kotlin.Function1){} +// Public signature: /usePrimitiveArray|-3895122125685485943[0] +fun usePrimitiveArray(fn: Function1): Unit + +// CHECK: +// Mangled name: #useStringArray(kotlin.Function1,kotlin.Unit>){} +// Public signature: /useStringArray|-6441375296594019709[0] +fun useStringArray(fn: Function1, Unit>): Unit + +// CHECK: +// Mangled name: #zap(kotlin.Array...;kotlin.Int){} +// Public signature: /zap|-516812668141712757[0] +fun zap(vararg b: String, k: Int): Unit + diff --git a/compiler/testData/ir/irText/expressions/calls.sig.kt.txt b/compiler/testData/ir/irText/expressions/calls.sig.kt.txt new file mode 100644 index 00000000000..733613874b7 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/calls.sig.kt.txt @@ -0,0 +1,48 @@ +// CHECK JVM_IR: +// Mangled name: #bar(kotlin.Int){}kotlin.Int +// Public signature: /bar|-9139551794686561208[0] +// CHECK JS_IR NATIVE: +// Mangled name: #bar(kotlin.Int){} +// Public signature: /bar|-6662241134515685168[0] +fun bar(x: Int): Int + +// CHECK JVM_IR: +// Mangled name: #ext1@kotlin.Int(){}kotlin.Int +// Public signature: /ext1|6413226340790463095[0] +// CHECK JS_IR NATIVE: +// Mangled name: #ext1@kotlin.Int(){} +// Public signature: /ext1|2676317939288138925[0] +fun Int.ext1(): Int + +// CHECK JVM_IR: +// Mangled name: #ext2@kotlin.Int(kotlin.Int){}kotlin.Int +// Public signature: /ext2|-8066960946657179620[0] +// CHECK JS_IR NATIVE: +// Mangled name: #ext2@kotlin.Int(kotlin.Int){} +// Public signature: /ext2|-2215403909210362549[0] +fun Int.ext2(x: Int): Int + +// CHECK JVM_IR: +// Mangled name: #ext3@kotlin.Int(kotlin.Int){}kotlin.Int +// Public signature: /ext3|5977745580530222116[0] +// CHECK JS_IR NATIVE: +// Mangled name: #ext3@kotlin.Int(kotlin.Int){} +// Public signature: /ext3|8845146764019956410[0] +fun Int.ext3(x: Int): Int + +// CHECK JVM_IR: +// Mangled name: #foo(kotlin.Int;kotlin.Int){}kotlin.Int +// Public signature: /foo|4963416038277150675[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo(kotlin.Int;kotlin.Int){} +// Public signature: /foo|-5894601321690082118[0] +fun foo(x: Int, y: Int): Int + +// CHECK JVM_IR: +// Mangled name: #qux(kotlin.Int){}kotlin.Int +// Public signature: /qux|8810931378534960479[0] +// CHECK JS_IR NATIVE: +// Mangled name: #qux(kotlin.Int){} +// Public signature: /qux|-7492140954119175349[0] +fun qux(x: Int): Int + diff --git a/compiler/testData/ir/irText/expressions/castToTypeParameter.kt b/compiler/testData/ir/irText/expressions/castToTypeParameter.kt index 130ead08e72..1fa1652c6c0 100644 --- a/compiler/testData/ir/irText/expressions/castToTypeParameter.kt +++ b/compiler/testData/ir/irText/expressions/castToTypeParameter.kt @@ -1,4 +1,8 @@ // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57436 + fun castFun(x: Any) = x as T fun Any.castExtFun() = this as T diff --git a/compiler/testData/ir/irText/expressions/castToTypeParameter.sig.kt.txt b/compiler/testData/ir/irText/expressions/castToTypeParameter.sig.kt.txt new file mode 100644 index 00000000000..e9c05a69860 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/castToTypeParameter.sig.kt.txt @@ -0,0 +1,95 @@ +// CHECK: +// Mangled name: Host +// Public signature: /Host|null[0] +class Host { + // CHECK: + // Mangled name: Host#(){} + // Public signature: /Host.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Host#castGenericMemberExtFun@kotlin.Any(){0§}0:0 + // Public signature: /Host.castGenericMemberExtFun|-1526087761761488718[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#castGenericMemberExtFun@kotlin.Any(){0§} + // Public signature: /Host.castGenericMemberExtFun|-4690922237571156264[0] + fun Any.castGenericMemberExtFun(): TF + + // CHECK JVM_IR: + // Mangled name: Host#castGenericMemberFun(kotlin.Any){0§}0:0 + // Public signature: /Host.castGenericMemberFun|-1392782893551809351[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#castGenericMemberFun(kotlin.Any){0§} + // Public signature: /Host.castGenericMemberFun|-4509731927562399444[0] + fun castGenericMemberFun(x: Any): TF + + // CHECK JVM_IR: + // Mangled name: Host#castMemberExtFun@kotlin.Any(){}1:0 + // Public signature: /Host.castMemberExtFun|-5532394822767782605[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#castMemberExtFun@kotlin.Any(){} + // Public signature: /Host.castMemberExtFun|5384958774215550302[0] + fun Any.castMemberExtFun(): T + + // CHECK JVM_IR: + // Mangled name: Host#castMemberFun(kotlin.Any){}1:0 + // Public signature: /Host.castMemberFun|2134838373810955115[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#castMemberFun(kotlin.Any){} + // Public signature: /Host.castMemberFun|6787179251543517018[0] + fun castMemberFun(x: Any): T + + // CHECK: + // Mangled name: Host@0:0{0§}castGenericMemberExtVal + // Public signature: /Host.castGenericMemberExtVal|-3234774000451781478[0] + val TV.castGenericMemberExtVal: TV + // CHECK JVM_IR: + // Mangled name: Host#@0:0(){0§}0:0 + // Public signature: /Host.castGenericMemberExtVal.|7589356697377818796[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#@0:0(){0§} + // Public signature: /Host.castGenericMemberExtVal.|4479089431798055620[0] + get(): TV + + // CHECK: + // Mangled name: Host@kotlin.Any{}castMemberExtVal + // Public signature: /Host.castMemberExtVal|-3747833166603208627[0] + val Any.castMemberExtVal: T + // CHECK JVM_IR: + // Mangled name: Host#@kotlin.Any(){}1:0 + // Public signature: /Host.castMemberExtVal.|2557829452396081481[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#@kotlin.Any(){} + // Public signature: /Host.castMemberExtVal.|3750750251852948973[0] + get(): T + +} + +// CHECK JVM_IR: +// Mangled name: #castExtFun@kotlin.Any(){0§}0:0 +// Public signature: /castExtFun|-8988515931245067967[0] +// CHECK JS_IR NATIVE: +// Mangled name: #castExtFun@kotlin.Any(){0§} +// Public signature: /castExtFun|8616851465893920757[0] +fun Any.castExtFun(): T + +// CHECK JVM_IR: +// Mangled name: #castFun(kotlin.Any){0§}0:0 +// Public signature: /castFun|8452838661195068745[0] +// CHECK JS_IR NATIVE: +// Mangled name: #castFun(kotlin.Any){0§} +// Public signature: /castFun|-352412518169718568[0] +fun castFun(x: Any): T + +// CHECK: +// Mangled name: @0:0{0§}castExtVal +// Public signature: /castExtVal|-2827941227832238214[0] +val T.castExtVal: T + // CHECK JVM_IR: + // Mangled name: #@0:0(){0§}0:0 + // Public signature: /castExtVal.|-7034055135715887678[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@0:0(){0§} + // Public signature: /castExtVal.|8519438336102468076[0] + get(): T + diff --git a/compiler/testData/ir/irText/expressions/catchParameterAccess.sig.kt.txt b/compiler/testData/ir/irText/expressions/catchParameterAccess.sig.kt.txt new file mode 100644 index 00000000000..e56f38a007c --- /dev/null +++ b/compiler/testData/ir/irText/expressions/catchParameterAccess.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #test(kotlin.Function0){} +// Public signature: /test|6634439856618498021[0] +fun test(f: Function0): Unit + diff --git a/compiler/testData/ir/irText/expressions/chainOfSafeCalls.sig.kt.txt b/compiler/testData/ir/irText/expressions/chainOfSafeCalls.sig.kt.txt new file mode 100644 index 00000000000..a90d66c71e1 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/chainOfSafeCalls.sig.kt.txt @@ -0,0 +1,35 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: C#bar(){}C? + // Public signature: /C.bar|1617899871460343611[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#bar(){} + // Public signature: /C.bar|496682602797471549[0] + fun bar(): C? + + // CHECK JVM_IR: + // Mangled name: C#foo(){}C + // Public signature: /C.foo|3027884397623430086[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#foo(){} + // Public signature: /C.foo|-1041209573719867811[0] + fun foo(): C + +} + +// CHECK JVM_IR: +// Mangled name: #test(C?){}C? +// Public signature: /test|2090113898813172602[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test(C?){} +// Public signature: /test|-9127084887599042119[0] +fun test(nc: C?): C? + diff --git a/compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.sig.kt.txt b/compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.sig.kt.txt new file mode 100644 index 00000000000..617cff07979 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/chainedFunSuspendConversionForSimpleExpression.sig.kt.txt @@ -0,0 +1,30 @@ +// CHECK: +// Mangled name: SuspendRunnable +// Public signature: /SuspendRunnable|null[0] +fun interface SuspendRunnable { + + // CHECK: + // Mangled name: SuspendRunnable#invoke(){} + // Public signature: /SuspendRunnable.invoke|-4663091332620260873[0] + abstract suspend fun invoke(): Unit + +} + +// CHECK JVM_IR: +// Mangled name: #bar(){}kotlin.Function0 +// Public signature: /bar|-2077237772809994309[0] +// CHECK JS_IR NATIVE: +// Mangled name: #bar(){} +// Public signature: /bar|496682602797471549[0] +fun bar(): Function0 + +// CHECK: +// Mangled name: #foo(SuspendRunnable){} +// Public signature: /foo|3528754128205426736[0] +fun foo(s: SuspendRunnable): Unit + +// CHECK: +// Mangled name: #test(kotlin.Function0){} +// Public signature: /test|6634439856618498021[0] +fun test(f: Function0): Unit + diff --git a/compiler/testData/ir/irText/expressions/classReference.sig.kt.txt b/compiler/testData/ir/irText/expressions/classReference.sig.kt.txt new file mode 100644 index 00000000000..f1f22305723 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/classReference.sig.kt.txt @@ -0,0 +1,16 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + diff --git a/compiler/testData/ir/irText/expressions/coercionToUnit.sig.kt.txt b/compiler/testData/ir/irText/expressions/coercionToUnit.sig.kt.txt new file mode 100644 index 00000000000..6c2d0cfedba --- /dev/null +++ b/compiler/testData/ir/irText/expressions/coercionToUnit.sig.kt.txt @@ -0,0 +1,19 @@ +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: Function0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function0 + // Public signature: /test1.|4031203072491725526[0] + get + +// CHECK: +// Mangled name: #test2(kotlin.collections.MutableCollection){} +// Public signature: /test2|127920314882232051[0] +fun test2(mc: MutableCollection): Unit + +// CHECK: +// Mangled name: #test3(){} +// Public signature: /test3|-3759735065270951803[0] +fun test3(): Unit + diff --git a/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.sig.kt.txt b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.sig.kt.txt new file mode 100644 index 00000000000..97001879f0c --- /dev/null +++ b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.sig.kt.txt @@ -0,0 +1,139 @@ +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +class B { + // CHECK: + // Mangled name: B{}s + // Public signature: /B.s|7217541905509134881[0] + var s: Int + // CHECK JVM_IR: + // Mangled name: B#(){}kotlin.Int + // Public signature: /B.s.|-4647012324166823285[0] + // CHECK JS_IR NATIVE: + // Mangled name: B#(){} + // Public signature: /B.s.|-1662172381559511151[0] + get + // CHECK: + // Mangled name: B#(kotlin.Int){} + // Public signature: /B.s.|-271772167961470196[0] + set + + // CHECK: + // Mangled name: B#(kotlin.Int){} + // Public signature: /B.|-5182794243525578284[0] + constructor(s: Int) /* primary */ + +} + +// CHECK: +// Mangled name: Host +// Public signature: /Host|null[0] +object Host { + // CHECK: + // Mangled name: Host#(){} + // Public signature: /Host.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK: + // Mangled name: Host#plusAssign@B(B){} + // Public signature: /Host.plusAssign|2019899313104241875[0] + operator fun B.plusAssign(b: B): Unit + +} + +// CHECK: +// Mangled name: X1 +// Public signature: /X1|null[0] +object X1 { + // CHECK: + // Mangled name: X1{}x1 + // Public signature: /X1.x1|-8458287146120398778[0] + var x1: Int + // CHECK JVM_IR: + // Mangled name: X1#(){}kotlin.Int + // Public signature: /X1.x1.|7552224918031182012[0] + // CHECK JS_IR NATIVE: + // Mangled name: X1#(){} + // Public signature: /X1.x1.|-6784695929064323344[0] + get + // CHECK: + // Mangled name: X1#(kotlin.Int){} + // Public signature: /X1.x1.|6559558337863343625[0] + set + + // CHECK: + // Mangled name: X1.X2 + // Public signature: /X1.X2|null[0] + object X2 { + // CHECK: + // Mangled name: X1.X2{}x2 + // Public signature: /X1.X2.x2|7624999599297478649[0] + var x2: Int + // CHECK JVM_IR: + // Mangled name: X1.X2#(){}kotlin.Int + // Public signature: /X1.X2.x2.|8643944297803616344[0] + // CHECK JS_IR NATIVE: + // Mangled name: X1.X2#(){} + // Public signature: /X1.X2.x2.|4516516368910539088[0] + get + // CHECK: + // Mangled name: X1.X2#(kotlin.Int){} + // Public signature: /X1.X2.x2.|8440745702617099146[0] + set + + // CHECK: + // Mangled name: X1.X2.X3 + // Public signature: /X1.X2.X3|null[0] + object X3 { + // CHECK: + // Mangled name: X1.X2.X3{}x3 + // Public signature: /X1.X2.X3.x3|6087740953699108933[0] + var x3: Int + // CHECK JVM_IR: + // Mangled name: X1.X2.X3#(){}kotlin.Int + // Public signature: /X1.X2.X3.x3.|8346856633438806711[0] + // CHECK JS_IR NATIVE: + // Mangled name: X1.X2.X3#(){} + // Public signature: /X1.X2.X3.x3.|1880487902145043103[0] + get + // CHECK: + // Mangled name: X1.X2.X3#(kotlin.Int){} + // Public signature: /X1.X2.X3.x3.|5328650237314019083[0] + set + + // CHECK: + // Mangled name: X1.X2.X3#(){} + // Public signature: /X1.X2.X3.|-5645683436151566731[0] + private constructor() /* primary */ + + } + + // CHECK: + // Mangled name: X1.X2#(){} + // Public signature: /X1.X2.|-5645683436151566731[0] + private constructor() /* primary */ + + } + + // CHECK: + // Mangled name: X1#(){} + // Public signature: /X1.|-5645683436151566731[0] + private constructor() /* primary */ + +} + +// CHECK: +// Mangled name: #test1(kotlin.IntArray){} +// Public signature: /test1|4961304868876759524[0] +fun test1(a: IntArray): Unit + +// CHECK: +// Mangled name: #test2(){} +// Public signature: /test2|4279114864133353152[0] +fun test2(): Unit + +// CHECK: +// Mangled name: #test3@Host(B){} +// Public signature: /test3|8876438075235988874[0] +fun Host.test3(v: B): Unit + diff --git a/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.sig.kt.txt b/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.sig.kt.txt new file mode 100644 index 00000000000..d8961b79938 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.sig.kt.txt @@ -0,0 +1,32 @@ +// CHECK: +// Mangled name: K1 +// Public signature: /K1|null[0] +class K1 { + // CHECK: + // Mangled name: K1.K2 + // Public signature: /K1.K2|null[0] + inner class K2 { + // CHECK: + // Mangled name: K1.K2#(){} + // Public signature: /K1.K2.|-5645683436151566731[0] + constructor() /* primary */ + + } + + // CHECK: + // Mangled name: K1#(){} + // Public signature: /K1.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #testJava(){}J1.J2 +// Public signature: /testJava|4724217123423783781[0] +fun testJava(): J2 + +// CHECK JVM_IR: +// Mangled name: #testKotlin(){}K1.K2 +// Public signature: /testKotlin|8698549833663124127[0] +fun testKotlin(): K2 + diff --git a/compiler/testData/ir/irText/expressions/contructorCall.kt b/compiler/testData/ir/irText/expressions/contructorCall.kt index 16c29808a2a..7d7010d48f7 100644 --- a/compiler/testData/ir/irText/expressions/contructorCall.kt +++ b/compiler/testData/ir/irText/expressions/contructorCall.kt @@ -1,4 +1,9 @@ // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: JS_IR +// MUTE_SIGNATURE_COMPARISON_K2: NATIVE +// ^ KT-57818 + class A -val test = A() \ No newline at end of file +val test = A() diff --git a/compiler/testData/ir/irText/expressions/contructorCall.sig.kt.txt b/compiler/testData/ir/irText/expressions/contructorCall.sig.kt.txt new file mode 100644 index 00000000000..808a12904d2 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/contructorCall.sig.kt.txt @@ -0,0 +1,23 @@ +// CHECK: +// Mangled name: {}test +// Public signature: /test|-5712650070209114719[0] +val test: A + // CHECK JVM_IR: + // Mangled name: #(){}A + // Public signature: /test.|1008694073924452605[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test.|208282462577758837[0] + get + +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/expressions/conventionComparisons.sig.kt.txt b/compiler/testData/ir/irText/expressions/conventionComparisons.sig.kt.txt new file mode 100644 index 00000000000..0e70288b54a --- /dev/null +++ b/compiler/testData/ir/irText/expressions/conventionComparisons.sig.kt.txt @@ -0,0 +1,54 @@ +// CHECK: +// Mangled name: IA +// Public signature: /IA|null[0] +interface IA { + +} + +// CHECK: +// Mangled name: IB +// Public signature: /IB|null[0] +interface IB { + + // CHECK JVM_IR: + // Mangled name: IB#compareTo@IA(IA){}kotlin.Int + // Public signature: /IB.compareTo|-7259969497814497426[0] + // CHECK JS_IR NATIVE: + // Mangled name: IB#compareTo@IA(IA){} + // Public signature: /IB.compareTo|-6258326288651646740[0] + abstract operator fun IA.compareTo(other: IA): Int + +} + +// CHECK JVM_IR: +// Mangled name: #test1@IB(IA;IA){}kotlin.Boolean +// Public signature: /test1|-4373836657117486273[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1@IB(IA;IA){} +// Public signature: /test1|2110430035798087324[0] +fun IB.test1(a1: IA, a2: IA): Boolean + +// CHECK JVM_IR: +// Mangled name: #test2@IB(IA;IA){}kotlin.Boolean +// Public signature: /test2|5436750902587155920[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2@IB(IA;IA){} +// Public signature: /test2|-1582753887583153969[0] +fun IB.test2(a1: IA, a2: IA): Boolean + +// CHECK JVM_IR: +// Mangled name: #test3@IB(IA;IA){}kotlin.Boolean +// Public signature: /test3|-6567103906122911326[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3@IB(IA;IA){} +// Public signature: /test3|7130450291559664455[0] +fun IB.test3(a1: IA, a2: IA): Boolean + +// CHECK JVM_IR: +// Mangled name: #test4@IB(IA;IA){}kotlin.Boolean +// Public signature: /test4|-2122684825224786608[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test4@IB(IA;IA){} +// Public signature: /test4|-7050566763299108335[0] +fun IB.test4(a1: IA, a2: IA): Boolean + diff --git a/compiler/testData/ir/irText/expressions/destructuring1.sig.kt.txt b/compiler/testData/ir/irText/expressions/destructuring1.sig.kt.txt new file mode 100644 index 00000000000..fa0536ce31a --- /dev/null +++ b/compiler/testData/ir/irText/expressions/destructuring1.sig.kt.txt @@ -0,0 +1,43 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +object A { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + private constructor() /* primary */ + +} + +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +object B { + // CHECK: + // Mangled name: B#(){} + // Public signature: /B.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: B#component1@A(){}kotlin.Int + // Public signature: /B.component1|-7852292492190161170[0] + // CHECK JS_IR NATIVE: + // Mangled name: B#component1@A(){} + // Public signature: /B.component1|-5209316971718544805[0] + operator fun A.component1(): Int + + // CHECK JVM_IR: + // Mangled name: B#component2@A(){}kotlin.Int + // Public signature: /B.component2|-9145888741821901515[0] + // CHECK JS_IR NATIVE: + // Mangled name: B#component2@A(){} + // Public signature: /B.component2|-4967140045736561606[0] + operator fun A.component2(): Int + +} + +// CHECK: +// Mangled name: #test@B(){} +// Public signature: /test|5810566108753944346[0] +fun B.test(): Unit + diff --git a/compiler/testData/ir/irText/expressions/destructuringWithUnderscore.sig.kt.txt b/compiler/testData/ir/irText/expressions/destructuringWithUnderscore.sig.kt.txt new file mode 100644 index 00000000000..808bfeaa49a --- /dev/null +++ b/compiler/testData/ir/irText/expressions/destructuringWithUnderscore.sig.kt.txt @@ -0,0 +1,51 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +object A { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + private constructor() /* primary */ + +} + +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +object B { + // CHECK: + // Mangled name: B#(){} + // Public signature: /B.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: B#component1@A(){}kotlin.Int + // Public signature: /B.component1|-7852292492190161170[0] + // CHECK JS_IR NATIVE: + // Mangled name: B#component1@A(){} + // Public signature: /B.component1|-5209316971718544805[0] + operator fun A.component1(): Int + + // CHECK JVM_IR: + // Mangled name: B#component2@A(){}kotlin.Int + // Public signature: /B.component2|-9145888741821901515[0] + // CHECK JS_IR NATIVE: + // Mangled name: B#component2@A(){} + // Public signature: /B.component2|-4967140045736561606[0] + operator fun A.component2(): Int + + // CHECK JVM_IR: + // Mangled name: B#component3@A(){}kotlin.Int + // Public signature: /B.component3|-6348117122081835134[0] + // CHECK JS_IR NATIVE: + // Mangled name: B#component3@A(){} + // Public signature: /B.component3|-5144611481254766335[0] + operator fun A.component3(): Int + +} + +// CHECK: +// Mangled name: #test@B(){} +// Public signature: /test|5810566108753944346[0] +fun B.test(): Unit + diff --git a/compiler/testData/ir/irText/expressions/dotQualified.sig.kt.txt b/compiler/testData/ir/irText/expressions/dotQualified.sig.kt.txt new file mode 100644 index 00000000000..9d40d5ea8f3 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/dotQualified.sig.kt.txt @@ -0,0 +1,16 @@ +// CHECK JVM_IR: +// Mangled name: #length(kotlin.String){}kotlin.Int +// Public signature: /length|-1740595923541354280[0] +// CHECK JS_IR NATIVE: +// Mangled name: #length(kotlin.String){} +// Public signature: /length|-4601517635690082987[0] +fun length(s: String): Int + +// CHECK JVM_IR: +// Mangled name: #lengthN(kotlin.String?){}kotlin.Int? +// Public signature: /lengthN|-8193665080783092535[0] +// CHECK JS_IR NATIVE: +// Mangled name: #lengthN(kotlin.String?){} +// Public signature: /lengthN|-6892154630635195903[0] +fun lengthN(s: String?): Int? + diff --git a/compiler/testData/ir/irText/expressions/elvis.kt b/compiler/testData/ir/irText/expressions/elvis.kt index 9531b0d86c7..a34986ac982 100644 --- a/compiler/testData/ir/irText/expressions/elvis.kt +++ b/compiler/testData/ir/irText/expressions/elvis.kt @@ -1,3 +1,7 @@ +// MUTE_SIGNATURE_COMPARISON_K2: JS_IR +// MUTE_SIGNATURE_COMPARISON_K2: NATIVE +// ^ KT-57818 + val p: Any? = null fun foo(): Any? = null @@ -14,4 +18,4 @@ fun test3(a: Any?, b: Any?): String { fun test4(x: Any) = p ?: x -fun test5(x: Any) = foo() ?: x \ No newline at end of file +fun test5(x: Any) = foo() ?: x diff --git a/compiler/testData/ir/irText/expressions/elvis.sig.kt.txt b/compiler/testData/ir/irText/expressions/elvis.sig.kt.txt new file mode 100644 index 00000000000..c3c7cc4f447 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/elvis.sig.kt.txt @@ -0,0 +1,60 @@ +// CHECK: +// Mangled name: {}p +// Public signature: /p|6715504260787941082[0] +val p: Any? + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Any? + // Public signature: /p.|-8403090778350003178[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /p.|-1162552463316289847[0] + get + +// CHECK JVM_IR: +// Mangled name: #foo(){}kotlin.Any? +// Public signature: /foo|7186954136321860865[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo(){} +// Public signature: /foo|-1041209573719867811[0] +fun foo(): Any? + +// CHECK JVM_IR: +// Mangled name: #test1(kotlin.Any?;kotlin.Any){}kotlin.Any +// Public signature: /test1|8089037287083732315[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1(kotlin.Any?;kotlin.Any){} +// Public signature: /test1|-6997889103907623622[0] +fun test1(a: Any?, b: Any): Any + +// CHECK JVM_IR: +// Mangled name: #test2(kotlin.String?;kotlin.Any){}kotlin.Any +// Public signature: /test2|8978773976435569675[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2(kotlin.String?;kotlin.Any){} +// Public signature: /test2|4742672895762434756[0] +fun test2(a: String?, b: Any): Any + +// CHECK JVM_IR: +// Mangled name: #test3(kotlin.Any?;kotlin.Any?){}kotlin.String +// Public signature: /test3|-8038061391637261704[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3(kotlin.Any?;kotlin.Any?){} +// Public signature: /test3|6801898630268838874[0] +fun test3(a: Any?, b: Any?): String + +// CHECK JVM_IR: +// Mangled name: #test4(kotlin.Any){}kotlin.Any +// Public signature: /test4|6711648886037953081[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test4(kotlin.Any){} +// Public signature: /test4|-9023258848991787985[0] +fun test4(x: Any): Any + +// CHECK JVM_IR: +// Mangled name: #test5(kotlin.Any){}kotlin.Any +// Public signature: /test5|5392832943480599790[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test5(kotlin.Any){} +// Public signature: /test5|4504681808078971124[0] +fun test5(x: Any): Any + diff --git a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.kt b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.kt index 4de0b349cf9..86084fcb34b 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.kt +++ b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.kt @@ -1,6 +1,9 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57777, KT-57427, KT-57430 + enum class X { B { diff --git a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.sig.kt.txt b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.sig.kt.txt new file mode 100644 index 00000000000..af06dc8ed6d --- /dev/null +++ b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.sig.kt.txt @@ -0,0 +1,219 @@ +// CHECK: +// Mangled name: X +// Public signature: /X|null[0] +abstract enum class X : Enum { + // CHECK: + // Mangled name: X#(){} + // Public signature: /X.|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK: + // Mangled name: X.B + // Public signature: /X.B|null[0] + + B + // CHECK: + // Mangled name: X.B + // Public signature: /X.B.|null[0] + private enum entry class B : X { + // CHECK: + // Mangled name: X.B{}value2 + // Public signature: /X.B..value2|-1664181645671419060[0] + val value2: String + // CHECK JVM_IR: + // Mangled name: X.B#(){}kotlin.String + // Public signature: /X.B..value2.|2390168402748813003[0] + // CHECK JS_IR NATIVE: + // Mangled name: X.B#(){} + // Public signature: /X.B..value2.|1776957621204807843[0] + get + + // CHECK: + // Mangled name: X.B{}value + // Public signature: /X.B..value|1987073854177347439[0] + override val value: Function0 + // CHECK JVM_IR: + // Mangled name: X.B#(){}kotlin.Function0 + // Public signature: /X.B..value.|-2160558915408168462[0] + // CHECK JS_IR NATIVE: + // Mangled name: X.B#(){} + // Public signature: /X.B..value.|3260093555963109437[0] + override get + + // CHECK: + // Mangled name: X.B#(){} + // Public signature: /X.B..|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK JVM_IR: + // Mangled name: X.B#clone(){}kotlin.Any + // Public signature: /X.B..clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: X.B#compareTo(X){} + // Public signature: /X.B..compareTo|1261254128967309541[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: X.B#compareTo(X){}kotlin.Int + // Public signature: /X.B..compareTo|-4945307460605318887[0] + // CHECK JS_IR NATIVE: + // Mangled name: X.B#equals(kotlin.Any?){} + // Public signature: /X.B..equals|4638265728071529943[0] + /* fake */ override operator fun compareTo(other: X): Int + + // CHECK JVM_IR: + // Mangled name: X.B#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /X.B..equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: X.B#hashCode(){} + // Public signature: /X.B..hashCode|3409210261493131192[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: X.B#hashCode(){}kotlin.Int + // Public signature: /X.B..hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: X.B#toString(){} + // Public signature: /X.B..toString|-1522858123163872138[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: X.B#toString(){}kotlin.String + // Public signature: /X.B..toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: X.B{}name + // Public signature: /X.B..name|4231860309499509769[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: X.B{}name + // Public signature: /X.B..name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: X.B#(){}kotlin.String + // Public signature: /X.B..name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: X.B{}ordinal + // Public signature: /X.B..ordinal|1912745122988592376[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: X.B{}ordinal + // Public signature: /X.B..ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: X.B#(){}kotlin.Int + // Public signature: /X.B..ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: X#valueOf#static(kotlin.String){} + // Public signature: /X.valueOf|-4683474617854611729[0] + /* fake */ override get(): Int + + } + + // CHECK JVM_IR: + // Mangled name: X#valueOf#static(kotlin.String){}X + // Public signature: /X.valueOf|5795127078210310399[0] + // CHECK JS_IR NATIVE: + // Mangled name: X#values#static(){} + // Public signature: /X.values|-8715569000920726747[0] + fun valueOf(value: String): X + + // CHECK JVM_IR: + // Mangled name: X#values#static(){}kotlin.Array + // Public signature: /X.values|-7109739533511471403[0] + // CHECK JS_IR NATIVE: + // Mangled name: X#compareTo(X){} + // Public signature: /X.compareTo|1261254128967309541[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: X#clone(){}kotlin.Any + // Public signature: /X.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: X#equals(kotlin.Any?){} + // Public signature: /X.equals|4638265728071529943[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: X#compareTo(X){}kotlin.Int + // Public signature: /X.compareTo|-4945307460605318887[0] + // CHECK JS_IR NATIVE: + // Mangled name: X#hashCode(){} + // Public signature: /X.hashCode|3409210261493131192[0] + /* fake */ override operator fun compareTo(other: X): Int + + // CHECK JVM_IR: + // Mangled name: X#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /X.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: X#toString(){} + // Public signature: /X.toString|-1522858123163872138[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: X#hashCode(){}kotlin.Int + // Public signature: /X.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: X#static{}entries + // Public signature: /X.entries|-5134227801081826149[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: X#toString(){}kotlin.String + // Public signature: /X.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: X##static(){} + // Public signature: /X.entries.|-6068527377476727729[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: X#static{}entries + // Public signature: /X.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: X##static(){}kotlin.enums.EnumEntries + // Public signature: /X.entries.|6681560497291336349[0] + // CHECK JS_IR NATIVE: + // Mangled name: X#(){} + // Public signature: /X.name.|5879344792307730109[0] + get(): EnumEntries + + // CHECK: + // Mangled name: X{}name + // Public signature: /X.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: X#(){}kotlin.String + // Public signature: /X.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: X#(){} + // Public signature: /X.ordinal.|8409904226035914023[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: X{}ordinal + // Public signature: /X.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: X#(){}kotlin.Int + // Public signature: /X.ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: X#(){} + // Public signature: /X.value.|3260093555963109437[0] + /* fake */ override get(): Int + + // CHECK: + // Mangled name: X{}value + // Public signature: /X.value|1987073854177347439[0] + abstract val value: Function0 + // CHECK JVM_IR: + // Mangled name: X#(){}kotlin.Function0 + // Public signature: /X.value.|-2160558915408168462[0] + abstract get + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +fun box(): String + diff --git a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.kt b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.kt index 12cbe9695eb..0adaf32f407 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.kt +++ b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.kt @@ -1,6 +1,9 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// SKIP_SIGNATURE_DUMP +// ^ Types of properties of anonymous classes generated by K1 and K2 are different + enum class MyEnum { Z { var counter = 0 diff --git a/compiler/testData/ir/irText/expressions/equality.sig.kt.txt b/compiler/testData/ir/irText/expressions/equality.sig.kt.txt new file mode 100644 index 00000000000..af450df59cf --- /dev/null +++ b/compiler/testData/ir/irText/expressions/equality.sig.kt.txt @@ -0,0 +1,24 @@ +// CHECK JVM_IR: +// Mangled name: #test1(kotlin.Int;kotlin.Int){}kotlin.Boolean +// Public signature: /test1|-7551143999400464285[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1(kotlin.Int;kotlin.Int){} +// Public signature: /test1|-6134767217751638375[0] +fun test1(a: Int, b: Int): Boolean + +// CHECK JVM_IR: +// Mangled name: #test2(kotlin.Int;kotlin.Int){}kotlin.Boolean +// Public signature: /test2|29360423018429037[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2(kotlin.Int;kotlin.Int){} +// Public signature: /test2|-1200247296907510564[0] +fun test2(a: Int, b: Int): Boolean + +// CHECK JVM_IR: +// Mangled name: #test3(kotlin.Any?;kotlin.Any?){}kotlin.Boolean +// Public signature: /test3|-3154163417477574713[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3(kotlin.Any?;kotlin.Any?){} +// Public signature: /test3|6801898630268838874[0] +fun test3(a: Any?, b: Any?): Boolean + diff --git a/compiler/testData/ir/irText/expressions/equals.sig.kt.txt b/compiler/testData/ir/irText/expressions/equals.sig.kt.txt new file mode 100644 index 00000000000..e1c285d3f0d --- /dev/null +++ b/compiler/testData/ir/irText/expressions/equals.sig.kt.txt @@ -0,0 +1,20 @@ +// CHECK JVM_IR: +// Mangled name: #testEqeq(kotlin.Int;kotlin.Int){}kotlin.Boolean +// Public signature: /testEqeq|-8467980441682237872[0] +fun testEqeq(a: Int, b: Int): Boolean + +// CHECK JVM_IR: +// Mangled name: #testEquals(kotlin.Int;kotlin.Int){}kotlin.Boolean +// Public signature: /testEquals|-6776844626244337538[0] +fun testEquals(a: Int, b: Int): Boolean + +// CHECK JVM_IR: +// Mangled name: #testJEqeqNull(){}kotlin.Boolean +// Public signature: /testJEqeqNull|-16498498668551755[0] +fun testJEqeqNull(): Boolean + +// CHECK JVM_IR: +// Mangled name: #testJEqualsNull(){}kotlin.Boolean +// Public signature: /testJEqualsNull|1794297066470075977[0] +fun testJEqualsNull(): Boolean + diff --git a/compiler/testData/ir/irText/expressions/exclExclOnPlatformType.sig.kt.txt b/compiler/testData/ir/irText/expressions/exclExclOnPlatformType.sig.kt.txt new file mode 100644 index 00000000000..a966737e08a --- /dev/null +++ b/compiler/testData/ir/irText/expressions/exclExclOnPlatformType.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + +// CHECK: +// Mangled name: #use(kotlin.Any){} +// Public signature: /use|-404813706895505622[0] +fun use(a: Any): Unit + diff --git a/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.kt b/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.kt index 4b25ae6a3a8..04df59cef3a 100644 --- a/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.kt +++ b/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.kt @@ -1,6 +1,9 @@ // 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/exhaustiveWhenElseBranch.sig.kt.txt b/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.sig.kt.txt new file mode 100644 index 00000000000..df77078a00b --- /dev/null +++ b/compiler/testData/ir/irText/expressions/exhaustiveWhenElseBranch.sig.kt.txt @@ -0,0 +1,155 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +enum class A : Enum { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK: + // Mangled name: A.V1 + // Public signature: /A.V1|null[0] + V1 + + // CHECK JVM_IR: + // Mangled name: A#valueOf#static(kotlin.String){}A + // Public signature: /A.valueOf|8636923007498802918[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#valueOf#static(kotlin.String){} + // Public signature: /A.valueOf|-4683474617854611729[0] + fun valueOf(value: String): A + + // CHECK JVM_IR: + // Mangled name: A#values#static(){}kotlin.Array + // Public signature: /A.values|5753238680897834936[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#values#static(){} + // Public signature: /A.values|-8715569000920726747[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: A#clone(){}kotlin.Any + // Public signature: /A.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#compareTo(A){} + // Public signature: /A.compareTo|5303387127644845713[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: A#compareTo(A){}kotlin.Int + // Public signature: /A.compareTo|-315052537630360750[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#equals(kotlin.Any?){} + // Public signature: /A.equals|4638265728071529943[0] + /* fake */ override operator fun compareTo(other: A): Int + + // CHECK JVM_IR: + // Mangled name: A#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /A.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#hashCode(){} + // Public signature: /A.hashCode|3409210261493131192[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: A#hashCode(){}kotlin.Int + // Public signature: /A.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#toString(){} + // Public signature: /A.toString|-1522858123163872138[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: A#toString(){}kotlin.String + // Public signature: /A.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#static{}entries + // Public signature: /A.entries|-5134227801081826149[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: A#static{}entries + // Public signature: /A.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: A##static(){}kotlin.enums.EnumEntries + // Public signature: /A.entries.|3279885591622842062[0] + // CHECK JS_IR NATIVE: + // Mangled name: A{}name + // Public signature: /A.name|4231860309499509769[0] + get(): EnumEntries + + // CHECK: + // Mangled name: A{}name + // Public signature: /A.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.String + // Public signature: /A.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: A{}ordinal + // Public signature: /A.ordinal|1912745122988592376[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: A{}ordinal + // Public signature: /A.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: #testAnnotated_throwsJvm(A){} + // Public signature: /testAnnotated_throwsJvm|4125008918330317559[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: #testAnnotated_throwsJvm(A){} +// Public signature: /testAnnotated_throwsJvm|4125008918330317559[0] +fun testAnnotated_throwsJvm(a: A): Unit + +// CHECK JVM_IR: +// Mangled name: #testExpression_throws(A){}kotlin.Int +// Public signature: /testExpression_throws|-3237050390749274330[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testIfTheElseAnnotated_throwsJvm(A;kotlin.Boolean){} +// Public signature: /testIfTheElseAnnotated_throwsJvm|2206683935431102388[0] +fun testExpression_throws(a: A): Int + +// CHECK: +// Mangled name: #testIfTheElseAnnotated_throwsJvm(A;kotlin.Boolean){} +// Public signature: /testIfTheElseAnnotated_throwsJvm|2206683935431102388[0] +fun testIfTheElseAnnotated_throwsJvm(a: A, flag: Boolean): Unit + +// CHECK: +// Mangled name: #testIfTheElseParenthesized_throwsJvm(A;kotlin.Boolean){} +// Public signature: /testIfTheElseParenthesized_throwsJvm|3170189440226289413[0] +fun testIfTheElseParenthesized_throwsJvm(a: A, flag: Boolean): Unit + +// CHECK: +// Mangled name: #testIfTheElseStatement_empty(A;kotlin.Boolean){} +// Public signature: /testIfTheElseStatement_empty|303316846698538218[0] +fun testIfTheElseStatement_empty(a: A, flag: Boolean): Unit + +// CHECK: +// Mangled name: #testLambdaResultExpression_throws(A){} +// Public signature: /testLambdaResultExpression_throws|6372161286444781898[0] +fun testLambdaResultExpression_throws(a: A): Unit + +// CHECK: +// Mangled name: #testParenthesized_throwsJvm(A){} +// Public signature: /testParenthesized_throwsJvm|6011674528839266385[0] +fun testParenthesized_throwsJvm(a: A): Unit + +// CHECK: +// Mangled name: #testStatement_empty(A){} +// Public signature: /testStatement_empty|7105275116252213819[0] +fun testStatement_empty(a: A): Unit + +// CHECK: +// Mangled name: #testVariableAssignment_throws(A){} +// Public signature: /testVariableAssignment_throws|3390143287882484978[0] +fun testVariableAssignment_throws(a: A): Unit + diff --git a/compiler/testData/ir/irText/expressions/extFunInvokeAsFun.sig.kt.txt b/compiler/testData/ir/irText/expressions/extFunInvokeAsFun.sig.kt.txt new file mode 100644 index 00000000000..c865a6ac159 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/extFunInvokeAsFun.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #with1(kotlin.Any?;kotlin.Function1){} +// Public signature: /with1|7457831097191590523[0] +fun with1(receiver: Any?, block: @ExtensionFunctionType Function1): Unit + +// CHECK: +// Mangled name: #with2(kotlin.Any?;kotlin.Function1){} +// Public signature: /with2|-8465193088240547938[0] +fun with2(receiver: Any?, block: @ExtensionFunctionType Function1): Unit + diff --git a/compiler/testData/ir/irText/expressions/extFunSafeInvoke.sig.kt.txt b/compiler/testData/ir/irText/expressions/extFunSafeInvoke.sig.kt.txt new file mode 100644 index 00000000000..cf3b902ba7f --- /dev/null +++ b/compiler/testData/ir/irText/expressions/extFunSafeInvoke.sig.kt.txt @@ -0,0 +1,8 @@ +// CHECK JVM_IR: +// Mangled name: #test(kotlin.Any?;kotlin.Function3){}kotlin.Unit? +// Public signature: /test|-6483776340446886488[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test(kotlin.Any?;kotlin.Function3){} +// Public signature: /test|7562359801694057104[0] +fun test(receiver: Any?, fn: @ExtensionFunctionType Function3): Unit? + diff --git a/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.kt b/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.kt index ba66df3b6d6..54ee4e96a86 100644 --- a/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.kt +++ b/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.kt @@ -1,3 +1,8 @@ // 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/extensionPropertyGetterCall.sig.kt.txt b/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.sig.kt.txt new file mode 100644 index 00000000000..ebceb735c10 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.sig.kt.txt @@ -0,0 +1,20 @@ +// CHECK JVM_IR: +// Mangled name: #test5@kotlin.String(){}kotlin.String +// Public signature: /test5|7396849134865790053[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test5@kotlin.String(){} +// Public signature: /test5|6764932899271361379[0] +fun String.test5(): String + +// CHECK: +// Mangled name: @kotlin.String{}okext +// Public signature: /okext|-7546376167507800782[0] +val String.okext: String + // CHECK JVM_IR: + // Mangled name: #@kotlin.String(){}kotlin.String + // Public signature: /okext.|-4397362169527603922[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@kotlin.String(){} + // Public signature: /okext.|-5103161093403962760[0] + get(): String + diff --git a/compiler/testData/ir/irText/expressions/field.kt b/compiler/testData/ir/irText/expressions/field.kt index fb8018aba5b..b1135d0d878 100644 --- a/compiler/testData/ir/irText/expressions/field.kt +++ b/compiler/testData/ir/irText/expressions/field.kt @@ -1,3 +1,7 @@ +// MUTE_SIGNATURE_COMPARISON_K2: JS_IR +// MUTE_SIGNATURE_COMPARISON_K2: NATIVE +// ^ KT-57818 + var testSimple: Int = 0 set(value) { field = value @@ -6,4 +10,4 @@ var testSimple: Int = 0 var testAugmented: Int = 0 set(value) { field += value - } \ No newline at end of file + } diff --git a/compiler/testData/ir/irText/expressions/field.sig.kt.txt b/compiler/testData/ir/irText/expressions/field.sig.kt.txt new file mode 100644 index 00000000000..0b16c723f69 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/field.sig.kt.txt @@ -0,0 +1,32 @@ +// CHECK: +// Mangled name: {}testSimple +// Public signature: /testSimple|4953321271268423714[0] +var testSimple: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /testSimple.|-8005436010067357235[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testSimple.|-8679451114963008530[0] + get + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /testSimple.|524645050851415713[0] + set(value: Int): Unit + +// CHECK: +// Mangled name: {}testAugmented +// Public signature: /testAugmented|-6564959773952065103[0] +var testAugmented: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /testAugmented.|2800173571752957459[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testAugmented.|-3271199584899613905[0] + get + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /testAugmented.|-5845041817875850586[0] + set(value: Int): Unit + diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/comparableWithDoubleOrFloat.sig.kt.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/comparableWithDoubleOrFloat.sig.kt.txt new file mode 100644 index 00000000000..f97971cec0a --- /dev/null +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/comparableWithDoubleOrFloat.sig.kt.txt @@ -0,0 +1,16 @@ +// CHECK JVM_IR: +// Mangled name: #testD(kotlin.Comparable;kotlin.Comparable){}kotlin.Boolean +// Public signature: /testD|-8334682674453061094[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testD(kotlin.Comparable;kotlin.Comparable){} +// Public signature: /testD|6420307726503450357[0] +fun testD(x: Comparable, y: Comparable): Boolean + +// CHECK JVM_IR: +// Mangled name: #testF(kotlin.Comparable;kotlin.Comparable){}kotlin.Boolean +// Public signature: /testF|2241994539085447467[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testF(kotlin.Comparable;kotlin.Comparable){} +// Public signature: /testF|5734029490201124122[0] +fun testF(x: Comparable, y: Comparable): Boolean + diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/eqeqRhsConditionPossiblyAffectingLhs.sig.kt.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/eqeqRhsConditionPossiblyAffectingLhs.sig.kt.txt new file mode 100644 index 00000000000..ac8684c1ddb --- /dev/null +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/eqeqRhsConditionPossiblyAffectingLhs.sig.kt.txt @@ -0,0 +1,8 @@ +// CHECK JVM_IR: +// Mangled name: #test(kotlin.Any){}kotlin.Boolean +// Public signature: /test|1012595665164220820[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test(kotlin.Any){} +// Public signature: /test|-7985792749252989017[0] +fun test(x: Any): Boolean + diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.sig.kt.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.sig.kt.txt new file mode 100644 index 00000000000..18391fc0b72 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.sig.kt.txt @@ -0,0 +1,88 @@ +// CHECK JVM_IR: +// Mangled name: #test1d(kotlin.Double;kotlin.Double){}kotlin.Int +// Public signature: /test1d|1918027866721027919[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1d(kotlin.Double;kotlin.Double){} +// Public signature: /test1d|8996428331240250899[0] +fun test1d(x: Double, y: Double): Int + +// CHECK JVM_IR: +// Mangled name: #test1f(kotlin.Float;kotlin.Float){}kotlin.Int +// Public signature: /test1f|5423428835300813429[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1f(kotlin.Float;kotlin.Float){} +// Public signature: /test1f|3996419052229966122[0] +fun test1f(x: Float, y: Float): Int + +// CHECK JVM_IR: +// Mangled name: #test1fr@kotlin.Float(kotlin.Float){}kotlin.Int +// Public signature: /test1fr|-1774976204846015291[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1fr@kotlin.Float(kotlin.Float){} +// Public signature: /test1fr|-5309606232782328951[0] +fun Float.test1fr(x: Float): Int + +// CHECK JVM_IR: +// Mangled name: #test2d(kotlin.Double;kotlin.Any){}kotlin.Boolean +// Public signature: /test2d|1868332233853062954[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2d(kotlin.Double;kotlin.Any){} +// Public signature: /test2d|3048714195566850595[0] +fun test2d(x: Double, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test2f(kotlin.Float;kotlin.Any){}kotlin.Boolean +// Public signature: /test2f|-5327474494142874991[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2f(kotlin.Float;kotlin.Any){} +// Public signature: /test2f|-8233698539945437419[0] +fun test2f(x: Float, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test2fr@kotlin.Float(kotlin.Any){}kotlin.Boolean +// Public signature: /test2fr|-124673155428987679[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2fr@kotlin.Float(kotlin.Any){} +// Public signature: /test2fr|5632769814565198925[0] +fun Float.test2fr(x: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test3d(kotlin.Any;kotlin.Any){}kotlin.Boolean +// Public signature: /test3d|-5073128912492477196[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3d(kotlin.Any;kotlin.Any){} +// Public signature: /test3d|1265476561252316973[0] +fun test3d(x: Any, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test3f(kotlin.Any;kotlin.Any){}kotlin.Boolean +// Public signature: /test3f|1058712547644060622[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3f(kotlin.Any;kotlin.Any){} +// Public signature: /test3f|-4162669948505292416[0] +fun test3f(x: Any, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test3fr@kotlin.Float(kotlin.Any){}kotlin.Boolean +// Public signature: /test3fr|1133351613663431340[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3fr@kotlin.Float(kotlin.Any){} +// Public signature: /test3fr|-4692729798478355645[0] +fun Float.test3fr(x: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #testDF(kotlin.Any;kotlin.Any){}kotlin.Boolean +// Public signature: /testDF|9162091323093859710[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testDF(kotlin.Any;kotlin.Any){} +// Public signature: /testDF|5325280582850746470[0] +fun testDF(x: Any, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #testFD(kotlin.Any;kotlin.Any){}kotlin.Boolean +// Public signature: /testFD|-1860793291456176126[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testFD(kotlin.Any;kotlin.Any){} +// Public signature: /testFD|-8637640662829760144[0] +fun testFD(x: Any, y: Any): Boolean + diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.sig.kt.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.sig.kt.txt new file mode 100644 index 00000000000..8f2088cf793 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.sig.kt.txt @@ -0,0 +1,112 @@ +// CHECK JVM_IR: +// Mangled name: #test1d(kotlin.Double;kotlin.Double){}kotlin.Boolean +// Public signature: /test1d|-6076864717398730791[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1d(kotlin.Double;kotlin.Double){} +// Public signature: /test1d|8996428331240250899[0] +fun test1d(x: Double, y: Double): Boolean + +// CHECK JVM_IR: +// Mangled name: #test1f(kotlin.Float;kotlin.Float){}kotlin.Boolean +// Public signature: /test1f|-2409682264718997877[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1f(kotlin.Float;kotlin.Float){} +// Public signature: /test1f|3996419052229966122[0] +fun test1f(x: Float, y: Float): Boolean + +// CHECK JVM_IR: +// Mangled name: #test2d(kotlin.Double;kotlin.Double?){}kotlin.Boolean +// Public signature: /test2d|486392787565228433[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2d(kotlin.Double;kotlin.Double?){} +// Public signature: /test2d|5216353050929315910[0] +fun test2d(x: Double, y: Double?): Boolean + +// CHECK JVM_IR: +// Mangled name: #test2f(kotlin.Float;kotlin.Float?){}kotlin.Boolean +// Public signature: /test2f|-1096698028658974991[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2f(kotlin.Float;kotlin.Float?){} +// Public signature: /test2f|-1844252481919023798[0] +fun test2f(x: Float, y: Float?): Boolean + +// CHECK JVM_IR: +// Mangled name: #test3d(kotlin.Double;kotlin.Any){}kotlin.Boolean +// Public signature: /test3d|-7647993882327577455[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3d(kotlin.Double;kotlin.Any){} +// Public signature: /test3d|8418867848024398421[0] +fun test3d(x: Double, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test3f(kotlin.Float;kotlin.Any){}kotlin.Boolean +// Public signature: /test3f|-6031401993389855448[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3f(kotlin.Float;kotlin.Any){} +// Public signature: /test3f|4271846387727929079[0] +fun test3f(x: Float, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test4d(kotlin.Double;kotlin.Number){}kotlin.Boolean +// Public signature: /test4d|6663537144393076314[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test4d(kotlin.Double;kotlin.Number){} +// Public signature: /test4d|-14614379237503414[0] +fun test4d(x: Double, y: Number): Boolean + +// CHECK JVM_IR: +// Mangled name: #test4f(kotlin.Float;kotlin.Number){}kotlin.Boolean +// Public signature: /test4f|3595885060539941485[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test4f(kotlin.Float;kotlin.Number){} +// Public signature: /test4f|8833004791687011909[0] +fun test4f(x: Float, y: Number): Boolean + +// CHECK JVM_IR: +// Mangled name: #test5d(kotlin.Double;kotlin.Any){}kotlin.Boolean +// Public signature: /test5d|3958951524111099104[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test5d(kotlin.Double;kotlin.Any){} +// Public signature: /test5d|8194261571129163015[0] +fun test5d(x: Double, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test5f(kotlin.Float;kotlin.Any){}kotlin.Boolean +// Public signature: /test5f|3370721745745603328[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test5f(kotlin.Float;kotlin.Any){} +// Public signature: /test5f|1275090490894066717[0] +fun test5f(x: Float, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test6d(kotlin.Any;kotlin.Any){}kotlin.Boolean +// Public signature: /test6d|4973138391607645243[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test6d(kotlin.Any;kotlin.Any){} +// Public signature: /test6d|-2043957087845204486[0] +fun test6d(x: Any, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test6f(kotlin.Any;kotlin.Any){}kotlin.Boolean +// Public signature: /test6f|-4566736704199373988[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test6f(kotlin.Any;kotlin.Any){} +// Public signature: /test6f|3266287064971521993[0] +fun test6f(x: Any, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #testDF(kotlin.Any;kotlin.Any){}kotlin.Boolean +// Public signature: /testDF|9162091323093859710[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testDF(kotlin.Any;kotlin.Any){} +// Public signature: /testDF|5325280582850746470[0] +fun testDF(x: Any, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #testFD(kotlin.Any;kotlin.Any){}kotlin.Boolean +// Public signature: /testFD|-1860793291456176126[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testFD(kotlin.Any;kotlin.Any){} +// Public signature: /testFD|-8637640662829760144[0] +fun testFD(x: Any, y: Any): Boolean + diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.sig.kt.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.sig.kt.txt new file mode 100644 index 00000000000..18870dfdb50 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.sig.kt.txt @@ -0,0 +1,160 @@ +// CHECK JVM_IR: +// Mangled name: #test1d(kotlin.Double;kotlin.Double){}kotlin.Boolean +// Public signature: /test1d|-6076864717398730791[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1d(kotlin.Double;kotlin.Double){} +// Public signature: /test1d|8996428331240250899[0] +fun test1d(x: Double, y: Double): Boolean + +// CHECK JVM_IR: +// Mangled name: #test1f(kotlin.Float;kotlin.Float){}kotlin.Boolean +// Public signature: /test1f|-2409682264718997877[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1f(kotlin.Float;kotlin.Float){} +// Public signature: /test1f|3996419052229966122[0] +fun test1f(x: Float, y: Float): Boolean + +// CHECK JVM_IR: +// Mangled name: #test1fr@kotlin.Float(kotlin.Float){}kotlin.Boolean +// Public signature: /test1fr|-694393964183188653[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1fr@kotlin.Float(kotlin.Float){} +// Public signature: /test1fr|-5309606232782328951[0] +fun Float.test1fr(x: Float): Boolean + +// CHECK JVM_IR: +// Mangled name: #test2d(kotlin.Double;kotlin.Double?){}kotlin.Boolean +// Public signature: /test2d|486392787565228433[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2d(kotlin.Double;kotlin.Double?){} +// Public signature: /test2d|5216353050929315910[0] +fun test2d(x: Double, y: Double?): Boolean + +// CHECK JVM_IR: +// Mangled name: #test2f(kotlin.Float;kotlin.Float?){}kotlin.Boolean +// Public signature: /test2f|-1096698028658974991[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2f(kotlin.Float;kotlin.Float?){} +// Public signature: /test2f|-1844252481919023798[0] +fun test2f(x: Float, y: Float?): Boolean + +// CHECK JVM_IR: +// Mangled name: #test2fr@kotlin.Float(kotlin.Float?){}kotlin.Boolean +// Public signature: /test2fr|-7195652255237968185[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2fr@kotlin.Float(kotlin.Float?){} +// Public signature: /test2fr|8105810680059260874[0] +fun Float.test2fr(x: Float?): Boolean + +// CHECK JVM_IR: +// Mangled name: #test3d(kotlin.Double;kotlin.Any){}kotlin.Boolean +// Public signature: /test3d|-7647993882327577455[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3d(kotlin.Double;kotlin.Any){} +// Public signature: /test3d|8418867848024398421[0] +fun test3d(x: Double, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test3f(kotlin.Float;kotlin.Any){}kotlin.Boolean +// Public signature: /test3f|-6031401993389855448[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3f(kotlin.Float;kotlin.Any){} +// Public signature: /test3f|4271846387727929079[0] +fun test3f(x: Float, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test3fr@kotlin.Float(kotlin.Any){}kotlin.Boolean +// Public signature: /test3fr|1133351613663431340[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3fr@kotlin.Float(kotlin.Any){} +// Public signature: /test3fr|-4692729798478355645[0] +fun Float.test3fr(x: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test4d(kotlin.Double;kotlin.Number){}kotlin.Boolean +// Public signature: /test4d|6663537144393076314[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test4d(kotlin.Double;kotlin.Number){} +// Public signature: /test4d|-14614379237503414[0] +fun test4d(x: Double, y: Number): Boolean + +// CHECK JVM_IR: +// Mangled name: #test4f(kotlin.Float;kotlin.Number){}kotlin.Boolean +// Public signature: /test4f|3595885060539941485[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test4f(kotlin.Float;kotlin.Number){} +// Public signature: /test4f|8833004791687011909[0] +fun test4f(x: Float, y: Number): Boolean + +// CHECK JVM_IR: +// Mangled name: #test4fr@kotlin.Float(kotlin.Number){}kotlin.Boolean +// Public signature: /test4fr|4585384914379603000[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test4fr@kotlin.Float(kotlin.Number){} +// Public signature: /test4fr|-8697981594077900342[0] +fun Float.test4fr(x: Number): Boolean + +// CHECK JVM_IR: +// Mangled name: #test5d(kotlin.Double;kotlin.Any){}kotlin.Boolean +// Public signature: /test5d|3958951524111099104[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test5d(kotlin.Double;kotlin.Any){} +// Public signature: /test5d|8194261571129163015[0] +fun test5d(x: Double, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test5f(kotlin.Float;kotlin.Any){}kotlin.Boolean +// Public signature: /test5f|3370721745745603328[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test5f(kotlin.Float;kotlin.Any){} +// Public signature: /test5f|1275090490894066717[0] +fun test5f(x: Float, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test5fr@kotlin.Float(kotlin.Any){}kotlin.Boolean +// Public signature: /test5fr|-7273239139732099583[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test5fr@kotlin.Float(kotlin.Any){} +// Public signature: /test5fr|7675506717999064449[0] +fun Float.test5fr(x: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test6d(kotlin.Any;kotlin.Any){}kotlin.Boolean +// Public signature: /test6d|4973138391607645243[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test6d(kotlin.Any;kotlin.Any){} +// Public signature: /test6d|-2043957087845204486[0] +fun test6d(x: Any, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test6f(kotlin.Any;kotlin.Any){}kotlin.Boolean +// Public signature: /test6f|-4566736704199373988[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test6f(kotlin.Any;kotlin.Any){} +// Public signature: /test6f|3266287064971521993[0] +fun test6f(x: Any, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test6fr@kotlin.Float(kotlin.Any){}kotlin.Boolean +// Public signature: /test6fr|-6547972600052106597[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test6fr@kotlin.Float(kotlin.Any){} +// Public signature: /test6fr|3433734513009429332[0] +fun Float.test6fr(x: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #testDF(kotlin.Any;kotlin.Any){}kotlin.Boolean +// Public signature: /testDF|9162091323093859710[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testDF(kotlin.Any;kotlin.Any){} +// Public signature: /testDF|5325280582850746470[0] +fun testDF(x: Any, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #testFD(kotlin.Any;kotlin.Any){}kotlin.Boolean +// Public signature: /testFD|-1860793291456176126[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testFD(kotlin.Any;kotlin.Any){} +// Public signature: /testFD|-8637640662829760144[0] +fun testFD(x: Any, y: Any): Boolean + diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.sig.kt.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.sig.kt.txt new file mode 100644 index 00000000000..8f2088cf793 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.sig.kt.txt @@ -0,0 +1,112 @@ +// CHECK JVM_IR: +// Mangled name: #test1d(kotlin.Double;kotlin.Double){}kotlin.Boolean +// Public signature: /test1d|-6076864717398730791[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1d(kotlin.Double;kotlin.Double){} +// Public signature: /test1d|8996428331240250899[0] +fun test1d(x: Double, y: Double): Boolean + +// CHECK JVM_IR: +// Mangled name: #test1f(kotlin.Float;kotlin.Float){}kotlin.Boolean +// Public signature: /test1f|-2409682264718997877[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1f(kotlin.Float;kotlin.Float){} +// Public signature: /test1f|3996419052229966122[0] +fun test1f(x: Float, y: Float): Boolean + +// CHECK JVM_IR: +// Mangled name: #test2d(kotlin.Double;kotlin.Double?){}kotlin.Boolean +// Public signature: /test2d|486392787565228433[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2d(kotlin.Double;kotlin.Double?){} +// Public signature: /test2d|5216353050929315910[0] +fun test2d(x: Double, y: Double?): Boolean + +// CHECK JVM_IR: +// Mangled name: #test2f(kotlin.Float;kotlin.Float?){}kotlin.Boolean +// Public signature: /test2f|-1096698028658974991[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2f(kotlin.Float;kotlin.Float?){} +// Public signature: /test2f|-1844252481919023798[0] +fun test2f(x: Float, y: Float?): Boolean + +// CHECK JVM_IR: +// Mangled name: #test3d(kotlin.Double;kotlin.Any){}kotlin.Boolean +// Public signature: /test3d|-7647993882327577455[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3d(kotlin.Double;kotlin.Any){} +// Public signature: /test3d|8418867848024398421[0] +fun test3d(x: Double, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test3f(kotlin.Float;kotlin.Any){}kotlin.Boolean +// Public signature: /test3f|-6031401993389855448[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3f(kotlin.Float;kotlin.Any){} +// Public signature: /test3f|4271846387727929079[0] +fun test3f(x: Float, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test4d(kotlin.Double;kotlin.Number){}kotlin.Boolean +// Public signature: /test4d|6663537144393076314[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test4d(kotlin.Double;kotlin.Number){} +// Public signature: /test4d|-14614379237503414[0] +fun test4d(x: Double, y: Number): Boolean + +// CHECK JVM_IR: +// Mangled name: #test4f(kotlin.Float;kotlin.Number){}kotlin.Boolean +// Public signature: /test4f|3595885060539941485[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test4f(kotlin.Float;kotlin.Number){} +// Public signature: /test4f|8833004791687011909[0] +fun test4f(x: Float, y: Number): Boolean + +// CHECK JVM_IR: +// Mangled name: #test5d(kotlin.Double;kotlin.Any){}kotlin.Boolean +// Public signature: /test5d|3958951524111099104[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test5d(kotlin.Double;kotlin.Any){} +// Public signature: /test5d|8194261571129163015[0] +fun test5d(x: Double, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test5f(kotlin.Float;kotlin.Any){}kotlin.Boolean +// Public signature: /test5f|3370721745745603328[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test5f(kotlin.Float;kotlin.Any){} +// Public signature: /test5f|1275090490894066717[0] +fun test5f(x: Float, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test6d(kotlin.Any;kotlin.Any){}kotlin.Boolean +// Public signature: /test6d|4973138391607645243[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test6d(kotlin.Any;kotlin.Any){} +// Public signature: /test6d|-2043957087845204486[0] +fun test6d(x: Any, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test6f(kotlin.Any;kotlin.Any){}kotlin.Boolean +// Public signature: /test6f|-4566736704199373988[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test6f(kotlin.Any;kotlin.Any){} +// Public signature: /test6f|3266287064971521993[0] +fun test6f(x: Any, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #testDF(kotlin.Any;kotlin.Any){}kotlin.Boolean +// Public signature: /testDF|9162091323093859710[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testDF(kotlin.Any;kotlin.Any){} +// Public signature: /testDF|5325280582850746470[0] +fun testDF(x: Any, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #testFD(kotlin.Any;kotlin.Any){}kotlin.Boolean +// Public signature: /testFD|-1860793291456176126[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testFD(kotlin.Any;kotlin.Any){} +// Public signature: /testFD|-8637640662829760144[0] +fun testFD(x: Any, y: Any): Boolean + diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointLess.sig.kt.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointLess.sig.kt.txt new file mode 100644 index 00000000000..32735f0e47b --- /dev/null +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointLess.sig.kt.txt @@ -0,0 +1,64 @@ +// CHECK JVM_IR: +// Mangled name: #test1d(kotlin.Double;kotlin.Double){}kotlin.Boolean +// Public signature: /test1d|-6076864717398730791[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1d(kotlin.Double;kotlin.Double){} +// Public signature: /test1d|8996428331240250899[0] +fun test1d(x: Double, y: Double): Boolean + +// CHECK JVM_IR: +// Mangled name: #test1f(kotlin.Float;kotlin.Float){}kotlin.Boolean +// Public signature: /test1f|-2409682264718997877[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1f(kotlin.Float;kotlin.Float){} +// Public signature: /test1f|3996419052229966122[0] +fun test1f(x: Float, y: Float): Boolean + +// CHECK JVM_IR: +// Mangled name: #test2d(kotlin.Double;kotlin.Any){}kotlin.Boolean +// Public signature: /test2d|1868332233853062954[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2d(kotlin.Double;kotlin.Any){} +// Public signature: /test2d|3048714195566850595[0] +fun test2d(x: Double, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test2f(kotlin.Float;kotlin.Any){}kotlin.Boolean +// Public signature: /test2f|-5327474494142874991[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2f(kotlin.Float;kotlin.Any){} +// Public signature: /test2f|-8233698539945437419[0] +fun test2f(x: Float, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test3d(kotlin.Any;kotlin.Any){}kotlin.Boolean +// Public signature: /test3d|-5073128912492477196[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3d(kotlin.Any;kotlin.Any){} +// Public signature: /test3d|1265476561252316973[0] +fun test3d(x: Any, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test3f(kotlin.Any;kotlin.Any){}kotlin.Boolean +// Public signature: /test3f|1058712547644060622[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3f(kotlin.Any;kotlin.Any){} +// Public signature: /test3f|-4162669948505292416[0] +fun test3f(x: Any, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #testDF(kotlin.Any;kotlin.Any){}kotlin.Boolean +// Public signature: /testDF|9162091323093859710[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testDF(kotlin.Any;kotlin.Any){} +// Public signature: /testDF|5325280582850746470[0] +fun testDF(x: Any, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #testFD(kotlin.Any;kotlin.Any){}kotlin.Boolean +// Public signature: /testFD|-1860793291456176126[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testFD(kotlin.Any;kotlin.Any){} +// Public signature: /testFD|-8637640662829760144[0] +fun testFD(x: Any, y: Any): Boolean + diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableAnyAsIntToDouble.sig.kt.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableAnyAsIntToDouble.sig.kt.txt new file mode 100644 index 00000000000..48c32f3e375 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableAnyAsIntToDouble.sig.kt.txt @@ -0,0 +1,8 @@ +// CHECK JVM_IR: +// Mangled name: #test(kotlin.Any?;kotlin.Double){}kotlin.Boolean +// Public signature: /test|-7959242928029112066[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test(kotlin.Any?;kotlin.Double){} +// Public signature: /test|1382550638358700070[0] +fun test(x: Any?, y: Double): Boolean + diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableFloatingPointEqeq.sig.kt.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableFloatingPointEqeq.sig.kt.txt new file mode 100644 index 00000000000..84206788a8a --- /dev/null +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableFloatingPointEqeq.sig.kt.txt @@ -0,0 +1,32 @@ +// CHECK JVM_IR: +// Mangled name: #testDD(kotlin.Double?;kotlin.Double?){}kotlin.Boolean +// Public signature: /testDD|6324676724672008011[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testDD(kotlin.Double?;kotlin.Double?){} +// Public signature: /testDD|6448090919849267088[0] +fun testDD(x: Double?, y: Double?): Boolean + +// CHECK JVM_IR: +// Mangled name: #testDF(kotlin.Double?;kotlin.Any?){}kotlin.Boolean +// Public signature: /testDF|9116951022031676909[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testDF(kotlin.Double?;kotlin.Any?){} +// Public signature: /testDF|8975597351648058215[0] +fun testDF(x: Double?, y: Any?): Boolean + +// CHECK JVM_IR: +// Mangled name: #testDI(kotlin.Double?;kotlin.Any?){}kotlin.Boolean +// Public signature: /testDI|-2518117290397712484[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testDI(kotlin.Double?;kotlin.Any?){} +// Public signature: /testDI|-2492360038280217235[0] +fun testDI(x: Double?, y: Any?): Boolean + +// CHECK JVM_IR: +// Mangled name: #testDI2(kotlin.Any?;kotlin.Any?){}kotlin.Boolean +// Public signature: /testDI2|5408730355929274743[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testDI2(kotlin.Any?;kotlin.Any?){} +// Public signature: /testDI2|-1156893754545330465[0] +fun testDI2(x: Any?, y: Any?): Boolean + diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.sig.kt.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.sig.kt.txt new file mode 100644 index 00000000000..20f7ec75d4b --- /dev/null +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.sig.kt.txt @@ -0,0 +1,75 @@ +// CHECK: +// Mangled name: F +// Public signature: /F|null[0] +class F { + // CHECK: + // Mangled name: F#(){} + // Public signature: /F.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: F#testCapturedType(1:0;kotlin.Any){}kotlin.Boolean + // Public signature: /F.testCapturedType|7998726618500557854[0] + // CHECK JS_IR NATIVE: + // Mangled name: F#testCapturedType(1:0;kotlin.Any){} + // Public signature: /F.testCapturedType|-5279256819944815124[0] + fun testCapturedType(x: T, y: Any): Boolean + +} + +// CHECK JVM_IR: +// Mangled name: #test0(kotlin.Any;0:0){0§}kotlin.Boolean +// Public signature: /test0|-7214751938385730433[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test0(kotlin.Any;0:0){0§} +// Public signature: /test0|-6494678230253547579[0] +fun test0(x: Any, y: T): Boolean + +// CHECK JVM_IR: +// Mangled name: #test1(kotlin.Any;0:0){0§}kotlin.Boolean +// Public signature: /test1|8387349745943080134[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1(kotlin.Any;0:0){0§} +// Public signature: /test1|-7902069641491444047[0] +fun test1(x: Any, y: T): Boolean + +// CHECK JVM_IR: +// Mangled name: #test2(kotlin.Any;0:0){0§}kotlin.Boolean +// Public signature: /test2|3344527840705297453[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2(kotlin.Any;0:0){0§} +// Public signature: /test2|-2365905883998625988[0] +fun test2(x: Any, y: T): Boolean + +// CHECK JVM_IR: +// Mangled name: #test3(kotlin.Any;0:0){0§}kotlin.Boolean +// Public signature: /test3|4021301847597929251[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3(kotlin.Any;0:0){0§} +// Public signature: /test3|5264389487564885422[0] +fun test3(x: Any, y: T): Boolean + +// CHECK JVM_IR: +// Mangled name: #test4(kotlin.Any;0:0){0§}kotlin.Boolean +// Public signature: /test4|6659113294374869639[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test4(kotlin.Any;0:0){0§} +// Public signature: /test4|9214831392286021674[0] +fun test4(x: Any, y: T): Boolean + +// CHECK JVM_IR: +// Mangled name: #test5(kotlin.Any;0:1){0§;1§<0:0>}kotlin.Boolean +// Public signature: /test5|-5393606181119122055[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test5(kotlin.Any;0:1){0§;1§<0:0>} +// Public signature: /test5|-5498926079719286371[0] +fun test5(x: Any, y: R): Boolean + +// CHECK JVM_IR: +// Mangled name: #test6(kotlin.Any;0:0){0§}kotlin.Boolean +// Public signature: /test6|7328266218747057888[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test6(kotlin.Any;0:0){0§} +// Public signature: /test6|-2167191220335209779[0] +fun test6(x: Any, y: T): Boolean + diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.sig.kt.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.sig.kt.txt new file mode 100644 index 00000000000..23133c90952 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.sig.kt.txt @@ -0,0 +1,56 @@ +// CHECK JVM_IR: +// Mangled name: #foo(kotlin.Double){}kotlin.Double +// Public signature: /foo|1917451337252472224[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo(kotlin.Double){} +// Public signature: /foo|7304084990235995798[0] +fun foo(x: Double): Double + +// CHECK JVM_IR: +// Mangled name: #testSimple(kotlin.Double){}kotlin.Int +// Public signature: /testSimple|7182738722897187971[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testSimple(kotlin.Double){} +// Public signature: /testSimple|9121439682501266260[0] +fun testSimple(x: Double): Int + +// CHECK JVM_IR: +// Mangled name: #testSmartCastInWhenCondition(kotlin.Double;kotlin.Any){}kotlin.Int +// Public signature: /testSmartCastInWhenCondition|7854851848186858587[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testSmartCastInWhenCondition(kotlin.Double;kotlin.Any){} +// Public signature: /testSmartCastInWhenCondition|-9013687204664969001[0] +fun testSmartCastInWhenCondition(x: Double, y: Any): Int + +// CHECK JVM_IR: +// Mangled name: #testSmartCastInWhenConditionInBranch(kotlin.Any){}kotlin.Int +// Public signature: /testSmartCastInWhenConditionInBranch|5671837591576771954[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testSmartCastInWhenConditionInBranch(kotlin.Any){} +// Public signature: /testSmartCastInWhenConditionInBranch|1656824350278623177[0] +fun testSmartCastInWhenConditionInBranch(x: Any): Int + +// CHECK JVM_IR: +// Mangled name: #testSmartCastInWhenSubject(kotlin.Any){}kotlin.Int +// Public signature: /testSmartCastInWhenSubject|5050233636010761247[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testSmartCastInWhenSubject(kotlin.Any){} +// Public signature: /testSmartCastInWhenSubject|-654930493818491506[0] +fun testSmartCastInWhenSubject(x: Any): Int + +// CHECK JVM_IR: +// Mangled name: #testSmartCastToDifferentTypes(kotlin.Any;kotlin.Any){}kotlin.Int +// Public signature: /testSmartCastToDifferentTypes|285815180648163500[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testSmartCastToDifferentTypes(kotlin.Any;kotlin.Any){} +// Public signature: /testSmartCastToDifferentTypes|8938507225260152421[0] +fun testSmartCastToDifferentTypes(x: Any, y: Any): Int + +// CHECK JVM_IR: +// Mangled name: #testWithPrematureExitInConditionSubexpression(kotlin.Any){}kotlin.Int +// Public signature: /testWithPrematureExitInConditionSubexpression|-7044982830298293879[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testWithPrematureExitInConditionSubexpression(kotlin.Any){} +// Public signature: /testWithPrematureExitInConditionSubexpression|-3701426985229225590[0] +fun testWithPrematureExitInConditionSubexpression(x: Any): Int + diff --git a/compiler/testData/ir/irText/expressions/for.sig.kt.txt b/compiler/testData/ir/irText/expressions/for.sig.kt.txt new file mode 100644 index 00000000000..096226320e4 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/for.sig.kt.txt @@ -0,0 +1,20 @@ +// CHECK: +// Mangled name: #testDestructuring(kotlin.collections.List>){} +// Public signature: /testDestructuring|-7027332132873483477[0] +fun testDestructuring(pp: List>): Unit + +// CHECK: +// Mangled name: #testEmpty(kotlin.collections.List){} +// Public signature: /testEmpty|4311987365375111339[0] +fun testEmpty(ss: List): Unit + +// CHECK: +// Mangled name: #testIterable(kotlin.collections.List){} +// Public signature: /testIterable|3066285127841729695[0] +fun testIterable(ss: List): Unit + +// CHECK: +// Mangled name: #testRange(){} +// Public signature: /testRange|5870058580411114415[0] +fun testRange(): Unit + diff --git a/compiler/testData/ir/irText/expressions/forWithBreakContinue.sig.kt.txt b/compiler/testData/ir/irText/expressions/forWithBreakContinue.sig.kt.txt new file mode 100644 index 00000000000..f47dea58dac --- /dev/null +++ b/compiler/testData/ir/irText/expressions/forWithBreakContinue.sig.kt.txt @@ -0,0 +1,20 @@ +// CHECK: +// Mangled name: #testForBreak1(kotlin.collections.List){} +// Public signature: /testForBreak1|859715268937219552[0] +fun testForBreak1(ss: List): Unit + +// CHECK: +// Mangled name: #testForBreak2(kotlin.collections.List){} +// Public signature: /testForBreak2|-8316570653848899578[0] +fun testForBreak2(ss: List): Unit + +// CHECK: +// Mangled name: #testForContinue1(kotlin.collections.List){} +// Public signature: /testForContinue1|1338147304246344442[0] +fun testForContinue1(ss: List): Unit + +// CHECK: +// Mangled name: #testForContinue2(kotlin.collections.List){} +// Public signature: /testForContinue2|-2490600607304201756[0] +fun testForContinue2(ss: List): Unit + diff --git a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.sig.kt.txt b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.sig.kt.txt new file mode 100644 index 00000000000..5e6537911ed --- /dev/null +++ b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.sig.kt.txt @@ -0,0 +1,74 @@ +// CHECK: +// Mangled name: IntCell +// Public signature: /IntCell|null[0] +class IntCell { + // CHECK: + // Mangled name: IntCell{}value + // Public signature: /IntCell.value|1987073854177347439[0] + var value: Int + // CHECK JVM_IR: + // Mangled name: IntCell#(){}kotlin.Int + // Public signature: /IntCell.value.|-5900028706170996[0] + // CHECK JS_IR NATIVE: + // Mangled name: IntCell#(){} + // Public signature: /IntCell.value.|3260093555963109437[0] + get + // CHECK: + // Mangled name: IntCell#(kotlin.Int){} + // Public signature: /IntCell.value.|-195057410739577239[0] + set + + // CHECK: + // Mangled name: IntCell#(kotlin.Int){} + // Public signature: /IntCell.|-5182794243525578284[0] + constructor(value: Int) /* primary */ + +} + +// CHECK: +// Mangled name: IReceiver +// Public signature: /IReceiver|null[0] +interface IReceiver { + + // CHECK JVM_IR: + // Mangled name: IReceiver#hasNext@IntCell(){}kotlin.Boolean + // Public signature: /IReceiver.hasNext|8807543829800046753[0] + // CHECK JS_IR NATIVE: + // Mangled name: IReceiver#hasNext@IntCell(){} + // Public signature: /IReceiver.hasNext|4886533440515007751[0] + operator fun IntCell.hasNext(): Boolean + + // CHECK JVM_IR: + // Mangled name: IReceiver#iterator@FiveTimes(){}IntCell + // Public signature: /IReceiver.iterator|-6854781980601462817[0] + // CHECK JS_IR NATIVE: + // Mangled name: IReceiver#iterator@FiveTimes(){} + // Public signature: /IReceiver.iterator|-6775444143424139294[0] + operator fun FiveTimes.iterator(): IntCell + + // CHECK JVM_IR: + // Mangled name: IReceiver#next@IntCell(){}kotlin.Int + // Public signature: /IReceiver.next|-2134453721443530519[0] + // CHECK JS_IR NATIVE: + // Mangled name: IReceiver#next@IntCell(){} + // Public signature: /IReceiver.next|3171952556520323113[0] + operator fun IntCell.next(): Int + +} + +// CHECK: +// Mangled name: FiveTimes +// Public signature: /FiveTimes|null[0] +object FiveTimes { + // CHECK: + // Mangled name: FiveTimes#(){} + // Public signature: /FiveTimes.|-5645683436151566731[0] + private constructor() /* primary */ + +} + +// CHECK: +// Mangled name: #test@IReceiver(){} +// Public signature: /test|-5472672617978108350[0] +fun IReceiver.test(): Unit + diff --git a/compiler/testData/ir/irText/expressions/funImportedFromObject.kt b/compiler/testData/ir/irText/expressions/funImportedFromObject.kt index 759dbd03d86..907c3e3ad4d 100644 --- a/compiler/testData/ir/irText/expressions/funImportedFromObject.kt +++ b/compiler/testData/ir/irText/expressions/funImportedFromObject.kt @@ -1,4 +1,8 @@ // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR +// ^ KT-57433 + package test import test.Host.foo diff --git a/compiler/testData/ir/irText/expressions/funImportedFromObject.sig.kt.txt b/compiler/testData/ir/irText/expressions/funImportedFromObject.sig.kt.txt new file mode 100644 index 00000000000..ec2581d0071 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/funImportedFromObject.sig.kt.txt @@ -0,0 +1,29 @@ +package test + +// CHECK: +// Mangled name: test.Host +// Public signature: test/Host|null[0] +object Host { + // CHECK: + // Mangled name: test.Host#(){} + // Public signature: test/Host.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: test.Host#foo(){0§}kotlin.String + // Public signature: test/Host.foo|-170825690606698604[0] + // CHECK JS_IR NATIVE: + // Mangled name: test.Host#foo(){0§} + // Public signature: test/Host.foo|-7822584347064313243[0] + inline fun foo(): String + +} + +// CHECK JVM_IR: +// Mangled name: test#test(){}kotlin.String +// Public signature: test/test|-7008832412320199001[0] +// CHECK JS_IR NATIVE: +// Mangled name: test#test(){} +// Public signature: test/test|6620506149988718649[0] +fun test(): String + diff --git a/compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.sig.kt.txt b/compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.sig.kt.txt new file mode 100644 index 00000000000..5c5ab107ff6 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.sig.kt.txt @@ -0,0 +1,27 @@ +// CHECK: +// Mangled name: IRunnable +// Public signature: /IRunnable|null[0] +fun interface IRunnable { + + // CHECK: + // Mangled name: IRunnable#run(){} + // Public signature: /IRunnable.run|-991178076551934874[0] + abstract fun run(): Unit + +} + +// CHECK: +// Mangled name: #foo1(IRunnable;kotlin.Array...){} +// Public signature: /foo1|8109256075034655920[0] +fun foo1(r: IRunnable, vararg s: String): Unit + +// CHECK: +// Mangled name: #foo2(IRunnable;IRunnable;kotlin.Array...){} +// Public signature: /foo2|-847052428556006975[0] +fun foo2(r1: IRunnable, r2: IRunnable, vararg s: String): Unit + +// CHECK: +// Mangled name: #test(kotlin.Function0;IRunnable;kotlin.String;kotlin.Array){} +// Public signature: /test|8261026842322841823[0] +fun test(fn: Function0, r: IRunnable, s: String, arr: Array): Unit + diff --git a/compiler/testData/ir/irText/expressions/funInterface/basicFunInterfaceConversion.kt b/compiler/testData/ir/irText/expressions/funInterface/basicFunInterfaceConversion.kt index 55eb2be084e..08c1b955c4e 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/basicFunInterfaceConversion.kt +++ b/compiler/testData/ir/irText/expressions/funInterface/basicFunInterfaceConversion.kt @@ -1,4 +1,8 @@ // FIR_IDENTICAL +// DUMP_LOCAL_DECLARATION_SIGNATURES + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57428 fun interface Foo { fun invoke(): String diff --git a/compiler/testData/ir/irText/expressions/funInterface/basicFunInterfaceConversion.sig.kt.txt b/compiler/testData/ir/irText/expressions/funInterface/basicFunInterfaceConversion.sig.kt.txt new file mode 100644 index 00000000000..1f1fa1a1fc8 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/funInterface/basicFunInterfaceConversion.sig.kt.txt @@ -0,0 +1,36 @@ +// CHECK: +// Mangled name: Foo +// Public signature: /Foo|null[0] +fun interface Foo { + + // CHECK JVM_IR: + // Mangled name: Foo#invoke(){}kotlin.String + // Public signature: /Foo.invoke|8861605044563078664[0] + // CHECK JS_IR NATIVE: + // Mangled name: Foo#invoke(){} + // Public signature: /Foo.invoke|-4663091332620260873[0] + abstract fun invoke(): String + +} + +// CHECK JVM_IR: +// Mangled name: #foo(Foo){}kotlin.String +// Public signature: /foo|-5888774885663875480[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo(Foo){} +// Public signature: /foo|-8233162121880232317[0] +fun foo(f: Foo): String + +// CHECK JVM_IR: +// Mangled name: #test(){}kotlin.String +// Public signature: /test|-7008832412320199001[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): String + // CHECK JVM_IR: + // Mangled name: #test(){}kotlin.String##static(){}kotlin.String + // CHECK JS_IR NATIVE: + // Mangled name: #test(){}##static(){} + local fun (): String + diff --git a/compiler/testData/ir/irText/expressions/funInterface/castFromAny.sig.kt.txt b/compiler/testData/ir/irText/expressions/funInterface/castFromAny.sig.kt.txt new file mode 100644 index 00000000000..d5651884411 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/funInterface/castFromAny.sig.kt.txt @@ -0,0 +1,17 @@ +// CHECK: +// Mangled name: KRunnable +// Public signature: /KRunnable|null[0] +fun interface KRunnable { + + // CHECK: + // Mangled name: KRunnable#invoke(){} + // Public signature: /KRunnable.invoke|-4663091332620260873[0] + abstract fun invoke(): Unit + +} + +// CHECK: +// Mangled name: #test(kotlin.Any?){} +// Public signature: /test|4942271194395271693[0] +fun test(a: Any?): Unit + diff --git a/compiler/testData/ir/irText/expressions/funInterface/functionSupertype.sig.kt.txt b/compiler/testData/ir/irText/expressions/funInterface/functionSupertype.sig.kt.txt new file mode 100644 index 00000000000..13228e6263d --- /dev/null +++ b/compiler/testData/ir/irText/expressions/funInterface/functionSupertype.sig.kt.txt @@ -0,0 +1,22 @@ +// CHECK: +// Mangled name: Foo +// Public signature: /Foo|null[0] +fun interface Foo : Function0 { + + // CHECK JVM_IR: + // Mangled name: Foo#invoke(){}kotlin.Int + // Public signature: /Foo.invoke|906964710558498066[0] + abstract /* fake */ override operator fun invoke(): Int + +} + +// CHECK JVM_IR: +// Mangled name: #id(Foo){}kotlin.Any +// Public signature: /id|-7816997914602483733[0] +fun id(foo: Foo): Any + +// CHECK: +// Mangled name: #test(Foo){} +// Public signature: /test|1185534388124909890[0] +fun test(foo: Foo): Unit + diff --git a/compiler/testData/ir/irText/expressions/funInterface/partialSam.kt b/compiler/testData/ir/irText/expressions/funInterface/partialSam.kt index e6e7ec3989e..9b9a399b60e 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/partialSam.kt +++ b/compiler/testData/ir/irText/expressions/funInterface/partialSam.kt @@ -1,5 +1,9 @@ // 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/funInterface/partialSam.sig.kt.txt b/compiler/testData/ir/irText/expressions/funInterface/partialSam.sig.kt.txt new file mode 100644 index 00000000000..258ffd2f92f --- /dev/null +++ b/compiler/testData/ir/irText/expressions/funInterface/partialSam.sig.kt.txt @@ -0,0 +1,63 @@ +// CHECK: +// Mangled name: {}fsi +// Public signature: /fsi|5902301571547257746[0] +val fsi: Fn + // CHECK JVM_IR: + // Mangled name: #(){}Fn + // Public signature: /fsi.|-2546794996796226350[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /fsi.|211056100616532240[0] + get + +// CHECK: +// Mangled name: {}fis +// Public signature: /fis|4743015834142814854[0] +val fis: Fn + // CHECK JVM_IR: + // Mangled name: #(){}Fn + // Public signature: /fis.|5252092316637653538[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /fis.|-3144498278709673820[0] + get + +// CHECK: +// Mangled name: J +// Public signature: /J|null[0] +class J { + // CHECK: + // Mangled name: J#(){} + // Public signature: /J.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: J#runConversion(Fn;Fn){}kotlin.Int + // Public signature: /J.runConversion|4347513371052535712[0] + // CHECK JS_IR NATIVE: + // Mangled name: J#runConversion(Fn;Fn){} + // Public signature: /J.runConversion|-3250437629905581865[0] + fun runConversion(f1: Fn, f2: Fn): Int + +} + +// CHECK: +// Mangled name: Fn +// Public signature: /Fn|null[0] +fun interface Fn { + + // CHECK JVM_IR: + // Mangled name: Fn#run(kotlin.String;kotlin.Int;1:0){}1:1 + // Public signature: /Fn.run|6229634511602909233[0] + // CHECK JS_IR NATIVE: + // Mangled name: Fn#run(kotlin.String;kotlin.Int;1:0){} + // Public signature: /Fn.run|-3043809751901738692[0] + abstract fun run(s: String, i: Int, t: T): R + +} + +// CHECK: +// Mangled name: #test(J){} +// Public signature: /test|-8477572416399964095[0] +fun test(j: J): Unit + diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.sig.kt.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.sig.kt.txt new file mode 100644 index 00000000000..97127483505 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.sig.kt.txt @@ -0,0 +1,40 @@ +// CHECK: +// Mangled name: IFoo +// Public signature: /IFoo|null[0] +fun interface IFoo { + + // CHECK: + // Mangled name: IFoo#foo(kotlin.Int){} + // Public signature: /IFoo.foo|-104159190164110731[0] + abstract fun foo(i: Int): Unit + +} + +// CHECK: +// Mangled name: #testAdaptedCR(){} +// Public signature: /testAdaptedCR|-2000726175248606[0] +fun testAdaptedCR(): Unit + +// CHECK: +// Mangled name: #testLambda(){} +// Public signature: /testLambda|-124997257399938843[0] +fun testLambda(): Unit + +// CHECK: +// Mangled name: #testSeveralLambdas(){} +// Public signature: /testSeveralLambdas|884186753581284332[0] +fun testSeveralLambdas(): Unit + +// CHECK: +// Mangled name: #useVararg(kotlin.Array...){} +// Public signature: /useVararg|-167843892719966590[0] +fun useVararg(vararg foos: IFoo): Unit + +// CHECK JVM_IR: +// Mangled name: #withVarargOfInt(kotlin.IntArray...){}kotlin.String +// Public signature: /withVarargOfInt|-4664776409518571139[0] +// CHECK JS_IR NATIVE: +// Mangled name: #withVarargOfInt(kotlin.IntArray...){} +// Public signature: /withVarargOfInt|-232972314185863621[0] +fun withVarargOfInt(vararg xs: Int): String + diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargsMixed.sig.kt.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargsMixed.sig.kt.txt new file mode 100644 index 00000000000..eeb062d2fa6 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargsMixed.sig.kt.txt @@ -0,0 +1,22 @@ +// CHECK: +// Mangled name: MyRunnable +// Public signature: /MyRunnable|null[0] +fun interface MyRunnable { + + // CHECK: + // Mangled name: MyRunnable#run(){} + // Public signature: /MyRunnable.run|-991178076551934874[0] + abstract fun run(): Unit + +} + +// CHECK: +// Mangled name: #foo(kotlin.Array...){} +// Public signature: /foo|6689815842309055774[0] +fun foo(vararg rs: MyRunnable): Unit + +// CHECK: +// Mangled name: #test(kotlin.Any;MyRunnable){} +// Public signature: /test|-2252565057874021036[0] +fun test(a: Any, r: MyRunnable): Unit + diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.sig.kt.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.sig.kt.txt new file mode 100644 index 00000000000..9cf2cb67407 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.sig.kt.txt @@ -0,0 +1,56 @@ +// CHECK: +// Mangled name: KRunnable +// Public signature: /KRunnable|null[0] +fun interface KRunnable { + + // CHECK: + // Mangled name: KRunnable#run(){} + // Public signature: /KRunnable.run|-991178076551934874[0] + abstract fun run(): Unit + +} + +// CHECK: +// Mangled name: #foo0(){} +// Public signature: /foo0|854950155582184407[0] +fun foo0(): Unit + +// CHECK JVM_IR: +// Mangled name: #foo1(kotlin.IntArray...){}kotlin.Int +// Public signature: /foo1|7470134185704818303[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo1(kotlin.IntArray...){} +// Public signature: /foo1|-6748328364529290172[0] +fun foo1(vararg xs: Int): Int + +// CHECK JVM_IR: +// Mangled name: #testSamConstructor(){}KRunnable +// Public signature: /testSamConstructor|-5482155559435579976[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testSamConstructor(){} +// Public signature: /testSamConstructor|-7853436018033066699[0] +fun testSamConstructor(): KRunnable + +// CHECK: +// Mangled name: #testSamConversion(){} +// Public signature: /testSamConversion|8522656930427711360[0] +fun testSamConversion(): Unit + +// CHECK: +// Mangled name: #testSamConversionOnAdapted(){} +// Public signature: /testSamConversionOnAdapted|2809940309834714371[0] +fun testSamConversionOnAdapted(): Unit + +// CHECK JVM_IR: +// Mangled name: #testSamCosntructorOnAdapted(){}KRunnable +// Public signature: /testSamCosntructorOnAdapted|655519272240812814[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testSamCosntructorOnAdapted(){} +// Public signature: /testSamCosntructorOnAdapted|-7927635342265674772[0] +fun testSamCosntructorOnAdapted(): KRunnable + +// CHECK: +// Mangled name: #use(KRunnable){} +// Public signature: /use|3076420774911186780[0] +fun use(r: KRunnable): Unit + diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.sig.kt.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.sig.kt.txt new file mode 100644 index 00000000000..f5ef2cfdc48 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.sig.kt.txt @@ -0,0 +1,107 @@ +// CHECK: +// Mangled name: KRunnable +// Public signature: /KRunnable|null[0] +fun interface KRunnable { + + // CHECK: + // Mangled name: KRunnable#run(){} + // Public signature: /KRunnable.run|-991178076551934874[0] + abstract fun run(): Unit + +} + +// CHECK: +// Mangled name: Unrelated +// Public signature: /Unrelated|null[0] +interface Unrelated { + +} + +// CHECK JVM_IR: +// Mangled name: #id(0:0){0§}0:0 +// Public signature: /id|-6791396263062521506[0] +// CHECK JS_IR NATIVE: +// Mangled name: #id(0:0){0§} +// Public signature: /id|9187295668833355463[0] +fun id(x: T): T + +// CHECK: +// Mangled name: #run1(KRunnable){} +// Public signature: /run1|2612844463130679128[0] +fun run1(r: KRunnable): Unit + +// CHECK: +// Mangled name: #run2(KRunnable;KRunnable){} +// Public signature: /run2|8208068882257438869[0] +fun run2(r1: KRunnable, r2: KRunnable): Unit + +// CHECK: +// Mangled name: #test0(0:0){0§>} +// Public signature: /test0|7203793719980108226[0] +fun test0(a: T): Unit where T : KRunnable, T : Function0 + +// CHECK: +// Mangled name: #test1(kotlin.Function0){} +// Public signature: /test1|-2870537507416699845[0] +fun test1(a: Function0): Unit + +// CHECK: +// Mangled name: #test2(KRunnable){} +// Public signature: /test2|-6262171320756539088[0] +fun test2(a: KRunnable): Unit + +// CHECK: +// Mangled name: #test3(kotlin.Function0){} +// Public signature: /test3|-1760685804488672424[0] +fun test3(a: Function0): Unit + +// CHECK: +// Mangled name: #test4(kotlin.Function0;kotlin.Function0){} +// Public signature: /test4|1443124276429499957[0] +fun test4(a: Function0, b: Function0): Unit + +// CHECK: +// Mangled name: #test5(kotlin.Any){} +// Public signature: /test5|4504681808078971124[0] +fun test5(a: Any): Unit + +// CHECK: +// Mangled name: #test5x(kotlin.Any){} +// Public signature: /test5x|8044678810048210306[0] +fun test5x(a: Any): Unit + +// CHECK: +// Mangled name: #test6(kotlin.Any){} +// Public signature: /test6|-7590017673454141671[0] +fun test6(a: Any): Unit + +// CHECK: +// Mangled name: #test7(kotlin.Function1){} +// Public signature: /test7|1095013294548842913[0] +fun test7(a: Function1): Unit + +// CHECK: +// Mangled name: #test7a(0:0){0§>} +// Public signature: /test7a|4611209577080015095[0] +fun > test7a(a: T): Unit + +// CHECK: +// Mangled name: #test7b(0:0){0§&kotlin.Function0>} +// Public signature: /test7b|4558127648037232116[0] +fun test7b(a: T): Unit where T : Function0, T : Function1 + +// CHECK: +// Mangled name: #test7c(0:0){0§>} +// Public signature: /test7c|-2955596188911782407[0] +fun test7c(a: T): Unit where T : Unrelated, T : Function0 + +// CHECK: +// Mangled name: #test8(kotlin.Function0){} +// Public signature: /test8|8321269803549472585[0] +fun test8(a: Function0): Unit + +// CHECK: +// Mangled name: #test9(){} +// Public signature: /test9|9214787561267119658[0] +fun test9(): Unit + diff --git a/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.sig.kt.txt b/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.sig.kt.txt new file mode 100644 index 00000000000..8a7e59e1a2e --- /dev/null +++ b/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.sig.kt.txt @@ -0,0 +1,115 @@ +// CHECK: +// Mangled name: KConsumer +// Public signature: /KConsumer|null[0] +fun interface KConsumer { + + // CHECK: + // Mangled name: KConsumer#accept(1:0){} + // Public signature: /KConsumer.accept|6106307687017385176[0] + abstract fun accept(x: T): Unit + +} + +// CHECK: +// Mangled name: KRunnable +// Public signature: /KRunnable|null[0] +fun interface KRunnable { + + // CHECK: + // Mangled name: KRunnable#run(){} + // Public signature: /KRunnable.run|-991178076551934874[0] + abstract fun run(): Unit + +} + +// CHECK: +// Mangled name: KSupplier +// Public signature: /KSupplier|null[0] +fun interface KSupplier { + + // CHECK JVM_IR: + // Mangled name: KSupplier#get(){}1:0 + // Public signature: /KSupplier.get|-8285253024618084508[0] + // CHECK JS_IR NATIVE: + // Mangled name: KSupplier#get(){} + // Public signature: /KSupplier.get|5453051481459130259[0] + abstract fun get(): T + +} + +// CHECK JVM_IR: +// Mangled name: #test1(){}kotlin.reflect.KFunction1,KRunnable> +// Public signature: /test1|506540275033726465[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +fun test1(): KFunction1, KRunnable> + +// CHECK JVM_IR: +// Mangled name: #test1a(){}kotlin.reflect.KFunction1,KRunnable> +// Public signature: /test1a|-8182615495924259711[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1a(){} +// Public signature: /test1a|9065284326198644477[0] +fun test1a(): KFunction1, KRunnable> + +// CHECK JVM_IR: +// Mangled name: #test1b(){}kotlin.reflect.KFunction +// Public signature: /test1b|2835121128193807915[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1b(){} +// Public signature: /test1b|-2979752850126686011[0] +fun test1b(): KFunction + +// CHECK JVM_IR: +// Mangled name: #test2(){}kotlin.Function1,KSupplier> +// Public signature: /test2|8549593161906467660[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2(){} +// Public signature: /test2|4279114864133353152[0] +fun test2(): Function1, KSupplier> + +// CHECK JVM_IR: +// Mangled name: #test2a(){}kotlin.Function1,KSupplier> +// Public signature: /test2a|2821642702752260802[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2a(){} +// Public signature: /test2a|-4222972209784837425[0] +fun test2a(): Function1, KSupplier> + +// CHECK JVM_IR: +// Mangled name: #test3(){}kotlin.Function1,KConsumer> +// Public signature: /test3|2652628399422738400[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3(){} +// Public signature: /test3|-3759735065270951803[0] +fun test3(): Function1, KConsumer> + +// CHECK JVM_IR: +// Mangled name: #test3a(){}kotlin.Function1,KConsumer> +// Public signature: /test3a|-985514784897508218[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3a(){} +// Public signature: /test3a|2047593289081242684[0] +fun test3a(): Function1, KConsumer> + +// CHECK JVM_IR: +// Mangled name: #test3b(){}kotlin.reflect.KFunction> +// Public signature: /test3b|-1724736633267333752[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3b(){} +// Public signature: /test3b|8779461353386599427[0] +fun test3b(): KFunction> + +// CHECK: +// Mangled name: KCS +// Public signature: /KCS|null[0] +typealias KCS = KConsumer +// CHECK: +// Mangled name: KR +// Public signature: /KR|null[0] +typealias KR = KRunnable +// CHECK: +// Mangled name: KSS +// Public signature: /KSS|null[0] +typealias KSS = KSupplier diff --git a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.kt b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.kt index a36017ae06f..4112b7a03c1 100644 --- a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.kt +++ b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.kt @@ -1,6 +1,9 @@ // IGNORE_BACKEND_K1: JS_IR // IGNORE_BACKEND_K1: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR +// ^ KT-57429 + fun testSimple() = Box(2L * 3) inline fun testArray(n: Int, crossinline block: () -> T): Array { diff --git a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.sig.kt.txt b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.sig.kt.txt new file mode 100644 index 00000000000..fced41880e0 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.sig.kt.txt @@ -0,0 +1,39 @@ +// CHECK: +// Mangled name: Box +// Public signature: /Box|null[0] +class Box { + // CHECK: + // Mangled name: Box{}value + // Public signature: /Box.value|1987073854177347439[0] + val value: T + // CHECK JVM_IR: + // Mangled name: Box#(){}1:0 + // Public signature: /Box.value.|3167862337988859752[0] + // CHECK JS_IR NATIVE: + // Mangled name: Box#(){} + // Public signature: /Box.value.|3260093555963109437[0] + get + + // CHECK: + // Mangled name: Box#(1:0){} + // Public signature: /Box.|-8731461708390519279[0] + constructor(value: T) /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #testArray(kotlin.Int;kotlin.Function0<0:0>){0§}kotlin.Array<0:0> +// Public signature: /testArray|-2387335896299631149[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testArray(kotlin.Int;kotlin.Function0<0:0>){0§} +// Public signature: /testArray|1625095866611230766[0] +inline fun testArray(n: Int, crossinline block: Function0): Array + +// CHECK JVM_IR: +// Mangled name: #testSimple(){}Box +// Public signature: /testSimple|-4418410780086468517[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testSimple(){} +// Public signature: /testSimple|-7227012354903248125[0] +fun testSimple(): Box + diff --git a/compiler/testData/ir/irText/expressions/genericPropertyCall.kt b/compiler/testData/ir/irText/expressions/genericPropertyCall.kt index ca1c1fec1d2..3677e48012f 100644 --- a/compiler/testData/ir/irText/expressions/genericPropertyCall.kt +++ b/compiler/testData/ir/irText/expressions/genericPropertyCall.kt @@ -1,4 +1,8 @@ // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57436 + val T.id get() = this -val test = "abc".id \ No newline at end of file +val test = "abc".id diff --git a/compiler/testData/ir/irText/expressions/genericPropertyCall.sig.kt.txt b/compiler/testData/ir/irText/expressions/genericPropertyCall.sig.kt.txt new file mode 100644 index 00000000000..dc732680e81 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/genericPropertyCall.sig.kt.txt @@ -0,0 +1,24 @@ +// CHECK: +// Mangled name: {}test +// Public signature: /test|-5712650070209114719[0] +val test: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /test.|-8411936358597690329[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test.|208282462577758837[0] + get + +// CHECK: +// Mangled name: @0:0{0§}id +// Public signature: /id|6409895071901545951[0] +val T.id: T + // CHECK JVM_IR: + // Mangled name: #@0:0(){0§}0:0 + // Public signature: /id.|4983271234253098452[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@0:0(){0§} + // Public signature: /id.|-1537502770664138716[0] + get(): T + diff --git a/compiler/testData/ir/irText/expressions/genericPropertyRef.kt b/compiler/testData/ir/irText/expressions/genericPropertyRef.kt index 8deacf03548..1453fd21435 100644 --- a/compiler/testData/ir/irText/expressions/genericPropertyRef.kt +++ b/compiler/testData/ir/irText/expressions/genericPropertyRef.kt @@ -1,3 +1,6 @@ +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57436, KT-57429 + class Value(var value: T = null as T, var text: String? = null) val Value.additionalText by DVal(Value::text) @@ -15,4 +18,4 @@ var T.bar : T get() = this set(value) { recivier = this; value2 = value} -val barRef = String?::bar \ No newline at end of file +val barRef = String?::bar diff --git a/compiler/testData/ir/irText/expressions/genericPropertyRef.sig.kt.txt b/compiler/testData/ir/irText/expressions/genericPropertyRef.sig.kt.txt new file mode 100644 index 00000000000..c692cab16c8 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/genericPropertyRef.sig.kt.txt @@ -0,0 +1,158 @@ +// CHECK: +// Mangled name: @Value<0:0>{0§}additionalText +// Public signature: /additionalText|7734412113224529319[0] +val Value.additionalText: Int /* by */ + // CHECK JVM_IR: + // Mangled name: #@Value<0:0>(){0§}kotlin.Int + // Public signature: /additionalText.|-1100553327198583886[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@Value<0:0>(){0§} + // Public signature: /additionalText.|-5973216610316851494[0] + get(): Int + +// CHECK: +// Mangled name: @Value<0:0>{0§}additionalValue +// Public signature: /additionalValue|-2810095538737902404[0] +val Value.additionalValue: Int /* by */ + // CHECK JVM_IR: + // Mangled name: #@Value<0:0>(){0§}kotlin.Int + // Public signature: /additionalValue.|-6473236166172047985[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@Value<0:0>(){0§} + // Public signature: /additionalValue.|2814172998464653518[0] + get(): Int + +// CHECK: +// Mangled name: {}recivier +// Public signature: /recivier|1393137265049165560[0] +var recivier: Any? + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Any? + // Public signature: /recivier.|-76909196192166129[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /recivier.|4125249954356201901[0] + get + // CHECK: + // Mangled name: #(kotlin.Any?){} + // Public signature: /recivier.|-6816770784536396062[0] + set + +// CHECK: +// Mangled name: {}value2 +// Public signature: /value2|-1664181645671419060[0] +var value2: Any? + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Any? + // Public signature: /value2.|8693017805210729038[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /value2.|1776957621204807843[0] + get + // CHECK: + // Mangled name: #(kotlin.Any?){} + // Public signature: /value2.|4550500963091635103[0] + set + +// CHECK: +// Mangled name: {}barRef +// Public signature: /barRef|3707178067815059623[0] +val barRef: KMutableProperty1 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KMutableProperty1 + // Public signature: /barRef.|-5465997532673085658[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /barRef.|1175959013941245768[0] + get + +// CHECK: +// Mangled name: DVal +// Public signature: /DVal|null[0] +class DVal { + // CHECK: + // Mangled name: DVal{}kmember + // Public signature: /DVal.kmember|-9008673543363374935[0] + val kmember: Any + // CHECK JVM_IR: + // Mangled name: DVal#(){}kotlin.Any + // Public signature: /DVal.kmember.|-7207078138930224715[0] + // CHECK JS_IR NATIVE: + // Mangled name: DVal#(){} + // Public signature: /DVal.kmember.|-3711067038955963135[0] + get + + // CHECK: + // Mangled name: DVal#(kotlin.Any){} + // Public signature: /DVal.|4518179880532599055[0] + constructor(kmember: Any) /* primary */ + + // CHECK JVM_IR: + // Mangled name: DVal#getValue(kotlin.Any?;kotlin.Any){}kotlin.Int + // Public signature: /DVal.getValue|-4563103632143148557[0] + // CHECK JS_IR NATIVE: + // Mangled name: DVal#getValue(kotlin.Any?;kotlin.Any){} + // Public signature: /DVal.getValue|317500257957269026[0] + operator fun getValue(t: Any?, p: Any): Int + +} + +// CHECK: +// Mangled name: Value +// Public signature: /Value|null[0] +class Value { + // CHECK: + // Mangled name: Value{}value + // Public signature: /Value.value|1987073854177347439[0] + var value: T + // CHECK JVM_IR: + // Mangled name: Value#(){}1:0 + // Public signature: /Value.value.|3167862337988859752[0] + // CHECK JS_IR NATIVE: + // Mangled name: Value#(){} + // Public signature: /Value.value.|3260093555963109437[0] + get + // CHECK: + // Mangled name: Value#(1:0){} + // Public signature: /Value.value.|-5529925203468114125[0] + set + + // CHECK: + // Mangled name: Value{}text + // Public signature: /Value.text|2188424425118836640[0] + var text: String? + // CHECK JVM_IR: + // Mangled name: Value#(){}kotlin.String? + // Public signature: /Value.text.|-7147571129451640862[0] + // CHECK JS_IR NATIVE: + // Mangled name: Value#(){} + // Public signature: /Value.text.|8349765969627210272[0] + get + // CHECK: + // Mangled name: Value#(kotlin.String?){} + // Public signature: /Value.text.|-5643986239339503171[0] + set + + // CHECK: + // Mangled name: Value#(1:0;kotlin.String?){} + // Public signature: /Value.|6863397651870522306[0] + constructor(value: T, text: String?) /* primary */ + +} + +// CHECK: +// Mangled name: @0:0{0§}bar +// Public signature: /bar|-2607368775982314867[0] +var T.bar: T + // CHECK JVM_IR: + // Mangled name: #@0:0(){0§}0:0 + // Public signature: /bar.|-1733273639849676739[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@0:0(){0§} + // Public signature: /bar.|-3183755745889883279[0] + get(): T + // CHECK: + // Mangled name: #@0:0(0:0){0§} + // Public signature: /bar.|1507801333641327058[0] + set(value: T): Unit + diff --git a/compiler/testData/ir/irText/expressions/identity.sig.kt.txt b/compiler/testData/ir/irText/expressions/identity.sig.kt.txt new file mode 100644 index 00000000000..af450df59cf --- /dev/null +++ b/compiler/testData/ir/irText/expressions/identity.sig.kt.txt @@ -0,0 +1,24 @@ +// CHECK JVM_IR: +// Mangled name: #test1(kotlin.Int;kotlin.Int){}kotlin.Boolean +// Public signature: /test1|-7551143999400464285[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1(kotlin.Int;kotlin.Int){} +// Public signature: /test1|-6134767217751638375[0] +fun test1(a: Int, b: Int): Boolean + +// CHECK JVM_IR: +// Mangled name: #test2(kotlin.Int;kotlin.Int){}kotlin.Boolean +// Public signature: /test2|29360423018429037[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2(kotlin.Int;kotlin.Int){} +// Public signature: /test2|-1200247296907510564[0] +fun test2(a: Int, b: Int): Boolean + +// CHECK JVM_IR: +// Mangled name: #test3(kotlin.Any?;kotlin.Any?){}kotlin.Boolean +// Public signature: /test3|-3154163417477574713[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3(kotlin.Any?;kotlin.Any?){} +// Public signature: /test3|6801898630268838874[0] +fun test3(a: Any?, b: Any?): Boolean + diff --git a/compiler/testData/ir/irText/expressions/ifElseIf.sig.kt.txt b/compiler/testData/ir/irText/expressions/ifElseIf.sig.kt.txt new file mode 100644 index 00000000000..dff0bf670cb --- /dev/null +++ b/compiler/testData/ir/irText/expressions/ifElseIf.sig.kt.txt @@ -0,0 +1,23 @@ +// CHECK JVM_IR: +// Mangled name: #test(kotlin.Int){}kotlin.Int +// Public signature: /test|-291422697420002546[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test(kotlin.Int){} +// Public signature: /test|7577436859890467564[0] +fun test(i: Int): Int + +// CHECK: +// Mangled name: #testEmptyBranches1(kotlin.Boolean){} +// Public signature: /testEmptyBranches1|6749407893686345218[0] +fun testEmptyBranches1(flag: Boolean): Unit + +// CHECK: +// Mangled name: #testEmptyBranches2(kotlin.Boolean){} +// Public signature: /testEmptyBranches2|3860029463289034948[0] +fun testEmptyBranches2(flag: Boolean): Unit + +// CHECK: +// Mangled name: #testEmptyBranches3(kotlin.Boolean){} +// Public signature: /testEmptyBranches3|-3957627705861131354[0] +fun testEmptyBranches3(flag: Boolean): Unit + diff --git a/compiler/testData/ir/irText/expressions/implicitCastInReturnFromConstructor.sig.kt.txt b/compiler/testData/ir/irText/expressions/implicitCastInReturnFromConstructor.sig.kt.txt new file mode 100644 index 00000000000..b59cd8c292e --- /dev/null +++ b/compiler/testData/ir/irText/expressions/implicitCastInReturnFromConstructor.sig.kt.txt @@ -0,0 +1,15 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() /* primary */ + // CHECK: + // Mangled name: C#(kotlin.Any?){} + // Public signature: /C.|-8205545948568413246[0] + constructor(x: Any?) + +} + diff --git a/compiler/testData/ir/irText/expressions/implicitCastOnPlatformType.sig.kt.txt b/compiler/testData/ir/irText/expressions/implicitCastOnPlatformType.sig.kt.txt new file mode 100644 index 00000000000..c6a41897988 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/implicitCastOnPlatformType.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK JVM_IR: +// Mangled name: #test(){}kotlin.String +// Public signature: /test|-7008832412320199001[0] +fun test(): String + diff --git a/compiler/testData/ir/irText/expressions/implicitCastToNonNull.sig.kt.txt b/compiler/testData/ir/irText/expressions/implicitCastToNonNull.sig.kt.txt new file mode 100644 index 00000000000..3c9cf8a000c --- /dev/null +++ b/compiler/testData/ir/irText/expressions/implicitCastToNonNull.sig.kt.txt @@ -0,0 +1,37 @@ +// CHECK JVM_IR: +// Mangled name: #test1(kotlin.String?){}kotlin.Int +// Public signature: /test1|-5345400542874052925[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1(kotlin.String?){} +// Public signature: /test1|-2987894258831182637[0] +fun test1(x: String?): Int + +// CHECK JVM_IR: +// Mangled name: #test2(0:0){0§}kotlin.Int +// Public signature: /test2|-7282113506340032628[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2(0:0){0§} +// Public signature: /test2|-8782669618551409801[0] +fun test2(x: T): Int + +// CHECK JVM_IR: +// Mangled name: #test3(kotlin.Any){0§}kotlin.Int +// Public signature: /test3|7450825797678601496[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3(kotlin.Any){0§} +// Public signature: /test3|7453698813177303629[0] +inline fun test3(x: Any): Int + +// CHECK JVM_IR: +// Mangled name: #test4(kotlin.Any?){0§}kotlin.Int +// Public signature: /test4|-5896625443167857513[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test4(kotlin.Any?){0§} +// Public signature: /test4|-668443391893184404[0] +inline fun test4(x: Any?): Int + +// CHECK: +// Mangled name: #test5(0:0;kotlin.Function1<0:1,kotlin.Unit>){0§<0:1?>;1§} +// Public signature: /test5|-2340660044410176183[0] +fun test5(x: T, fn: Function1): Unit + diff --git a/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.kt b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.kt index 5e9a09ea788..7e973dd11ee 100644 --- a/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.kt +++ b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.kt @@ -1,3 +1,6 @@ +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57436 + inline fun Any.test1(): T? = if (this is T) this else null @@ -13,4 +16,4 @@ class Bar { } fun useT(t: T) {} -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.sig.kt.txt b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.sig.kt.txt new file mode 100644 index 00000000000..56b6b3dcd64 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.sig.kt.txt @@ -0,0 +1,48 @@ +// CHECK: +// Mangled name: Bar +// Public signature: /Bar|null[0] +class Bar { + // CHECK: + // Mangled name: Bar#(){} + // Public signature: /Bar.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Bar#test(kotlin.Any){} + // Public signature: /Bar.test|-7985792749252989017[0] + fun test(arg: Any): Unit + + // CHECK: + // Mangled name: Bar#useT(1:0){} + // Public signature: /Bar.useT|2218364832177755788[0] + fun useT(t: T): Unit + +} + +// CHECK: +// Mangled name: Foo +// Public signature: /Foo|null[0] +interface Foo { + +} + +// CHECK JVM_IR: +// Mangled name: #test1@kotlin.Any(){0§}0:0? +// Public signature: /test1|2900041689817297802[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1@kotlin.Any(){0§} +// Public signature: /test1|-8490072393471393600[0] +inline fun Any.test1(): T? + +// CHECK: +// Mangled name: @Foo<0:0>{0§}asT +// Public signature: /asT|-840544213460054683[0] +val Foo.asT: T? + // CHECK JVM_IR: + // Mangled name: #@Foo<0:0>(){0§}0:0? + // Public signature: /asT.|-4847921419158920204[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@Foo<0:0>(){0§} + // Public signature: /asT.|4488225205783861105[0] + inline get(): T? + diff --git a/compiler/testData/ir/irText/expressions/implicitNotNullInDestructuringAssignment.kt b/compiler/testData/ir/irText/expressions/implicitNotNullInDestructuringAssignment.kt index 9db5ebc7f34..e91e1138e9a 100644 --- a/compiler/testData/ir/irText/expressions/implicitNotNullInDestructuringAssignment.kt +++ b/compiler/testData/ir/irText/expressions/implicitNotNullInDestructuringAssignment.kt @@ -1,4 +1,8 @@ // TARGET_BACKEND: JVM + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57778 + // FILE: implicitNotNullInDestructuringAssignment.kt // NB extension receiver is nullable diff --git a/compiler/testData/ir/irText/expressions/implicitNotNullInDestructuringAssignment.sig.kt.txt b/compiler/testData/ir/irText/expressions/implicitNotNullInDestructuringAssignment.sig.kt.txt new file mode 100644 index 00000000000..db81e7f5d6d --- /dev/null +++ b/compiler/testData/ir/irText/expressions/implicitNotNullInDestructuringAssignment.sig.kt.txt @@ -0,0 +1,15 @@ +// CHECK JVM_IR: +// Mangled name: #component1@J?(){}kotlin.Int +// Public signature: /component1|-3884047873137386118[0] +operator fun J?.component1(): Int + +// CHECK JVM_IR: +// Mangled name: #component2@J(){}kotlin.Int +// Public signature: [ File 'implicitNotNullInDestructuringAssignment.kt' <- /component2|-623550756830644944[0] ] +private operator fun J.component2(): Int + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + diff --git a/compiler/testData/ir/irText/expressions/in.sig.kt.txt b/compiler/testData/ir/irText/expressions/in.sig.kt.txt new file mode 100644 index 00000000000..934513dc995 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/in.sig.kt.txt @@ -0,0 +1,32 @@ +// CHECK JVM_IR: +// Mangled name: #test1(kotlin.Any;kotlin.collections.Collection){}kotlin.Boolean +// Public signature: /test1|2421564591168232411[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1(kotlin.Any;kotlin.collections.Collection){} +// Public signature: /test1|185139779466584752[0] +fun test1(a: Any, x: Collection): Boolean + +// CHECK JVM_IR: +// Mangled name: #test2(kotlin.Any;kotlin.collections.Collection){}kotlin.Boolean +// Public signature: /test2|-2480848712272829730[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2(kotlin.Any;kotlin.collections.Collection){} +// Public signature: /test2|-8245838254458281601[0] +fun test2(a: Any, x: Collection): Boolean + +// CHECK JVM_IR: +// Mangled name: #test3(0:0;kotlin.collections.Collection<0:0>){0§}kotlin.Boolean +// Public signature: /test3|-3611627028832372019[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3(0:0;kotlin.collections.Collection<0:0>){0§} +// Public signature: /test3|424039587834021207[0] +fun test3(a: T, x: Collection): Boolean + +// CHECK JVM_IR: +// Mangled name: #test4(0:0;kotlin.collections.Collection<0:0>){0§}kotlin.Boolean +// Public signature: /test4|-7047720598994490770[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test4(0:0;kotlin.collections.Collection<0:0>){0§} +// Public signature: /test4|-394283934792174597[0] +fun test4(a: T, x: Collection): Boolean + diff --git a/compiler/testData/ir/irText/expressions/incrementDecrement.sig.kt.txt b/compiler/testData/ir/irText/expressions/incrementDecrement.sig.kt.txt new file mode 100644 index 00000000000..137600a9781 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/incrementDecrement.sig.kt.txt @@ -0,0 +1,178 @@ +// CHECK: +// Mangled name: {}p +// Public signature: /p|6715504260787941082[0] +var p: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /p.|5329635969197638839[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /p.|-1162552463316289847[0] + get + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /p.|-6346582004572228570[0] + set + +// CHECK: +// Mangled name: {}arr +// Public signature: /arr|3895543167155351037[0] +val arr: IntArray + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.IntArray + // Public signature: /arr.|-3280308842233711836[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /arr.|-3478894267993371734[0] + get + +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C{}p + // Public signature: /C.p|6715504260787941082[0] + var p: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.p.|5329635969197638839[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.p.|-1162552463316289847[0] + get + // CHECK: + // Mangled name: C#(kotlin.Int){} + // Public signature: /C.p.|-6346582004572228570[0] + set + + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: C#get(kotlin.Int){}kotlin.Int + // Public signature: /C.get|3217555545696752959[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#get(kotlin.Int){} + // Public signature: /C.get|-1406503945102116889[0] + operator fun get(i: Int): Int + + // CHECK: + // Mangled name: C#set(kotlin.Int;kotlin.Int){} + // Public signature: /C.set|-213984015376347786[0] + operator fun set(i: Int, value: Int): Unit + +} + +// CHECK: +// Mangled name: O +// Public signature: /O|null[0] +object O { + // CHECK: + // Mangled name: O{}p + // Public signature: /O.p|6715504260787941082[0] + var p: Int + // CHECK JVM_IR: + // Mangled name: O#(){}kotlin.Int + // Public signature: /O.p.|5329635969197638839[0] + // CHECK JS_IR NATIVE: + // Mangled name: O#(){} + // Public signature: /O.p.|-1162552463316289847[0] + get + // CHECK: + // Mangled name: O#(kotlin.Int){} + // Public signature: /O.p.|-6346582004572228570[0] + set + + // CHECK: + // Mangled name: O#(){} + // Public signature: /O.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: O#get(kotlin.Int){}kotlin.Int + // Public signature: /O.get|3217555545696752959[0] + // CHECK JS_IR NATIVE: + // Mangled name: O#get(kotlin.Int){} + // Public signature: /O.get|-1406503945102116889[0] + operator fun get(i: Int): Int + + // CHECK: + // Mangled name: O#set(kotlin.Int;kotlin.Int){} + // Public signature: /O.set|-213984015376347786[0] + operator fun set(i: Int, value: Int): Unit + +} + +// CHECK: +// Mangled name: #testArrayPostfix(){} +// Public signature: /testArrayPostfix|-5183940712820420583[0] +fun testArrayPostfix(): Unit + +// CHECK: +// Mangled name: #testArrayPrefix(){} +// Public signature: /testArrayPrefix|3229135807367985846[0] +fun testArrayPrefix(): Unit + +// CHECK: +// Mangled name: #testClassOperatorPostfix(){} +// Public signature: /testClassOperatorPostfix|2906708313202825150[0] +fun testClassOperatorPostfix(): Unit + +// CHECK: +// Mangled name: #testClassOperatorPrefix(){} +// Public signature: /testClassOperatorPrefix|6915419153076323743[0] +fun testClassOperatorPrefix(): Unit + +// CHECK: +// Mangled name: #testClassPropPostfix(){} +// Public signature: /testClassPropPostfix|-4203305206320166261[0] +fun testClassPropPostfix(): Unit + +// CHECK: +// Mangled name: #testClassPropPrefix(){} +// Public signature: /testClassPropPrefix|1087589743797908334[0] +fun testClassPropPrefix(): Unit + +// CHECK: +// Mangled name: #testObjectOperatorPostfix(){} +// Public signature: /testObjectOperatorPostfix|3636050613187164383[0] +fun testObjectOperatorPostfix(): Unit + +// CHECK: +// Mangled name: #testObjectOperatorPrefix(){} +// Public signature: /testObjectOperatorPrefix|-3519675779257775428[0] +fun testObjectOperatorPrefix(): Unit + +// CHECK: +// Mangled name: #testObjectPropPostfix(){} +// Public signature: /testObjectPropPostfix|2876726747893752873[0] +fun testObjectPropPostfix(): Unit + +// CHECK: +// Mangled name: #testObjectPropPrefix(){} +// Public signature: /testObjectPropPrefix|428265185993627760[0] +fun testObjectPropPrefix(): Unit + +// CHECK: +// Mangled name: #testPropPostfix(){} +// Public signature: /testPropPostfix|-2249245688892536772[0] +fun testPropPostfix(): Unit + +// CHECK: +// Mangled name: #testPropPrefix(){} +// Public signature: /testPropPrefix|-2042336393408932139[0] +fun testPropPrefix(): Unit + +// CHECK: +// Mangled name: #testVarPostfix(){} +// Public signature: /testVarPostfix|-5300999320944368230[0] +fun testVarPostfix(): Unit + +// CHECK: +// Mangled name: #testVarPrefix(){} +// Public signature: /testVarPrefix|-4413709736918376229[0] +fun testVarPrefix(): Unit + diff --git a/compiler/testData/ir/irText/expressions/inlinedBreakContinue.kt b/compiler/testData/ir/irText/expressions/inlinedBreakContinue.kt index eeab562182b..dc5baffa8fe 100644 --- a/compiler/testData/ir/irText/expressions/inlinedBreakContinue.kt +++ b/compiler/testData/ir/irText/expressions/inlinedBreakContinue.kt @@ -1,9 +1,13 @@ // FIR_IDENTICAL // LANGUAGE: +BreakContinueInInlineLambdas +// DUMP_LOCAL_DECLARATION_SIGNATURES // TARGET_BACKEND: JVM_IR // IGNORE_ERRORS // WITH_STDLIB +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57428 + inline fun foo(block: () -> Unit) { block() } inline fun bar(block1: () -> Unit, noinline block2: () -> Unit) { diff --git a/compiler/testData/ir/irText/expressions/inlinedBreakContinue.sig.kt.txt b/compiler/testData/ir/irText/expressions/inlinedBreakContinue.sig.kt.txt new file mode 100644 index 00000000000..de8c3c45d33 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/inlinedBreakContinue.sig.kt.txt @@ -0,0 +1,66 @@ +// CHECK: +// Mangled name: #bar(kotlin.Function0;kotlin.Function0){} +// Public signature: /bar|1436837239648519468[0] +inline fun bar(block1: Function0, noinline block2: Function0): Unit + +// CHECK: +// Mangled name: #foo(kotlin.Function0){} +// Public signature: /foo|251397761749529488[0] +inline fun foo(block: Function0): Unit + +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +fun test1(): Unit + // CHECK: + // Mangled name: #test1(){}##static(){} + local fun (): Unit + + // CHECK: + // Mangled name: #test1(){}##static(){} + local fun (): Unit + + // CHECK: + // Mangled name: #test1(){}##static(){} + local fun (): Unit + + // CHECK: + // Mangled name: #test1(){}##static(){} + local fun (): Unit + +// CHECK: +// Mangled name: #test2(){} +// Public signature: /test2|4279114864133353152[0] +fun test2(): Unit + // CHECK: + // Mangled name: #test2(){}##static(){} + local fun (): Unit + + // CHECK: + // Mangled name: #test2(){}##static(){} + local fun (): Unit + + // CHECK: + // Mangled name: #test2(){}##static(){} + local fun (): Unit + + // CHECK: + // Mangled name: #test2(){}##static(){} + local fun (): Unit + + // CHECK: + // Mangled name: #test2(){}##static(){} + local fun (): Unit + + // CHECK: + // Mangled name: #test2(){}##static(){} + local fun (): Unit + + // CHECK: + // Mangled name: #test2(){}##static(){} + local fun (): Unit + + // CHECK: + // Mangled name: #test2(){}##static(){} + local fun (): Unit + diff --git a/compiler/testData/ir/irText/expressions/interfaceThisRef.sig.kt.txt b/compiler/testData/ir/irText/expressions/interfaceThisRef.sig.kt.txt new file mode 100644 index 00000000000..caff50fce38 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/interfaceThisRef.sig.kt.txt @@ -0,0 +1,17 @@ +// CHECK: +// Mangled name: IFoo +// Public signature: /IFoo|null[0] +interface IFoo { + + // CHECK: + // Mangled name: IFoo#bar(){} + // Public signature: /IFoo.bar|496682602797471549[0] + fun bar(): Unit + + // CHECK: + // Mangled name: IFoo#foo(){} + // Public signature: /IFoo.foo|-1041209573719867811[0] + abstract fun foo(): Unit + +} + diff --git a/compiler/testData/ir/irText/expressions/javaSyntheticGenericPropretyAccess.sig.kt.txt b/compiler/testData/ir/irText/expressions/javaSyntheticGenericPropretyAccess.sig.kt.txt new file mode 100644 index 00000000000..898d6b68609 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/javaSyntheticGenericPropretyAccess.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #test(J<0:0>){0§} +// Public signature: /test|-9034900230155254055[0] +fun test(j: J): Unit + diff --git a/compiler/testData/ir/irText/expressions/javaSyntheticPropertyAccess.sig.kt.txt b/compiler/testData/ir/irText/expressions/javaSyntheticPropertyAccess.sig.kt.txt new file mode 100644 index 00000000000..2497afee26a --- /dev/null +++ b/compiler/testData/ir/irText/expressions/javaSyntheticPropertyAccess.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #test(J){} +// Public signature: /test|-8477572416399964095[0] +fun test(j: J): Unit + diff --git a/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.sig.kt.txt b/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.sig.kt.txt new file mode 100644 index 00000000000..480e9a18331 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.sig.kt.txt @@ -0,0 +1,67 @@ +// CHECK: +// Mangled name: Derived1 +// Public signature: /Derived1|null[0] +class Derived1 : JFieldOwner, IFoo { + // CHECK: + // Mangled name: Derived1#(){} + // Public signature: /Derived1.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: Derived2 +// Public signature: /Derived2|null[0] +class Derived2 : JFieldOwner, IFoo { + // CHECK: + // Mangled name: Derived2#(){} + // Public signature: /Derived2.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: DerivedThroughMid1 +// Public signature: /DerivedThroughMid1|null[0] +class DerivedThroughMid1 : Mid, IFoo { + // CHECK: + // Mangled name: DerivedThroughMid1#(){} + // Public signature: /DerivedThroughMid1.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: DerivedThroughMid2 +// Public signature: /DerivedThroughMid2|null[0] +class DerivedThroughMid2 : Mid, IFoo { + // CHECK: + // Mangled name: DerivedThroughMid2#(){} + // Public signature: /DerivedThroughMid2.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: Mid +// Public signature: /Mid|null[0] +open class Mid : JFieldOwner { + // CHECK: + // Mangled name: Mid#(){} + // Public signature: /Mid.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: IFoo +// Public signature: /IFoo|null[0] +interface IFoo { + +} + +// CHECK: +// Mangled name: #test(kotlin.Boolean){} +// Public signature: /test|-88931722341009933[0] +fun test(b: Boolean): Unit + diff --git a/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.sig.kt.txt b/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.sig.kt.txt new file mode 100644 index 00000000000..340ccb278a2 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.sig.kt.txt @@ -0,0 +1,21 @@ +// CHECK: +// Mangled name: Derived +// Public signature: /Derived|null[0] +class Derived : Base { + // CHECK: + // Mangled name: Derived#(){} + // Public signature: /Derived.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Derived#getValue(){}kotlin.Int + // Public signature: /Derived.getValue|5786129636844002858[0] + fun getValue(): Int + + // CHECK: + // Mangled name: Derived#setValue(kotlin.Int){} + // Public signature: /Derived.setValue|4983946438954816976[0] + fun setValue(value: Int): Unit + +} + diff --git a/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.sig.kt.txt b/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.sig.kt.txt new file mode 100644 index 00000000000..96a30c1a3d9 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.sig.kt.txt @@ -0,0 +1,38 @@ +// CHECK: +// Mangled name: TestClass +// Public signature: /TestClass|null[0] +class TestClass { + // CHECK: + // Mangled name: TestClass{}test + // Public signature: /TestClass.test|-5712650070209114719[0] + val test: Int + // CHECK JVM_IR: + // Mangled name: TestClass#(){}kotlin.Int + // Public signature: /TestClass.test.|3701432460336260723[0] + get + + // CHECK: + // Mangled name: TestClass#(){} + // Public signature: /TestClass.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: #testFun(){} +// Public signature: /testFun|6322333980269160703[0] +fun testFun(): Unit + +// CHECK: +// Mangled name: {}testProp +// Public signature: /testProp|4463768917101701410[0] +var testProp: Any + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Any + // Public signature: /testProp.|3424752583741777147[0] + get(): Any + // CHECK: + // Mangled name: #(kotlin.Any){} + // Public signature: /testProp.|602902979763786235[0] + set(value: Any): Unit + diff --git a/compiler/testData/ir/irText/expressions/kt16904.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt16904.sig.kt.txt new file mode 100644 index 00000000000..fc492828dcb --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt16904.sig.kt.txt @@ -0,0 +1,93 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +abstract class A { + // CHECK: + // Mangled name: A{}x + // Public signature: /A.x|-8060530855978347579[0] + val x: B + // CHECK JVM_IR: + // Mangled name: A#(){}B + // Public signature: /A.x.|-4306177069200763996[0] + get + + // CHECK: + // Mangled name: A{}y + // Public signature: /A.y|3625903257357557171[0] + var y: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.y.|-6745575372101973707[0] + get + // CHECK: + // Mangled name: A#(kotlin.Int){} + // Public signature: /A.y.|2154335559382602722[0] + set + + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +class B { + // CHECK: + // Mangled name: B#(){} + // Public signature: /B.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: B#plusAssign(kotlin.Int){} + // Public signature: /B.plusAssign|3258359553712471205[0] + operator fun plusAssign(x: Int): Unit + +} + +// CHECK: +// Mangled name: Test1 +// Public signature: /Test1|null[0] +class Test1 : A { + // CHECK: + // Mangled name: Test1#(){} + // Public signature: /Test1.|-5645683436151566731[0] + constructor() + + // CHECK: + // Mangled name: Test1{}x + // Public signature: /Test1.x|-8060530855978347579[0] + /* fake */ override val x: B + // CHECK JVM_IR: + // Mangled name: Test1#(){}B + // Public signature: /Test1.x.|-4306177069200763996[0] + /* fake */ override get(): B + + // CHECK: + // Mangled name: Test1{}y + // Public signature: /Test1.y|3625903257357557171[0] + /* fake */ override var y: Int + // CHECK JVM_IR: + // Mangled name: Test1#(){}kotlin.Int + // Public signature: /Test1.y.|-6745575372101973707[0] + /* fake */ override get(): Int + // CHECK: + // Mangled name: Test1#(kotlin.Int){} + // Public signature: /Test1.y.|2154335559382602722[0] + /* fake */ override set(: Int): Unit + +} + +// CHECK: +// Mangled name: Test2 +// Public signature: /Test2|null[0] +class Test2 : J { + // CHECK: + // Mangled name: Test2#(){} + // Public signature: /Test2.|-5645683436151566731[0] + constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/expressions/kt16905.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt16905.sig.kt.txt new file mode 100644 index 00000000000..02c6d39e8ac --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt16905.sig.kt.txt @@ -0,0 +1,56 @@ +// CHECK: +// Mangled name: Outer +// Public signature: /Outer|null[0] +class Outer { + // CHECK: + // Mangled name: Outer.Inner + // Public signature: /Outer.Inner|null[0] + open inner class Inner { + // CHECK: + // Mangled name: Outer.Inner#(){} + // Public signature: /Outer.Inner.|-5645683436151566731[0] + constructor() /* primary */ + + } + + // CHECK: + // Mangled name: Outer.InnerDerived0 + // Public signature: /Outer.InnerDerived0|null[0] + inner class InnerDerived0 : Inner { + // CHECK: + // Mangled name: Outer.InnerDerived0#(){} + // Public signature: /Outer.InnerDerived0.|-5645683436151566731[0] + constructor() /* primary */ + + } + + // CHECK: + // Mangled name: Outer.InnerDerived1 + // Public signature: /Outer.InnerDerived1|null[0] + inner class InnerDerived1 : Inner { + // CHECK: + // Mangled name: Outer.InnerDerived1#(){} + // Public signature: /Outer.InnerDerived1.|-5645683436151566731[0] + constructor() /* primary */ + + } + + // CHECK: + // Mangled name: Outer#(){} + // Public signature: /Outer.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #test(){}Outer.Inner +// Public signature: /test|8585667894850483787[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Inner + +// CHECK: +// Mangled name: OI +// Public signature: /OI|null[0] +typealias OI = Inner diff --git a/compiler/testData/ir/irText/expressions/kt23030.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt23030.sig.kt.txt new file mode 100644 index 00000000000..5b97275039d --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt23030.sig.kt.txt @@ -0,0 +1,67 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: C#compareTo@kotlin.Int(kotlin.Char){}kotlin.Int + // Public signature: /C.compareTo|-3046390620514569100[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#compareTo@kotlin.Int(kotlin.Char){} + // Public signature: /C.compareTo|4004432308841029190[0] + operator fun Int.compareTo(c: Char): Int + + // CHECK JVM_IR: + // Mangled name: C#testMemberExtensionCompareToCall(kotlin.Int;kotlin.Char){}kotlin.Boolean + // Public signature: /C.testMemberExtensionCompareToCall|-4075882409492053136[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#testMemberExtensionCompareToCall(kotlin.Int;kotlin.Char){} + // Public signature: /C.testMemberExtensionCompareToCall|8498050272167447890[0] + fun testMemberExtensionCompareToCall(x: Int, y: Char): Boolean + + // CHECK JVM_IR: + // Mangled name: C#testMemberExtensionCompareToCallWithSmartCast(kotlin.Any;kotlin.Any){}kotlin.Boolean + // Public signature: /C.testMemberExtensionCompareToCallWithSmartCast|8745947718269383382[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#testMemberExtensionCompareToCallWithSmartCast(kotlin.Any;kotlin.Any){} + // Public signature: /C.testMemberExtensionCompareToCallWithSmartCast|-8133797647400685684[0] + fun testMemberExtensionCompareToCallWithSmartCast(x: Any, y: Any): Boolean + +} + +// CHECK JVM_IR: +// Mangled name: #compareTo@kotlin.Int(kotlin.Char){}kotlin.Int +// Public signature: /compareTo|-3046390620514569100[0] +// CHECK JS_IR NATIVE: +// Mangled name: #compareTo@kotlin.Int(kotlin.Char){} +// Public signature: /compareTo|4004432308841029190[0] +operator fun Int.compareTo(c: Char): Int + +// CHECK JVM_IR: +// Mangled name: #testEqualsWithSmartCast(kotlin.Any;kotlin.Any){}kotlin.Boolean +// Public signature: /testEqualsWithSmartCast|216587402273338311[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testEqualsWithSmartCast(kotlin.Any;kotlin.Any){} +// Public signature: /testEqualsWithSmartCast|-1534790459299527637[0] +fun testEqualsWithSmartCast(x: Any, y: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #testOverloadedCompareToCall(kotlin.Int;kotlin.Char){}kotlin.Boolean +// Public signature: /testOverloadedCompareToCall|-3653539079240215410[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testOverloadedCompareToCall(kotlin.Int;kotlin.Char){} +// Public signature: /testOverloadedCompareToCall|8371154870019873370[0] +fun testOverloadedCompareToCall(x: Int, y: Char): Boolean + +// CHECK JVM_IR: +// Mangled name: #testOverloadedCompareToCallWithSmartCast(kotlin.Any;kotlin.Any){}kotlin.Boolean +// Public signature: /testOverloadedCompareToCallWithSmartCast|-1185994757727801494[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testOverloadedCompareToCallWithSmartCast(kotlin.Any;kotlin.Any){} +// Public signature: /testOverloadedCompareToCallWithSmartCast|-3249814920840803876[0] +fun testOverloadedCompareToCallWithSmartCast(x: Any, y: Any): Boolean + diff --git a/compiler/testData/ir/irText/expressions/kt24804.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt24804.sig.kt.txt new file mode 100644 index 00000000000..3ba71138996 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt24804.sig.kt.txt @@ -0,0 +1,24 @@ +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +// CHECK JS_IR NATIVE: +// Mangled name: #box(){} +// Public signature: /box|2173511048851971368[0] +fun box(): String + +// CHECK JVM_IR: +// Mangled name: #foo(){}kotlin.Boolean +// Public signature: /foo|6817124238991280153[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo(){} +// Public signature: /foo|-1041209573719867811[0] +inline fun foo(): Boolean + +// CHECK JVM_IR: +// Mangled name: #run(kotlin.Boolean;kotlin.Boolean){}kotlin.String +// Public signature: /run|-3816013026832590302[0] +// CHECK JS_IR NATIVE: +// Mangled name: #run(kotlin.Boolean;kotlin.Boolean){} +// Public signature: /run|-3884343627033370648[0] +fun run(x: Boolean, y: Boolean): String + diff --git a/compiler/testData/ir/irText/expressions/kt27933.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt27933.sig.kt.txt new file mode 100644 index 00000000000..db9fda4185d --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt27933.sig.kt.txt @@ -0,0 +1,8 @@ +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +// CHECK JS_IR NATIVE: +// Mangled name: #box(){} +// Public signature: /box|2173511048851971368[0] +fun box(): String + diff --git a/compiler/testData/ir/irText/expressions/kt28006.kt b/compiler/testData/ir/irText/expressions/kt28006.kt index 77c954f5efa..1afcca43879 100644 --- a/compiler/testData/ir/irText/expressions/kt28006.kt +++ b/compiler/testData/ir/irText/expressions/kt28006.kt @@ -1,5 +1,9 @@ // 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" @@ -12,4 +16,4 @@ fun test1(x: Int) = "\uD83E\uDD17$x" fun test2(x: Int) = "$x\uD83E\uDD17" -fun test3(x: Int) = "$x\uD83E\uDD17$x" \ No newline at end of file +fun test3(x: Int) = "$x\uD83E\uDD17$x" diff --git a/compiler/testData/ir/irText/expressions/kt28006.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt28006.sig.kt.txt new file mode 100644 index 00000000000..c864b3c71fd --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt28006.sig.kt.txt @@ -0,0 +1,96 @@ +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /test1.|-7403750508378492770[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test1.|-5735092642142423279[0] + get + +// CHECK: +// Mangled name: {}test2 +// Public signature: /test2|2517758057000911509[0] +val test2: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /test2.|-8062412501290172814[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test2.|-5218942532816206869[0] + get + +// CHECK JVM_IR: +// Mangled name: #test1(kotlin.Int){}kotlin.String +// Public signature: /test1|431552432157022210[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1(kotlin.Int){} +// Public signature: /test1|-3111244057316668638[0] +fun test1(x: Int): String + +// CHECK JVM_IR: +// Mangled name: #test2(kotlin.Int){}kotlin.String +// Public signature: /test2|-4821521016036724259[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2(kotlin.Int){} +// Public signature: /test2|734099489197097820[0] +fun test2(x: Int): String + +// CHECK JVM_IR: +// Mangled name: #test3(kotlin.Int){}kotlin.String +// Public signature: /test3|361194729147267791[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3(kotlin.Int){} +// Public signature: /test3|7508947747710505690[0] +fun test3(x: Int): String + +// CHECK: +// Mangled name: {}testConst1 +// Public signature: /testConst1|2874352644667430152[0] +const val testConst1: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /testConst1.|-7158246920211242171[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testConst1.|-2360900528432484243[0] + get + +// CHECK: +// Mangled name: {}testConst2 +// Public signature: /testConst2|-4483171841540106635[0] +const val testConst2: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /testConst2.|3150256866714449140[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testConst2.|7445013255069886264[0] + get + +// CHECK: +// Mangled name: {}testConst3 +// Public signature: /testConst3|6023257891078233015[0] +const val testConst3: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /testConst3.|2239866314418466934[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testConst3.|1088737574065398195[0] + get + +// CHECK: +// Mangled name: {}testConst4 +// Public signature: /testConst4|-8316573179481780901[0] +const val testConst4: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /testConst4.|-5321192346636591115[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testConst4.|8141561508753910958[0] + get + diff --git a/compiler/testData/ir/irText/expressions/kt28456.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt28456.sig.kt.txt new file mode 100644 index 00000000000..25e184b4e11 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt28456.sig.kt.txt @@ -0,0 +1,42 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #get@A(kotlin.IntArray...){}kotlin.Int +// Public signature: /get|1721673901625314100[0] +// CHECK JS_IR NATIVE: +// Mangled name: #get@A(kotlin.IntArray...){} +// Public signature: /get|-474970059822094928[0] +operator fun A.get(vararg xs: Int): Int + +// CHECK: +// Mangled name: #set@A(kotlin.Int;kotlin.Int;kotlin.Int){} +// Public signature: /set|-1889324313224580378[0] +operator fun A.set(i: Int, j: Int, v: Int): Unit + +// CHECK: +// Mangled name: #testCompoundAssignment(A){} +// Public signature: /testCompoundAssignment|446952120601658700[0] +fun testCompoundAssignment(a: A): Unit + +// CHECK JVM_IR: +// Mangled name: #testPostfixIncrement(A){}kotlin.Int +// Public signature: /testPostfixIncrement|-2576964328021229709[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testPostfixIncrement(A){} +// Public signature: /testPostfixIncrement|1464365050989928678[0] +fun testPostfixIncrement(a: A): Int + +// CHECK: +// Mangled name: #testSimpleAssignment(A){} +// Public signature: /testSimpleAssignment|1100548656282165605[0] +fun testSimpleAssignment(a: A): Unit + diff --git a/compiler/testData/ir/irText/expressions/kt28456a.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt28456a.sig.kt.txt new file mode 100644 index 00000000000..7bb0de5799c --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt28456a.sig.kt.txt @@ -0,0 +1,21 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: #set@A(kotlin.IntArray...;kotlin.Int){} +// Public signature: /set|-7344305741500909935[0] +operator fun A.set(vararg i: Int, v: Int): Unit + +// CHECK: +// Mangled name: #testSimpleAssignment(A){} +// Public signature: /testSimpleAssignment|1100548656282165605[0] +fun testSimpleAssignment(a: A): Unit + diff --git a/compiler/testData/ir/irText/expressions/kt28456b.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt28456b.sig.kt.txt new file mode 100644 index 00000000000..b1d2e0ca80d --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt28456b.sig.kt.txt @@ -0,0 +1,42 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #get@A(kotlin.Int;kotlin.Int;kotlin.Int;kotlin.Int;kotlin.Int){}kotlin.Int +// Public signature: /get|925888735041089268[0] +// CHECK JS_IR NATIVE: +// Mangled name: #get@A(kotlin.Int;kotlin.Int;kotlin.Int;kotlin.Int;kotlin.Int){} +// Public signature: /get|7438066462482513130[0] +operator fun A.get(i: Int, a: Int, b: Int, c: Int, d: Int): Int + +// CHECK: +// Mangled name: #set@A(kotlin.Int;kotlin.Int;kotlin.Int){} +// Public signature: /set|-1889324313224580378[0] +operator fun A.set(i: Int, j: Int, v: Int): Unit + +// CHECK: +// Mangled name: #testCompoundAssignment(A){} +// Public signature: /testCompoundAssignment|446952120601658700[0] +fun testCompoundAssignment(a: A): Unit + +// CHECK JVM_IR: +// Mangled name: #testPostfixIncrement(A){}kotlin.Int +// Public signature: /testPostfixIncrement|-2576964328021229709[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testPostfixIncrement(A){} +// Public signature: /testPostfixIncrement|1464365050989928678[0] +fun testPostfixIncrement(a: A): Int + +// CHECK: +// Mangled name: #testSimpleAssignment(A){} +// Public signature: /testSimpleAssignment|1100548656282165605[0] +fun testSimpleAssignment(a: A): Unit + diff --git a/compiler/testData/ir/irText/expressions/kt30020.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt30020.sig.kt.txt new file mode 100644 index 00000000000..1f11c42d122 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt30020.sig.kt.txt @@ -0,0 +1,234 @@ +// CHECK: +// Mangled name: AML +// Public signature: /AML|null[0] +abstract class AML : MutableList { + // CHECK: + // Mangled name: AML.Inner + // Public signature: /AML.Inner|null[0] + inner class Inner { + // CHECK: + // Mangled name: AML.Inner#(){} + // Public signature: /AML.Inner.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: AML.Inner#testOuterThis(){} + // Public signature: /AML.Inner.testOuterThis|-5189187038429412487[0] + fun testOuterThis(): Unit + + } + + // CHECK: + // Mangled name: AML#(){} + // Public signature: /AML.|-5645683436151566731[0] + constructor() /* primary */ + // CHECK JVM_IR: + // Mangled name: AML#add(kotlin.Int){}kotlin.Boolean + // Public signature: /AML.add|-1806173376318726841[0] + // CHECK JS_IR NATIVE: + // Mangled name: AML#add(kotlin.Int){} + // Public signature: /AML.add|4888650976871417104[0] + abstract /* fake */ override fun add(element: Int): Boolean + + // CHECK: + // Mangled name: AML#add(kotlin.Int;kotlin.Int){} + // Public signature: /AML.add|-6416567052772437491[0] + abstract /* fake */ override fun add(index: Int, element: Int): Unit + + // CHECK JVM_IR: + // Mangled name: AML#addAll(kotlin.collections.Collection){}kotlin.Boolean + // Public signature: /AML.addAll|-6051524025259448486[0] + // CHECK JS_IR NATIVE: + // Mangled name: AML#addAll(kotlin.collections.Collection){} + // Public signature: /AML.addAll|4734310372414909061[0] + abstract /* fake */ override fun addAll(elements: Collection): Boolean + + // CHECK JVM_IR: + // Mangled name: AML#addAll(kotlin.Int;kotlin.collections.Collection){}kotlin.Boolean + // Public signature: /AML.addAll|304015831950772291[0] + // CHECK JS_IR NATIVE: + // Mangled name: AML#addAll(kotlin.Int;kotlin.collections.Collection){} + // Public signature: /AML.addAll|6341267342254214959[0] + abstract /* fake */ override fun addAll(index: Int, elements: Collection): Boolean + + // CHECK: + // Mangled name: AML#clear(){} + // Public signature: /AML.clear|-6446868449915108923[0] + abstract /* fake */ override fun clear(): Unit + + // CHECK JVM_IR: + // Mangled name: AML#contains(kotlin.Int){}kotlin.Boolean + // Public signature: /AML.contains|5978686608528191145[0] + // CHECK JS_IR NATIVE: + // Mangled name: AML#contains(kotlin.Int){} + // Public signature: /AML.contains|-6963927737603140469[0] + abstract /* fake */ override operator fun contains(element: Int): Boolean + + // CHECK JVM_IR: + // Mangled name: AML#containsAll(kotlin.collections.Collection){}kotlin.Boolean + // Public signature: /AML.containsAll|5891935227751154106[0] + // CHECK JS_IR NATIVE: + // Mangled name: AML#containsAll(kotlin.collections.Collection){} + // Public signature: /AML.containsAll|3782166731660135862[0] + abstract /* fake */ override fun containsAll(elements: Collection): Boolean + + // CHECK JVM_IR: + // Mangled name: AML#get(kotlin.Int){}kotlin.Int + // Public signature: /AML.get|3217555545696752959[0] + // CHECK JS_IR NATIVE: + // Mangled name: AML#get(kotlin.Int){} + // Public signature: /AML.get|-1406503945102116889[0] + abstract /* fake */ override operator fun get(index: Int): Int + + // CHECK JVM_IR: + // Mangled name: AML#indexOf(kotlin.Int){}kotlin.Int + // Public signature: /AML.indexOf|5710916612120162838[0] + // CHECK JS_IR NATIVE: + // Mangled name: AML#indexOf(kotlin.Int){} + // Public signature: /AML.indexOf|-6923646111900672743[0] + abstract /* fake */ override fun indexOf(element: Int): Int + + // CHECK JVM_IR: + // Mangled name: AML#isEmpty(){}kotlin.Boolean + // Public signature: /AML.isEmpty|-626562167393617703[0] + // CHECK JS_IR NATIVE: + // Mangled name: AML#isEmpty(){} + // Public signature: /AML.isEmpty|-412363028532554867[0] + abstract /* fake */ override fun isEmpty(): Boolean + + // CHECK JVM_IR: + // Mangled name: AML#iterator(){}kotlin.collections.MutableIterator + // Public signature: /AML.iterator|5550173533307317441[0] + // CHECK JS_IR NATIVE: + // Mangled name: AML#iterator(){} + // Public signature: /AML.iterator|8062689420742628886[0] + abstract /* fake */ override operator fun iterator(): MutableIterator + + // CHECK JVM_IR: + // Mangled name: AML#lastIndexOf(kotlin.Int){}kotlin.Int + // Public signature: /AML.lastIndexOf|-172555725694166910[0] + // CHECK JS_IR NATIVE: + // Mangled name: AML#lastIndexOf(kotlin.Int){} + // Public signature: /AML.lastIndexOf|-1881419781556272268[0] + abstract /* fake */ override fun lastIndexOf(element: Int): Int + + // CHECK JVM_IR: + // Mangled name: AML#listIterator(){}kotlin.collections.MutableListIterator + // Public signature: /AML.listIterator|2141874514656381252[0] + // CHECK JS_IR NATIVE: + // Mangled name: AML#listIterator(){} + // Public signature: /AML.listIterator|-1349974312270223114[0] + abstract /* fake */ override fun listIterator(): MutableListIterator + + // CHECK JVM_IR: + // Mangled name: AML#listIterator(kotlin.Int){}kotlin.collections.MutableListIterator + // Public signature: /AML.listIterator|1352247971240598932[0] + // CHECK JS_IR NATIVE: + // Mangled name: AML#listIterator(kotlin.Int){} + // Public signature: /AML.listIterator|2212930685100651431[0] + abstract /* fake */ override fun listIterator(index: Int): MutableListIterator + + // CHECK JVM_IR: + // Mangled name: AML#remove(kotlin.Int){}kotlin.Boolean + // Public signature: /AML.remove|-2631909738569200722[0] + // CHECK JS_IR NATIVE: + // Mangled name: AML#remove(kotlin.Int){} + // Public signature: /AML.remove|-6905763659499399195[0] + abstract /* fake */ override fun remove(element: Int): Boolean + + // CHECK JVM_IR: + // Mangled name: AML#removeAll(kotlin.collections.Collection){}kotlin.Boolean + // Public signature: /AML.removeAll|-3862070029132854703[0] + // CHECK JS_IR NATIVE: + // Mangled name: AML#removeAll(kotlin.collections.Collection){} + // Public signature: /AML.removeAll|2462148457474476520[0] + abstract /* fake */ override fun removeAll(elements: Collection): Boolean + + // CHECK JVM_IR: + // Mangled name: AML#removeAt(kotlin.Int){}kotlin.Int + // Public signature: /AML.removeAt|1718425690973201805[0] + // CHECK JS_IR NATIVE: + // Mangled name: AML#removeAt(kotlin.Int){} + // Public signature: /AML.removeAt|530622506513389985[0] + abstract /* fake */ override fun removeAt(index: Int): Int + + // CHECK JVM_IR: + // Mangled name: AML#retainAll(kotlin.collections.Collection){}kotlin.Boolean + // Public signature: /AML.retainAll|1291083757121901219[0] + // CHECK JS_IR NATIVE: + // Mangled name: AML#retainAll(kotlin.collections.Collection){} + // Public signature: /AML.retainAll|-2050809264705513045[0] + abstract /* fake */ override fun retainAll(elements: Collection): Boolean + + // CHECK JVM_IR: + // Mangled name: AML#set(kotlin.Int;kotlin.Int){}kotlin.Int + // Public signature: /AML.set|2686031312585099809[0] + // CHECK JS_IR NATIVE: + // Mangled name: AML#set(kotlin.Int;kotlin.Int){} + // Public signature: /AML.set|-213984015376347786[0] + abstract /* fake */ override operator fun set(index: Int, element: Int): Int + + // CHECK JVM_IR: + // Mangled name: AML#subList(kotlin.Int;kotlin.Int){}kotlin.collections.MutableList + // Public signature: /AML.subList|-3444312937305653937[0] + // CHECK JS_IR NATIVE: + // Mangled name: AML#subList(kotlin.Int;kotlin.Int){} + // Public signature: /AML.subList|6678865970875224003[0] + abstract /* fake */ override fun subList(fromIndex: Int, toIndex: Int): MutableList + + // CHECK: + // Mangled name: AML#testExplicitThis(){} + // Public signature: /AML.testExplicitThis|3726917819644420797[0] + fun testExplicitThis(): Unit + + // CHECK: + // Mangled name: AML{}size + // Public signature: /AML.size|-6253659984320132064[0] + abstract /* fake */ override val size: Int + // CHECK JVM_IR: + // Mangled name: AML#(){}kotlin.Int + // Public signature: /AML.size.|-3941649985161900780[0] + // CHECK JS_IR NATIVE: + // Mangled name: AML#(){} + // Public signature: /AML.size.|-8255337774232345969[0] + abstract /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: X +// Public signature: /X|null[0] +interface X { + + // CHECK JVM_IR: + // Mangled name: X#f(){}kotlin.collections.MutableList + // Public signature: /X.f|7644118277748321581[0] + // CHECK JS_IR NATIVE: + // Mangled name: X#f(){} + // Public signature: /X.f|5316533450599009716[0] + abstract fun f(): MutableList + + // CHECK: + // Mangled name: X{}xs + // Public signature: /X.xs|1063330853857063704[0] + abstract val xs: MutableList + // CHECK JVM_IR: + // Mangled name: X#(){}kotlin.collections.MutableList + // Public signature: /X.xs.|4835834621360897253[0] + // CHECK JS_IR NATIVE: + // Mangled name: X#(){} + // Public signature: /X.xs.|-6958094100501701183[0] + abstract get + +} + +// CHECK: +// Mangled name: #test(X;X?){} +// Public signature: /test|5134068917668758678[0] +fun test(x: X, nx: X?): Unit + +// CHECK: +// Mangled name: #testExtensionReceiver@kotlin.collections.MutableList(){} +// Public signature: /testExtensionReceiver|-1953518633341294637[0] +fun MutableList.testExtensionReceiver(): Unit + diff --git a/compiler/testData/ir/irText/expressions/kt30796.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt30796.sig.kt.txt new file mode 100644 index 00000000000..776b51bdefc --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt30796.sig.kt.txt @@ -0,0 +1,13 @@ +// CHECK JVM_IR: +// Mangled name: #magic(){0§}0:0 +// Public signature: /magic|-2053324167820994651[0] +// CHECK JS_IR NATIVE: +// Mangled name: #magic(){0§} +// Public signature: /magic|1377498203473786813[0] +fun magic(): T + +// CHECK: +// Mangled name: #test(0:0;0:0){0§} +// Public signature: /test|112304132393930964[0] +fun test(value: T, value2: T): Unit + diff --git a/compiler/testData/ir/irText/expressions/kt35730.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt35730.sig.kt.txt new file mode 100644 index 00000000000..5b7047b0abd --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt35730.sig.kt.txt @@ -0,0 +1,33 @@ +// CHECK: +// Mangled name: Base +// Public signature: /Base|null[0] +interface Base { + + // CHECK: + // Mangled name: Base#foo(){} + // Public signature: /Base.foo|-1041209573719867811[0] + fun foo(): Unit + +} + +// CHECK: +// Mangled name: Derived +// Public signature: /Derived|null[0] +object Derived : Base { + // CHECK: + // Mangled name: Derived#(){} + // Public signature: /Derived.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK: + // Mangled name: Derived#foo(){} + // Public signature: /Derived.foo|-1041209573719867811[0] + /* fake */ override fun foo(): Unit + +} + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + diff --git a/compiler/testData/ir/irText/expressions/kt36956.kt b/compiler/testData/ir/irText/expressions/kt36956.kt index 7e23d944f54..e3e5b37050c 100644 --- a/compiler/testData/ir/irText/expressions/kt36956.kt +++ b/compiler/testData/ir/irText/expressions/kt36956.kt @@ -1,3 +1,6 @@ +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429 + class A(private val value: T) { operator fun get(i: Int) = value operator fun set(i: Int, v: T) {} @@ -5,4 +8,4 @@ class A(private val value: T) { val aFloat = A(0.0f) -val aInt = (aFloat[1])-- \ No newline at end of file +val aInt = (aFloat[1])-- diff --git a/compiler/testData/ir/irText/expressions/kt36956.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt36956.sig.kt.txt new file mode 100644 index 00000000000..1f46b090153 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt36956.sig.kt.txt @@ -0,0 +1,60 @@ +// CHECK: +// Mangled name: {}aFloat +// Public signature: /aFloat|4391422460504083106[0] +val aFloat: A + // CHECK JVM_IR: + // Mangled name: #(){}A + // Public signature: /aFloat.|-8376703976384589815[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /aFloat.|627878515739608177[0] + get + +// CHECK: +// Mangled name: {}aInt +// Public signature: /aInt|-6794586520969567401[0] +val aInt: Float + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Float + // Public signature: /aInt.|-2970752737551036436[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /aInt.|-5118867187575203172[0] + get + +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A { + // CHECK: + // Mangled name: A{}value + // Public signature: /A.value|1987073854177347439[0] + private val value: T + // CHECK JVM_IR: + // Mangled name: A#(){}1:0 + // Public signature: /A.value.|3167862337988859752[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.value.|3260093555963109437[0] + private get + + // CHECK: + // Mangled name: A#(1:0){} + // Public signature: /A.|-8731461708390519279[0] + constructor(value: T) /* primary */ + + // CHECK JVM_IR: + // Mangled name: A#get(kotlin.Int){}1:0 + // Public signature: /A.get|4109019764351174315[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#get(kotlin.Int){} + // Public signature: /A.get|-1406503945102116889[0] + operator fun get(i: Int): T + + // CHECK: + // Mangled name: A#set(kotlin.Int;1:0){} + // Public signature: /A.set|366827667513302185[0] + operator fun set(i: Int, v: T): Unit + +} + diff --git a/compiler/testData/ir/irText/expressions/kt36963.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt36963.sig.kt.txt new file mode 100644 index 00000000000..426ee8c9934 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt36963.sig.kt.txt @@ -0,0 +1,13 @@ +// CHECK: +// Mangled name: #foo(){} +// Public signature: /foo|-1041209573719867811[0] +fun foo(): Unit + +// CHECK JVM_IR: +// Mangled name: #test(){}kotlin.reflect.KFunction0 +// Public signature: /test|-7541901321398002849[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): KFunction0 + diff --git a/compiler/testData/ir/irText/expressions/kt37570.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt37570.sig.kt.txt new file mode 100644 index 00000000000..1290f3062f4 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt37570.sig.kt.txt @@ -0,0 +1,31 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A { + // CHECK: + // Mangled name: A{}b + // Public signature: /A.b|772347207915745207[0] + val b: String + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.String + // Public signature: /A.b.|5457451065030643294[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.b.|812004636995167743[0] + get + + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #a(){}kotlin.String +// Public signature: /a|-7740409718469983371[0] +// CHECK JS_IR NATIVE: +// Mangled name: #a(){} +// Public signature: /a|-4432112437378250461[0] +fun a(): String + diff --git a/compiler/testData/ir/irText/expressions/kt37779.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt37779.sig.kt.txt new file mode 100644 index 00000000000..35e865cb100 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt37779.sig.kt.txt @@ -0,0 +1,15 @@ +// CHECK: +// Mangled name: #foo(kotlin.Array...){} +// Public signature: /foo|7137812470563281312[0] +fun foo(vararg s: String): Unit + +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +fun test1(): Unit + +// CHECK: +// Mangled name: #test2(kotlin.Array){} +// Public signature: /test2|-755890717186595402[0] +fun test2(ss: Array): Unit + diff --git a/compiler/testData/ir/irText/expressions/kt42321.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt42321.sig.kt.txt new file mode 100644 index 00000000000..22994c15a09 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt42321.sig.kt.txt @@ -0,0 +1,46 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +abstract class C { + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: C#takeT(1:0){} + // Public signature: /C.takeT|-7480648261330177149[0] + abstract fun takeT(x: L): Unit + +} + +// CHECK: +// Mangled name: #testByteDotCall(C){} +// Public signature: /testByteDotCall|7314970765595651111[0] +fun testByteDotCall(c3: C): Unit + +// CHECK: +// Mangled name: #testByteOperatorInfixCall(C){} +// Public signature: /testByteOperatorInfixCall|-2354875349940919484[0] +fun testByteOperatorInfixCall(c6: C): Unit + +// CHECK: +// Mangled name: #testLongDotCall(C){} +// Public signature: /testLongDotCall|-1826307306703812949[0] +fun testLongDotCall(c1: C): Unit + +// CHECK: +// Mangled name: #testLongOperatorInfixCall(C){} +// Public signature: /testLongOperatorInfixCall|-5615398277394944107[0] +fun testLongOperatorInfixCall(c4: C): Unit + +// CHECK: +// Mangled name: #testShortDotCall(C){} +// Public signature: /testShortDotCall|2335764331568411495[0] +fun testShortDotCall(c2: C): Unit + +// CHECK: +// Mangled name: #testShortOperatorInfixCall(C){} +// Public signature: /testShortOperatorInfixCall|-2126986004644978267[0] +fun testShortOperatorInfixCall(c5: C): Unit + diff --git a/compiler/testData/ir/irText/expressions/kt44993.kt b/compiler/testData/ir/irText/expressions/kt44993.kt index c1c606ed36c..fdc22da5958 100644 --- a/compiler/testData/ir/irText/expressions/kt44993.kt +++ b/compiler/testData/ir/irText/expressions/kt44993.kt @@ -2,6 +2,10 @@ // FIR_IDENTICAL // WITH_STDLIB // SKIP_KT_DUMP + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429 + // FILE: kt44993.kt fun f(r: KotlinBox): String = r?.data?.element!! diff --git a/compiler/testData/ir/irText/expressions/kt44993.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt44993.sig.kt.txt new file mode 100644 index 00000000000..9541611c5cc --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt44993.sig.kt.txt @@ -0,0 +1,25 @@ +// CHECK: +// Mangled name: KotlinBox +// Public signature: /KotlinBox|null[0] +class KotlinBox { + // CHECK: + // Mangled name: KotlinBox{}data + // Public signature: /KotlinBox.data|4273011692695536650[0] + val data: T? + // CHECK JVM_IR: + // Mangled name: KotlinBox#(){}1:0? + // Public signature: /KotlinBox.data.|-1848755759162008356[0] + get + + // CHECK: + // Mangled name: KotlinBox#(1:0?){} + // Public signature: /KotlinBox.|-6137285739236751325[0] + constructor(data: T?) /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #f(KotlinBox){}kotlin.String +// Public signature: /f|-1490534641019781585[0] +fun f(r: KotlinBox): String + diff --git a/compiler/testData/ir/irText/expressions/kt45022.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt45022.sig.kt.txt new file mode 100644 index 00000000000..ee84a358823 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt45022.sig.kt.txt @@ -0,0 +1,25 @@ +// CHECK: +// Mangled name: X +// Public signature: /X|null[0] +object X { + // CHECK: + // Mangled name: X#(){} + // Public signature: /X.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK: + // Mangled name: X#plusAssign(kotlin.Any){} + // Public signature: /X.plusAssign|-8710543505665420833[0] + operator fun plusAssign(any: Any): Unit + +} + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + +// CHECK: +// Mangled name: AX +// Public signature: /AX|null[0] +typealias AX = X diff --git a/compiler/testData/ir/irText/expressions/kt47082.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt47082.sig.kt.txt new file mode 100644 index 00000000000..a472d0e6af4 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt47082.sig.kt.txt @@ -0,0 +1,41 @@ +// CHECK: +// Mangled name: Base +// Public signature: /Base|null[0] +interface Base { + +} + +// CHECK: +// Mangled name: Derived +// Public signature: /Derived|null[0] +interface Derived : Base { + +} + +// CHECK: +// Mangled name: Receiver +// Public signature: /Receiver|null[0] +interface Receiver { + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +fun box(): String + +// CHECK JVM_IR: +// Mangled name: #foo(Receiver<0:0>){0§}0:0 +// Public signature: /foo|1374936692204158291[0] +fun foo(r: Receiver): R + +// CHECK JVM_IR: +// Mangled name: #produce(kotlin.Function1,kotlin.Unit>){0§}0:0 +// Public signature: /produce|-8861632226015581377[0] +fun produce(block: @ExtensionFunctionType Function1, Unit>): E + +// CHECK JVM_IR: +// Mangled name: #toChannel@Receiver<0:0>(0:1){0§;1§>}0:1 +// Public signature: /toChannel|5706628675310331058[0] +fun > Receiver.toChannel(destination: C): C + diff --git a/compiler/testData/ir/irText/expressions/kt47245.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt47245.sig.kt.txt new file mode 100644 index 00000000000..9a448659e25 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt47245.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + diff --git a/compiler/testData/ir/irText/expressions/kt47328.kt b/compiler/testData/ir/irText/expressions/kt47328.kt index 34044a8242e..d37d85cbc44 100644 --- a/compiler/testData/ir/irText/expressions/kt47328.kt +++ b/compiler/testData/ir/irText/expressions/kt47328.kt @@ -6,6 +6,9 @@ // TARGET_BACKEND: JVM_IR // WITH_STDLIB +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429 + interface A { val x: Int } class B(@JvmField override val x: Int): A diff --git a/compiler/testData/ir/irText/expressions/kt47328.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt47328.sig.kt.txt new file mode 100644 index 00000000000..87f3bf46e7f --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt47328.sig.kt.txt @@ -0,0 +1,76 @@ +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +class B : A { + // CHECK: + // Mangled name: B{}x + // Public signature: /B.x|-8060530855978347579[0] + override val x: Int + // CHECK JVM_IR: + // Mangled name: B#(){}kotlin.Int + // Public signature: /B.x.|4966956098150895696[0] + override get + + // CHECK: + // Mangled name: B#(kotlin.Int){} + // Public signature: /B.|-5182794243525578284[0] + constructor(x: Int) /* primary */ + +} + +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C{}d + // Public signature: /C.d|5174763769109925331[0] + val d: D + // CHECK JVM_IR: + // Mangled name: C#(){}1:0 + // Public signature: /C.d.|4569732825360858900[0] + get + + // CHECK: + // Mangled name: C#(1:0){} + // Public signature: /C.|-8731461708390519279[0] + constructor(d: D) /* primary */ + +} + +// CHECK: +// Mangled name: E +// Public signature: /E|null[0] +class E { + // CHECK: + // Mangled name: E{}ax + // Public signature: /E.ax|7263490434229062825[0] + val ax: Int + // CHECK JVM_IR: + // Mangled name: E#(){}kotlin.Int + // Public signature: /E.ax.|-2085846616989636187[0] + get + + // CHECK: + // Mangled name: E#(C){} + // Public signature: /E.|498936025095833067[0] + constructor(c: C) /* primary */ + +} + +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +interface A { + + // CHECK: + // Mangled name: A{}x + // Public signature: /A.x|-8060530855978347579[0] + abstract val x: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.x.|4966956098150895696[0] + abstract get + +} + diff --git a/compiler/testData/ir/irText/expressions/kt47450.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt47450.sig.kt.txt new file mode 100644 index 00000000000..3902c1afc9b --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt47450.sig.kt.txt @@ -0,0 +1,8 @@ +// CHECK JVM_IR: +// Mangled name: #test(kotlin.Int){}kotlin.String +// Public signature: /test|-3078440043009540212[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test(kotlin.Int){} +// Public signature: /test|7577436859890467564[0] +fun test(z: Int): String + diff --git a/compiler/testData/ir/irText/expressions/kt48708.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt48708.sig.kt.txt new file mode 100644 index 00000000000..aa3de40b145 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt48708.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #takeInt(kotlin.Int){} +// Public signature: /takeInt|7506881980524470334[0] +fun takeInt(x: Int): Unit + +// CHECK: +// Mangled name: #test(kotlin.Boolean){} +// Public signature: /test|-88931722341009933[0] +fun test(b: Boolean): Unit + diff --git a/compiler/testData/ir/irText/expressions/kt48806.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt48806.sig.kt.txt new file mode 100644 index 00000000000..8bb8dbc2ec2 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt48806.sig.kt.txt @@ -0,0 +1,35 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A { + // CHECK: + // Mangled name: A{}test_1 + // Public signature: /A.test_1|2561121963395013001[0] + val test_1: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.test_1.|-1575767838400056236[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.test_1.|5475165570968103805[0] + get + + // CHECK: + // Mangled name: A{}test_2 + // Public signature: /A.test_2|-375633585805266132[0] + val test_2: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.test_2.|1438436459582874026[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.test_2.|-7104054319481711057[0] + get + + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/expressions/kt49203.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt49203.sig.kt.txt new file mode 100644 index 00000000000..5866954f4fc --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt49203.sig.kt.txt @@ -0,0 +1,115 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +abstract class A { + // CHECK: + // Mangled name: A{}x + // Public signature: /A.x|-8060530855978347579[0] + lateinit var x: X + // CHECK JVM_IR: + // Mangled name: A#(){}X + // Public signature: /A.x.|4318922799872535978[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.x.|1482705010654679335[0] + get + // CHECK: + // Mangled name: A#(X){} + // Public signature: /A.x.|-2731605021834565340[0] + private set + + // CHECK: + // Mangled name: A{}y + // Public signature: /A.y|3625903257357557171[0] + var y: X + // CHECK JVM_IR: + // Mangled name: A#(){}X + // Public signature: /A.y.|-1726466926791307923[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.y.|-7902422373892128922[0] + get + // CHECK: + // Mangled name: A#(X){} + // Public signature: /A.y.|-4972047968960381371[0] + private set + + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +class B : A { + // CHECK: + // Mangled name: B#(){} + // Public signature: /B.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: B{}x + // Public signature: /B.x|-8060530855978347579[0] + /* fake */ override lateinit var x: X + // CHECK JVM_IR: + // Mangled name: B#(){}X + // Public signature: /B.x.|4318922799872535978[0] + // CHECK JS_IR NATIVE: + // Mangled name: B#(){} + // Public signature: /B.x.|1482705010654679335[0] + /* fake */ override get(): X + + // CHECK: + // Mangled name: B{}y + // Public signature: /B.y|3625903257357557171[0] + /* fake */ override var y: X + // CHECK JVM_IR: + // Mangled name: B#(){}X + // Public signature: /B.y.|-1726466926791307923[0] + // CHECK JS_IR NATIVE: + // Mangled name: B#(){} + // Public signature: /B.y.|-7902422373892128922[0] + /* fake */ override get(): X + +} + +// CHECK: +// Mangled name: X +// Public signature: /X|null[0] +class X { + // CHECK: + // Mangled name: X{}value + // Public signature: /X.value|1987073854177347439[0] + var value: String + // CHECK JVM_IR: + // Mangled name: X#(){}kotlin.String + // Public signature: /X.value.|-7202092821145242726[0] + // CHECK JS_IR NATIVE: + // Mangled name: X#(){} + // Public signature: /X.value.|3260093555963109437[0] + get + // CHECK: + // Mangled name: X#(kotlin.String){} + // Public signature: /X.value.|7375160065891674826[0] + set + + // CHECK: + // Mangled name: X#(){} + // Public signature: /X.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: X#plusAssign(kotlin.String){} + // Public signature: /X.plusAssign|-9128532564902303626[0] + operator fun plusAssign(data: String): Unit + +} + +// CHECK: +// Mangled name: #test(B){} +// Public signature: /test|3809392349795657853[0] +fun test(b: B): Unit + diff --git a/compiler/testData/ir/irText/expressions/kt50028.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt50028.sig.kt.txt new file mode 100644 index 00000000000..d9786fd3790 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt50028.sig.kt.txt @@ -0,0 +1,16 @@ +// CHECK JVM_IR: +// Mangled name: #test_1(){}kotlin.String +// Public signature: /test_1|118893848170480080[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test_1(){} +// Public signature: /test_1|9184463131871799545[0] +fun test_1(): String + +// CHECK JVM_IR: +// Mangled name: #test_2(kotlin.Boolean){}kotlin.Boolean +// Public signature: /test_2|1864697323811942156[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test_2(kotlin.Boolean){} +// Public signature: /test_2|-1271056002368224685[0] +fun test_2(b: Boolean): Boolean + diff --git a/compiler/testData/ir/irText/expressions/kt51036.sig.kt.txt b/compiler/testData/ir/irText/expressions/kt51036.sig.kt.txt new file mode 100644 index 00000000000..9f90baf134d --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt51036.sig.kt.txt @@ -0,0 +1,32 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A { + // CHECK: + // Mangled name: A.Companion + // Public signature: /A.Companion|null[0] + companion object Companion { + // CHECK: + // Mangled name: A.Companion#(){} + // Public signature: /A.Companion.|-5645683436151566731[0] + private constructor() /* primary */ + + } + + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: A#close(){} + // Public signature: /A.close|-6769325599864818364[0] + fun close(): Unit + + // CHECK: + // Mangled name: A#invoke@kotlin.String(){} + // Public signature: /A.invoke|8337314068813101957[0] + operator fun String.invoke(): Unit + +} + diff --git a/compiler/testData/ir/irText/expressions/lambdaInCAO.sig.kt.txt b/compiler/testData/ir/irText/expressions/lambdaInCAO.sig.kt.txt new file mode 100644 index 00000000000..4cb533c2529 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/lambdaInCAO.sig.kt.txt @@ -0,0 +1,33 @@ +// CHECK JVM_IR: +// Mangled name: #get@kotlin.Any(kotlin.Function0){}kotlin.Int +// Public signature: /get|-8047211373454001717[0] +// CHECK JS_IR NATIVE: +// Mangled name: #get@kotlin.Any(kotlin.Function0){} +// Public signature: /get|-138406221196188690[0] +operator fun Any.get(index: Function0): Int + +// CHECK: +// Mangled name: #plusAssign@kotlin.Any(kotlin.Function0){} +// Public signature: /plusAssign|7373131702739256667[0] +operator fun Any.plusAssign(lambda: Function0): Unit + +// CHECK: +// Mangled name: #set@kotlin.Any(kotlin.Function0;kotlin.Int){} +// Public signature: /set|-1483796712330329080[0] +operator fun Any.set(index: Function0, value: Int): Unit + +// CHECK: +// Mangled name: #test1(kotlin.Any){} +// Public signature: /test1|-4133164698161335314[0] +fun test1(a: Any): Unit + +// CHECK: +// Mangled name: #test2(kotlin.Any){} +// Public signature: /test2|-8648451680149324146[0] +fun test2(a: Any): Unit + +// CHECK: +// Mangled name: #test3(kotlin.Any){} +// Public signature: /test3|165168275269731002[0] +fun test3(a: Any): Unit + diff --git a/compiler/testData/ir/irText/expressions/literals.sig.kt.txt b/compiler/testData/ir/irText/expressions/literals.sig.kt.txt new file mode 100644 index 00000000000..976803eee1b --- /dev/null +++ b/compiler/testData/ir/irText/expressions/literals.sig.kt.txt @@ -0,0 +1,204 @@ +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test1.|3978508226793108919[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test1.|-5735092642142423279[0] + get + +// CHECK: +// Mangled name: {}test2 +// Public signature: /test2|2517758057000911509[0] +val test2: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test2.|-8779933517717592707[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test2.|-5218942532816206869[0] + get + +// CHECK: +// Mangled name: {}test3 +// Public signature: /test3|7677556066983021166[0] +val test3: Boolean + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Boolean + // Public signature: /test3.|-4495679483591984624[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test3.|-7333791615083236686[0] + get + +// CHECK: +// Mangled name: {}test4 +// Public signature: /test4|-9115637610245762085[0] +val test4: Boolean + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Boolean + // Public signature: /test4.|-1669012261506491766[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test4.|4166854324968284003[0] + get + +// CHECK: +// Mangled name: {}test5 +// Public signature: /test5|4734809624271551895[0] +val test5: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /test5.|-4328606172995874356[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test5.|-839819880171293643[0] + get + +// CHECK: +// Mangled name: {}test6 +// Public signature: /test6|-2606527149405855403[0] +val test6: Nothing? + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Nothing? + // Public signature: /test6.|6358003219398795330[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test6.|2028965735388282488[0] + get + +// CHECK: +// Mangled name: {}test7 +// Public signature: /test7|1362036650170262859[0] +val test7: Long + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Long + // Public signature: /test7.|-8274692998932432118[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test7.|-4463638325142628163[0] + get + +// CHECK: +// Mangled name: {}test8 +// Public signature: /test8|5640428216506241852[0] +val test8: Long + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Long + // Public signature: /test8.|-5011755774110501884[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test8.|-4670710835380513070[0] + get + +// CHECK: +// Mangled name: {}test9 +// Public signature: /test9|2260604978975893973[0] +val test9: Double + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Double + // Public signature: /test9.|-3169226270054479849[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test9.|-4967207149018192355[0] + get + +// CHECK: +// Mangled name: {}test10 +// Public signature: /test10|7722044079085065924[0] +val test10: Double + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Double + // Public signature: /test10.|-7075326798963060579[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test10.|6808545484579801258[0] + get + +// CHECK: +// Mangled name: {}test11 +// Public signature: /test11|-454677644144124961[0] +val test11: Float + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Float + // Public signature: /test11.|-4693352942290004291[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test11.|-7622577667796504757[0] + get + +// CHECK: +// Mangled name: {}test12 +// Public signature: /test12|2262878138601795216[0] +val test12: Float + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Float + // Public signature: /test12.|-5200207810195031983[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test12.|-7171048314773700251[0] + get + +// CHECK: +// Mangled name: {}test13 +// Public signature: /test13|-3048520423764566251[0] +val test13: Char + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Char + // Public signature: /test13.|-7552934425637710367[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test13.|-2623090371756078172[0] + get + +// CHECK: +// Mangled name: {}testB +// Public signature: /testB|-4103209441471670288[0] +val testB: Byte + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Byte + // Public signature: /testB.|4960377474465802772[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testB.|6641248426536617202[0] + get + +// CHECK: +// Mangled name: {}testS +// Public signature: /testS|-8011761141900080315[0] +val testS: Short + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Short + // Public signature: /testS.|-6367854356791483176[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testS.|-5493437784162647812[0] + get + +// CHECK: +// Mangled name: {}testI +// Public signature: /testI|8992125378794908852[0] +val testI: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /testI.|4280540041845255030[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testI.|3926506026358499468[0] + get + +// CHECK: +// Mangled name: {}testL +// Public signature: /testL|6948716296317389571[0] +val testL: Long + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Long + // Public signature: /testL.|-6376959304814241397[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testL.|-7432469214046456506[0] + get + diff --git a/compiler/testData/ir/irText/expressions/memberTypeArguments.kt b/compiler/testData/ir/irText/expressions/memberTypeArguments.kt index 39381be853c..63e41950722 100644 --- a/compiler/testData/ir/irText/expressions/memberTypeArguments.kt +++ b/compiler/testData/ir/irText/expressions/memberTypeArguments.kt @@ -1,4 +1,8 @@ // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR +// ^ KT-57429 + class GenericClass(val value: T) { fun withNewValue(newValue: T) = GenericClass(newValue) -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/expressions/memberTypeArguments.sig.kt.txt b/compiler/testData/ir/irText/expressions/memberTypeArguments.sig.kt.txt new file mode 100644 index 00000000000..735031e24c9 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/memberTypeArguments.sig.kt.txt @@ -0,0 +1,31 @@ +// CHECK: +// Mangled name: GenericClass +// Public signature: /GenericClass|null[0] +class GenericClass { + // CHECK: + // Mangled name: GenericClass{}value + // Public signature: /GenericClass.value|1987073854177347439[0] + val value: T + // CHECK JVM_IR: + // Mangled name: GenericClass#(){}1:0 + // Public signature: /GenericClass.value.|3167862337988859752[0] + // CHECK JS_IR NATIVE: + // Mangled name: GenericClass#(){} + // Public signature: /GenericClass.value.|3260093555963109437[0] + get + + // CHECK: + // Mangled name: GenericClass#(1:0){} + // Public signature: /GenericClass.|-8731461708390519279[0] + constructor(value: T) /* primary */ + + // CHECK JVM_IR: + // Mangled name: GenericClass#withNewValue(1:0){}GenericClass<1:0> + // Public signature: /GenericClass.withNewValue|7171026453547930712[0] + // CHECK JS_IR NATIVE: + // Mangled name: GenericClass#withNewValue(1:0){} + // Public signature: /GenericClass.withNewValue|-2595992965033306150[0] + fun withNewValue(newValue: T): GenericClass + +} + diff --git a/compiler/testData/ir/irText/expressions/membersImportedFromObject.kt b/compiler/testData/ir/irText/expressions/membersImportedFromObject.kt index 40429706853..44951c7fd80 100644 --- a/compiler/testData/ir/irText/expressions/membersImportedFromObject.kt +++ b/compiler/testData/ir/irText/expressions/membersImportedFromObject.kt @@ -1,4 +1,9 @@ // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: JS_IR +// MUTE_SIGNATURE_COMPARISON_K2: NATIVE +// ^ KT-57818 + import A.foo import A.bar import A.fooExt @@ -14,4 +19,4 @@ object A { val test1 = foo() val test2 = bar val test3 = 1.fooExt() -val test4 = 1.barExt \ No newline at end of file +val test4 = 1.barExt diff --git a/compiler/testData/ir/irText/expressions/membersImportedFromObject.sig.kt.txt b/compiler/testData/ir/irText/expressions/membersImportedFromObject.sig.kt.txt new file mode 100644 index 00000000000..bd2be1ab858 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/membersImportedFromObject.sig.kt.txt @@ -0,0 +1,99 @@ +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test1.|3978508226793108919[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test1.|-5735092642142423279[0] + get + +// CHECK: +// Mangled name: {}test2 +// Public signature: /test2|2517758057000911509[0] +val test2: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test2.|-8779933517717592707[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test2.|-5218942532816206869[0] + get + +// CHECK: +// Mangled name: {}test3 +// Public signature: /test3|7677556066983021166[0] +val test3: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test3.|6145294165644146033[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test3.|-7333791615083236686[0] + get + +// CHECK: +// Mangled name: {}test4 +// Public signature: /test4|-9115637610245762085[0] +val test4: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test4.|-8911174941514444072[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test4.|4166854324968284003[0] + get + +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +object A { + // CHECK: + // Mangled name: A{}bar + // Public signature: /A.bar|-7864284097863469857[0] + val bar: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.bar.|-7403724005139201014[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.bar.|6880642144337645699[0] + get + + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: A#foo(){}kotlin.Int + // Public signature: /A.foo|-1256155405684507276[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#foo(){} + // Public signature: /A.foo|-1041209573719867811[0] + fun foo(): Int + + // CHECK JVM_IR: + // Mangled name: A#fooExt@kotlin.Int(){}kotlin.Int + // Public signature: /A.fooExt|-4866436612837697613[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#fooExt@kotlin.Int(){} + // Public signature: /A.fooExt|6052249612599645327[0] + fun Int.fooExt(): Int + + // CHECK: + // Mangled name: A@kotlin.Int{}barExt + // Public signature: /A.barExt|-1171921628503212517[0] + val Int.barExt: Int + // CHECK JVM_IR: + // Mangled name: A#@kotlin.Int(){}kotlin.Int + // Public signature: /A.barExt.|-1782416356061265847[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#@kotlin.Int(){} + // Public signature: /A.barExt.|8189923245320116620[0] + get(): Int + +} + diff --git a/compiler/testData/ir/irText/expressions/multipleSmartCasts.sig.kt.txt b/compiler/testData/ir/irText/expressions/multipleSmartCasts.sig.kt.txt new file mode 100644 index 00000000000..9b481dc5061 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/multipleSmartCasts.sig.kt.txt @@ -0,0 +1,35 @@ +// CHECK: +// Mangled name: IC1 +// Public signature: /IC1|null[0] +interface IC1 { + + // CHECK JVM_IR: + // Mangled name: IC1#component1(){}kotlin.Int + // Public signature: /IC1.component1|-8217597213800111288[0] + // CHECK JS_IR NATIVE: + // Mangled name: IC1#component1(){} + // Public signature: /IC1.component1|162597135895221648[0] + abstract operator fun component1(): Int + +} + +// CHECK: +// Mangled name: IC2 +// Public signature: /IC2|null[0] +interface IC2 { + + // CHECK JVM_IR: + // Mangled name: IC2#component2(){}kotlin.String + // Public signature: /IC2.component2|1228864375093914597[0] + // CHECK JS_IR NATIVE: + // Mangled name: IC2#component2(){} + // Public signature: /IC2.component2|3796717572321500973[0] + abstract operator fun component2(): String + +} + +// CHECK: +// Mangled name: #test(kotlin.Any){} +// Public signature: /test|-7985792749252989017[0] +fun test(x: Any): Unit + diff --git a/compiler/testData/ir/irText/expressions/multipleThisReferences.kt b/compiler/testData/ir/irText/expressions/multipleThisReferences.kt index eda4a90b104..0e5145394fd 100644 --- a/compiler/testData/ir/irText/expressions/multipleThisReferences.kt +++ b/compiler/testData/ir/irText/expressions/multipleThisReferences.kt @@ -1,4 +1,9 @@ // FIR_IDENTICAL +// DUMP_LOCAL_DECLARATION_SIGNATURES + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57430 + class Outer { open inner class Inner(val x: Int) } @@ -7,4 +12,4 @@ class Host(val y: Int) { fun Outer.test() = object : Outer.Inner(42) { val xx = x + y } -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/expressions/multipleThisReferences.sig.kt.txt b/compiler/testData/ir/irText/expressions/multipleThisReferences.sig.kt.txt new file mode 100644 index 00000000000..2e1517a3ef0 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/multipleThisReferences.sig.kt.txt @@ -0,0 +1,102 @@ +// CHECK: +// Mangled name: Host +// Public signature: /Host|null[0] +class Host { + // CHECK: + // Mangled name: Host{}y + // Public signature: /Host.y|3625903257357557171[0] + val y: Int + field + // CHECK JVM_IR: + // Mangled name: Host#(){}kotlin.Int + // Public signature: /Host.y.|-6745575372101973707[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#(){} + // Public signature: /Host.y.|-7902422373892128922[0] + get + + // CHECK: + // Mangled name: Host#(kotlin.Int){} + // Public signature: /Host.|-5182794243525578284[0] + constructor(y: Int) /* primary */ + + // CHECK JVM_IR: + // Mangled name: Host#test@Outer(){}Outer.Inner + // Public signature: /Host.test|-982409629050476808[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#test@Outer(){} + // Public signature: /Host.test|-3179256530033214921[0] + fun Outer.test(): Inner + // CHECK JVM_IR: + // Mangled name: Host#test@Outer(){}Outer.Inner. + // CHECK JS_IR NATIVE: + // Mangled name: Host#test@Outer(){}. + local class : Inner { + // CHECK JVM_IR: + // Mangled name: Host#test@Outer(){}Outer.Inner.{}xx + // CHECK JS_IR NATIVE: + // Mangled name: Host#test@Outer(){}.{}xx + val xx: Int + field + // CHECK JVM_IR: + // Mangled name: Host#test@Outer(){}Outer.Inner.#(){}kotlin.Int + // CHECK JS_IR NATIVE: + // Mangled name: Host#test@Outer(){}.#(){} + get + + // CHECK JVM_IR: + // Mangled name: Host#test@Outer(){}Outer.Inner.#(){} + // CHECK JS_IR NATIVE: + // Mangled name: Host#test@Outer(){}.#(){} + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Host#test@Outer(){}Outer.Inner.{}x + // CHECK JS_IR NATIVE: + // Mangled name: Host#test@Outer(){}.{}x + /* fake */ override val x: Int + // CHECK JVM_IR: + // Mangled name: Host#test@Outer(){}Outer.Inner.#(){}kotlin.Int + // CHECK JS_IR NATIVE: + // Mangled name: Host#test@Outer(){}.#(){} + /* fake */ override get(): Int + + } + +} + +// CHECK: +// Mangled name: Outer +// Public signature: /Outer|null[0] +class Outer { + // CHECK: + // Mangled name: Outer.Inner + // Public signature: /Outer.Inner|null[0] + open inner class Inner { + // CHECK: + // Mangled name: Outer.Inner{}x + // Public signature: /Outer.Inner.x|-8060530855978347579[0] + val x: Int + field + // CHECK JVM_IR: + // Mangled name: Outer.Inner#(){}kotlin.Int + // Public signature: /Outer.Inner.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Outer.Inner#(){} + // Public signature: /Outer.Inner.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Outer.Inner#(kotlin.Int){} + // Public signature: /Outer.Inner.|-5182794243525578284[0] + constructor(x: Int) /* primary */ + + } + + // CHECK: + // Mangled name: Outer#(){} + // Public signature: /Outer.|-5645683436151566731[0] + constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/expressions/nullCheckOnGenericLambdaReturn.kt b/compiler/testData/ir/irText/expressions/nullCheckOnGenericLambdaReturn.kt index b00698d03ea..a6d94daa940 100644 --- a/compiler/testData/ir/irText/expressions/nullCheckOnGenericLambdaReturn.kt +++ b/compiler/testData/ir/irText/expressions/nullCheckOnGenericLambdaReturn.kt @@ -1,5 +1,6 @@ // TARGET_BACKEND: JVM // FIR_IDENTICAL + // FILE: nullCheckOnGenericLambdaReturn.kt fun checkAny(fn: () -> Any) = fn() @@ -26,4 +27,4 @@ public class J { public static String foo() { return null; } public static @NotNull String nnFoo() { return null; } -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/expressions/nullCheckOnGenericLambdaReturn.sig.kt.txt b/compiler/testData/ir/irText/expressions/nullCheckOnGenericLambdaReturn.sig.kt.txt new file mode 100644 index 00000000000..1a10e30662b --- /dev/null +++ b/compiler/testData/ir/irText/expressions/nullCheckOnGenericLambdaReturn.sig.kt.txt @@ -0,0 +1,45 @@ +// CHECK JVM_IR: +// Mangled name: #checkAny(kotlin.Function0){}kotlin.Any +// Public signature: /checkAny|3822573499379692767[0] +fun checkAny(fn: Function0): Any + +// CHECK JVM_IR: +// Mangled name: #checkAnyN(kotlin.Function0){}kotlin.Any? +// Public signature: /checkAnyN|2531653624856991874[0] +fun checkAnyN(fn: Function0): Any? + +// CHECK JVM_IR: +// Mangled name: #checkT(kotlin.Function0<0:0>){0§}0:0 +// Public signature: /checkT|-7816327292579279299[0] +fun checkT(fn: Function0): T + +// CHECK JVM_IR: +// Mangled name: #checkTAny(kotlin.Function0<0:0>){0§}0:0 +// Public signature: /checkTAny|3646405182225880944[0] +fun checkTAny(fn: Function0): T + +// CHECK JVM_IR: +// Mangled name: #id(0:0){0§}0:0 +// Public signature: /id|-6791396263062521506[0] +fun id(x: T): T + +// CHECK JVM_IR: +// Mangled name: #test1(){}kotlin.String? +// Public signature: /test1|-4425504554595636049[0] +fun test1(): String? + +// CHECK JVM_IR: +// Mangled name: #test2(){}kotlin.String +// Public signature: /test2|7756882030981116149[0] +fun test2(): String + +// CHECK JVM_IR: +// Mangled name: #test3(){}kotlin.String? +// Public signature: /test3|-1042227207464237527[0] +fun test3(): String? + +// CHECK JVM_IR: +// Mangled name: #test4(){}kotlin.String +// Public signature: /test4|4822743421999784081[0] +fun test4(): String + diff --git a/compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.sig.kt.txt b/compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.sig.kt.txt new file mode 100644 index 00000000000..3b0380debf3 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.sig.kt.txt @@ -0,0 +1,57 @@ +// CHECK: +// Mangled name: {}test2 +// Public signature: /test2|2517758057000911509[0] +val test2: Function0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function0 + // Public signature: /test2.|-3521014862279202095[0] + get + +// CHECK: +// Mangled name: {}test3 +// Public signature: /test3|7677556066983021166[0] +val test3: Function0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function0 + // Public signature: /test3.|-2771730067305258179[0] + get + +// CHECK: +// Mangled name: {}test4 +// Public signature: /test4|-9115637610245762085[0] +val test4: Function0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function0 + // Public signature: /test4.|-8396604175230297932[0] + get + +// CHECK JVM_IR: +// Mangled name: #checkAny(kotlin.Function0){}kotlin.Any +// Public signature: /checkAny|3822573499379692767[0] +fun checkAny(fn: Function0): Any + +// CHECK JVM_IR: +// Mangled name: #checkAnyN(kotlin.Function0){}kotlin.Any? +// Public signature: /checkAnyN|2531653624856991874[0] +fun checkAnyN(fn: Function0): Any? + +// CHECK JVM_IR: +// Mangled name: #id(0:0){0§}0:0 +// Public signature: /id|-6791396263062521506[0] +fun id(x: T): T + +// CHECK JVM_IR: +// Mangled name: #test1(){}kotlin.Any +// Public signature: /test1|-7147480710941941177[0] +fun test1(): Any + +// CHECK JVM_IR: +// Mangled name: #test5(){}kotlin.Any? +// Public signature: /test5|-4912917521390671072[0] +fun test5(): Any? + +// CHECK JVM_IR: +// Mangled name: #test6(){}kotlin.Any? +// Public signature: /test6|-7389759467691093908[0] +fun test6(): Any? + diff --git a/compiler/testData/ir/irText/expressions/objectAsCallable.kt b/compiler/testData/ir/irText/expressions/objectAsCallable.kt index 35167f2edaf..2087d0fb323 100644 --- a/compiler/testData/ir/irText/expressions/objectAsCallable.kt +++ b/compiler/testData/ir/irText/expressions/objectAsCallable.kt @@ -1,6 +1,9 @@ // 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/objectAsCallable.sig.kt.txt b/compiler/testData/ir/irText/expressions/objectAsCallable.sig.kt.txt new file mode 100644 index 00000000000..62b2ed86e5d --- /dev/null +++ b/compiler/testData/ir/irText/expressions/objectAsCallable.sig.kt.txt @@ -0,0 +1,155 @@ +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test1.|3978508226793108919[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test1.|-5735092642142423279[0] + get + +// CHECK: +// Mangled name: {}test2 +// Public signature: /test2|2517758057000911509[0] +val test2: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test2.|-8779933517717592707[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test2.|-5218942532816206869[0] + get + +// CHECK: +// Mangled name: En +// Public signature: /En|null[0] +enum class En : Enum { + // CHECK: + // Mangled name: En#(){} + // Public signature: /En.|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK: + // Mangled name: En.X + // Public signature: /En.X|null[0] + X + + // CHECK JVM_IR: + // Mangled name: En#valueOf#static(kotlin.String){}En + // Public signature: /En.valueOf|-1047188124757226812[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#valueOf#static(kotlin.String){} + // Public signature: /En.valueOf|-4683474617854611729[0] + fun valueOf(value: String): En + + // CHECK JVM_IR: + // Mangled name: En#values#static(){}kotlin.Array + // Public signature: /En.values|-6442868649398371099[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#values#static(){} + // Public signature: /En.values|-8715569000920726747[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: En#clone(){}kotlin.Any + // Public signature: /En.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#compareTo(En){} + // Public signature: /En.compareTo|3555292261046836181[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: En#compareTo(En){}kotlin.Int + // Public signature: /En.compareTo|7450321438177070471[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#equals(kotlin.Any?){} + // Public signature: /En.equals|4638265728071529943[0] + /* fake */ override operator fun compareTo(other: En): Int + + // CHECK JVM_IR: + // Mangled name: En#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /En.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#hashCode(){} + // Public signature: /En.hashCode|3409210261493131192[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: En#hashCode(){}kotlin.Int + // Public signature: /En.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#toString(){} + // Public signature: /En.toString|-1522858123163872138[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: En#toString(){}kotlin.String + // Public signature: /En.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#static{}entries + // Public signature: /En.entries|-5134227801081826149[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: En#static{}entries + // Public signature: /En.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: En##static(){}kotlin.enums.EnumEntries + // Public signature: /En.entries.|7832995474718587298[0] + // CHECK JS_IR NATIVE: + // Mangled name: En{}name + // Public signature: /En.name|4231860309499509769[0] + get(): EnumEntries + + // CHECK: + // Mangled name: En{}name + // Public signature: /En.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: En#(){}kotlin.String + // Public signature: /En.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: En{}ordinal + // Public signature: /En.ordinal|1912745122988592376[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: En{}ordinal + // Public signature: /En.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: En#(){}kotlin.Int + // Public signature: /En.ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: A + // Public signature: /A|null[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +object A { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + private constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #invoke@A(kotlin.Int){}kotlin.Int +// Public signature: /invoke|503088749404942002[0] +// CHECK JS_IR NATIVE: +// Mangled name: #invoke@En(kotlin.Int){} +// Public signature: /invoke|3683819464130194669[0] +operator fun A.invoke(i: Int): Int + +// CHECK JVM_IR: +// Mangled name: #invoke@En(kotlin.Int){}kotlin.Int +// Public signature: /invoke|-7019391879885662247[0] +operator fun En.invoke(i: Int): Int + diff --git a/compiler/testData/ir/irText/expressions/objectByNameInsideObject.kt b/compiler/testData/ir/irText/expressions/objectByNameInsideObject.kt index 5c34a8779c0..4f602d8b3aa 100644 --- a/compiler/testData/ir/irText/expressions/objectByNameInsideObject.kt +++ b/compiler/testData/ir/irText/expressions/objectByNameInsideObject.kt @@ -1,7 +1,12 @@ // FIR_IDENTICAL +// DUMP_LOCAL_DECLARATION_SIGNATURES + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57428 + open class Base(val f1: () -> Any) object Thing : Base({ Thing }) { fun test1() = Thing fun test2() = this -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/expressions/objectByNameInsideObject.sig.kt.txt b/compiler/testData/ir/irText/expressions/objectByNameInsideObject.sig.kt.txt new file mode 100644 index 00000000000..3e5b7abde92 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/objectByNameInsideObject.sig.kt.txt @@ -0,0 +1,68 @@ +// CHECK: +// Mangled name: Base +// Public signature: /Base|null[0] +open class Base { + // CHECK: + // Mangled name: Base{}f1 + // Public signature: /Base.f1|-3626880138223960403[0] + val f1: Function0 + field + // CHECK JVM_IR: + // Mangled name: Base#(){}kotlin.Function0 + // Public signature: /Base.f1.|8566118280674785385[0] + // CHECK JS_IR NATIVE: + // Mangled name: Base#(){} + // Public signature: /Base.f1.|-4995485398991269878[0] + get + + // CHECK: + // Mangled name: Base#(kotlin.Function0){} + // Public signature: /Base.|-4146636346230466645[0] + constructor(f1: Function0) /* primary */ + +} + +// CHECK: +// Mangled name: Thing +// Public signature: /Thing|null[0] +object Thing : Base { + // CHECK: + // Mangled name: Thing#(){} + // Public signature: /Thing.|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK JVM_IR: + // Mangled name: Thing#(){}##static(){}kotlin.Any + // CHECK JS_IR NATIVE: + // Mangled name: Thing#(){}##static(){} + local fun (): Any + + // CHECK JVM_IR: + // Mangled name: Thing#test1(){}Thing + // Public signature: /Thing.test1|3967638963180272121[0] + // CHECK JS_IR NATIVE: + // Mangled name: Thing#test1(){} + // Public signature: /Thing.test1|4297044443957252634[0] + fun test1(): Thing + + // CHECK JVM_IR: + // Mangled name: Thing#test2(){}Thing + // Public signature: /Thing.test2|-7201124175106784013[0] + // CHECK JS_IR NATIVE: + // Mangled name: Thing#test2(){} + // Public signature: /Thing.test2|4279114864133353152[0] + fun test2(): Thing + + // CHECK: + // Mangled name: Thing{}f1 + // Public signature: /Thing.f1|-3626880138223960403[0] + /* fake */ override val f1: Function0 + // CHECK JVM_IR: + // Mangled name: Thing#(){}kotlin.Function0 + // Public signature: /Thing.f1.|8566118280674785385[0] + // CHECK JS_IR NATIVE: + // Mangled name: Thing#(){} + // Public signature: /Thing.f1.|-4995485398991269878[0] + /* fake */ override get(): Function0 + +} + diff --git a/compiler/testData/ir/irText/expressions/objectClassReference.sig.kt.txt b/compiler/testData/ir/irText/expressions/objectClassReference.sig.kt.txt new file mode 100644 index 00000000000..63ba0361540 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/objectClassReference.sig.kt.txt @@ -0,0 +1,16 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +object A { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + private constructor() /* primary */ + +} + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + diff --git a/compiler/testData/ir/irText/expressions/objectReference.sig.kt.txt b/compiler/testData/ir/irText/expressions/objectReference.sig.kt.txt new file mode 100644 index 00000000000..f77e920c927 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/objectReference.sig.kt.txt @@ -0,0 +1,82 @@ +// CHECK: +// Mangled name: Z +// Public signature: /Z|null[0] +object Z { + // CHECK: + // Mangled name: Z{}counter + // Public signature: /Z.counter|3849500605769271673[0] + var counter: Int + // CHECK JVM_IR: + // Mangled name: Z#(){}kotlin.Int + // Public signature: /Z.counter.|6416265643848993228[0] + // CHECK JS_IR NATIVE: + // Mangled name: Z#(){} + // Public signature: /Z.counter.|6903507550118978958[0] + get + // CHECK: + // Mangled name: Z#(kotlin.Int){} + // Public signature: /Z.counter.|-8124462411591632783[0] + set + + // CHECK: + // Mangled name: Z{}aLambda + // Public signature: /Z.aLambda|3337321219156655813[0] + val aLambda: Function0 + // CHECK JVM_IR: + // Mangled name: Z#(){}kotlin.Function0 + // Public signature: /Z.aLambda.|9058518221524596568[0] + // CHECK JS_IR NATIVE: + // Mangled name: Z#(){} + // Public signature: /Z.aLambda.|8927671768328125269[0] + get + + // CHECK: + // Mangled name: Z{}anObject + // Public signature: /Z.anObject|409091113626572731[0] + val anObject: Any + // CHECK JVM_IR: + // Mangled name: Z#(){}kotlin.Any + // Public signature: /Z.anObject.|-6807306499596507825[0] + // CHECK JS_IR NATIVE: + // Mangled name: Z#(){} + // Public signature: /Z.anObject.|6468357437342963609[0] + get + + // CHECK: + // Mangled name: Z.Nested + // Public signature: /Z.Nested|null[0] + class Nested { + // CHECK: + // Mangled name: Z.Nested#(){} + // Public signature: /Z.Nested.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Z.Nested#test(){} + // Public signature: /Z.Nested.test|6620506149988718649[0] + fun test(): Unit + + } + + // CHECK: + // Mangled name: Z#(){} + // Public signature: /Z.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK: + // Mangled name: Z#bar(){} + // Public signature: /Z.bar|496682602797471549[0] + fun bar(): Unit + + // CHECK: + // Mangled name: Z#foo(){} + // Public signature: /Z.foo|-1041209573719867811[0] + fun foo(): Unit + +} + +// CHECK: +// Mangled name: #test@Z(){} +// Public signature: /test|2491484829934192138[0] +fun Z.test(): Unit + diff --git a/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.kt b/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.kt index 599903f36e6..54baa5a7a49 100644 --- a/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.kt +++ b/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.kt @@ -1,4 +1,5 @@ // FIR_IDENTICAL + abstract class Base(val lambda: () -> Any) -object Test : Base({ -> Test }) \ No newline at end of file +object Test : Base({ -> Test }) diff --git a/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.sig.kt.txt b/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.sig.kt.txt new file mode 100644 index 00000000000..6917796af2b --- /dev/null +++ b/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.sig.kt.txt @@ -0,0 +1,46 @@ +// CHECK: +// Mangled name: Base +// Public signature: /Base|null[0] +abstract class Base { + // CHECK: + // Mangled name: Base{}lambda + // Public signature: /Base.lambda|2089663330466279497[0] + val lambda: Function0 + // CHECK JVM_IR: + // Mangled name: Base#(){}kotlin.Function0 + // Public signature: /Base.lambda.|7399510716625048505[0] + // CHECK JS_IR NATIVE: + // Mangled name: Base#(){} + // Public signature: /Base.lambda.|-6620550812344419453[0] + get + + // CHECK: + // Mangled name: Base#(kotlin.Function0){} + // Public signature: /Base.|-4146636346230466645[0] + constructor(lambda: Function0) /* primary */ + +} + +// CHECK: +// Mangled name: Test +// Public signature: /Test|null[0] +object Test : Base { + // CHECK: + // Mangled name: Test#(){} + // Public signature: /Test.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK: + // Mangled name: Test{}lambda + // Public signature: /Test.lambda|2089663330466279497[0] + /* fake */ override val lambda: Function0 + // CHECK JVM_IR: + // Mangled name: Test#(){}kotlin.Function0 + // Public signature: /Test.lambda.|7399510716625048505[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test#(){} + // Public signature: /Test.lambda.|-6620550812344419453[0] + /* fake */ override get(): Function0 + +} + diff --git a/compiler/testData/ir/irText/expressions/objectReferenceInFieldInitializer.sig.kt.txt b/compiler/testData/ir/irText/expressions/objectReferenceInFieldInitializer.sig.kt.txt new file mode 100644 index 00000000000..303663df3fc --- /dev/null +++ b/compiler/testData/ir/irText/expressions/objectReferenceInFieldInitializer.sig.kt.txt @@ -0,0 +1,47 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +object A { + // CHECK: + // Mangled name: A{}a + // Public signature: /A.a|-1200697420457237799[0] + private val a: String + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.String + // Public signature: /A.a.|-6318309956076983327[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.a.|6785176174175479410[0] + private get + + // CHECK: + // Mangled name: A{}b + // Public signature: /A.b|772347207915745207[0] + private val b: String + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.String + // Public signature: /A.b.|5457451065030643294[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.b.|812004636995167743[0] + private get + + // CHECK: + // Mangled name: A{}c + // Public signature: /A.c|-4416962153448040627[0] + private val c: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.c.|-2440337234483931882[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.c.|2368736057102379596[0] + private get + + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + private constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/expressions/outerClassInstanceReference.sig.kt.txt b/compiler/testData/ir/irText/expressions/outerClassInstanceReference.sig.kt.txt new file mode 100644 index 00000000000..5ae815cdfdc --- /dev/null +++ b/compiler/testData/ir/irText/expressions/outerClassInstanceReference.sig.kt.txt @@ -0,0 +1,32 @@ +// CHECK: +// Mangled name: Outer +// Public signature: /Outer|null[0] +class Outer { + // CHECK: + // Mangled name: Outer.Inner + // Public signature: /Outer.Inner|null[0] + inner class Inner { + // CHECK: + // Mangled name: Outer.Inner#(){} + // Public signature: /Outer.Inner.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Outer.Inner#inner(){} + // Public signature: /Outer.Inner.inner|-6486799226458493362[0] + fun inner(): Unit + + } + + // CHECK: + // Mangled name: Outer#(){} + // Public signature: /Outer.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Outer#outer(){} + // Public signature: /Outer.outer|1607449560170809066[0] + fun outer(): Unit + +} + diff --git a/compiler/testData/ir/irText/expressions/primitiveComparisons.sig.kt.txt b/compiler/testData/ir/irText/expressions/primitiveComparisons.sig.kt.txt new file mode 100644 index 00000000000..cd19c02ceaf --- /dev/null +++ b/compiler/testData/ir/irText/expressions/primitiveComparisons.sig.kt.txt @@ -0,0 +1,192 @@ +// CHECK JVM_IR: +// Mangled name: #btest1(kotlin.Byte;kotlin.Byte){}kotlin.Boolean +// Public signature: /btest1|6730584705987479338[0] +// CHECK JS_IR NATIVE: +// Mangled name: #btest1(kotlin.Byte;kotlin.Byte){} +// Public signature: /btest1|5100557308846811449[0] +fun btest1(a: Byte, b: Byte): Boolean + +// CHECK JVM_IR: +// Mangled name: #btest2(kotlin.Byte;kotlin.Byte){}kotlin.Boolean +// Public signature: /btest2|-6552371622511203923[0] +// CHECK JS_IR NATIVE: +// Mangled name: #btest2(kotlin.Byte;kotlin.Byte){} +// Public signature: /btest2|3052207698542953276[0] +fun btest2(a: Byte, b: Byte): Boolean + +// CHECK JVM_IR: +// Mangled name: #btest3(kotlin.Byte;kotlin.Byte){}kotlin.Boolean +// Public signature: /btest3|-1633706830867065376[0] +// CHECK JS_IR NATIVE: +// Mangled name: #btest3(kotlin.Byte;kotlin.Byte){} +// Public signature: /btest3|-5652941477615644172[0] +fun btest3(a: Byte, b: Byte): Boolean + +// CHECK JVM_IR: +// Mangled name: #btest4(kotlin.Byte;kotlin.Byte){}kotlin.Boolean +// Public signature: /btest4|-7673388339311765317[0] +// CHECK JS_IR NATIVE: +// Mangled name: #btest4(kotlin.Byte;kotlin.Byte){} +// Public signature: /btest4|7053360996245144820[0] +fun btest4(a: Byte, b: Byte): Boolean + +// CHECK JVM_IR: +// Mangled name: #dtest1(kotlin.Double;kotlin.Double){}kotlin.Boolean +// Public signature: /dtest1|1293020120253569605[0] +// CHECK JS_IR NATIVE: +// Mangled name: #dtest1(kotlin.Double;kotlin.Double){} +// Public signature: /dtest1|-3670856411002880609[0] +fun dtest1(a: Double, b: Double): Boolean + +// CHECK JVM_IR: +// Mangled name: #dtest2(kotlin.Double;kotlin.Double){}kotlin.Boolean +// Public signature: /dtest2|-401220502378854550[0] +// CHECK JS_IR NATIVE: +// Mangled name: #dtest2(kotlin.Double;kotlin.Double){} +// Public signature: /dtest2|710371925947423598[0] +fun dtest2(a: Double, b: Double): Boolean + +// CHECK JVM_IR: +// Mangled name: #dtest3(kotlin.Double;kotlin.Double){}kotlin.Boolean +// Public signature: /dtest3|9087445662424121701[0] +// CHECK JS_IR NATIVE: +// Mangled name: #dtest3(kotlin.Double;kotlin.Double){} +// Public signature: /dtest3|-8298317474692620489[0] +fun dtest3(a: Double, b: Double): Boolean + +// CHECK JVM_IR: +// Mangled name: #dtest4(kotlin.Double;kotlin.Double){}kotlin.Boolean +// Public signature: /dtest4|-1521716954463317470[0] +// CHECK JS_IR NATIVE: +// Mangled name: #dtest4(kotlin.Double;kotlin.Double){} +// Public signature: /dtest4|6778330273234975821[0] +fun dtest4(a: Double, b: Double): Boolean + +// CHECK JVM_IR: +// Mangled name: #ftest1(kotlin.Float;kotlin.Float){}kotlin.Boolean +// Public signature: /ftest1|7638926557162622532[0] +// CHECK JS_IR NATIVE: +// Mangled name: #ftest1(kotlin.Float;kotlin.Float){} +// Public signature: /ftest1|-2472379729840891235[0] +fun ftest1(a: Float, b: Float): Boolean + +// CHECK JVM_IR: +// Mangled name: #ftest2(kotlin.Float;kotlin.Float){}kotlin.Boolean +// Public signature: /ftest2|2172716929351344911[0] +// CHECK JS_IR NATIVE: +// Mangled name: #ftest2(kotlin.Float;kotlin.Float){} +// Public signature: /ftest2|-6338145559112408330[0] +fun ftest2(a: Float, b: Float): Boolean + +// CHECK JVM_IR: +// Mangled name: #ftest3(kotlin.Float;kotlin.Float){}kotlin.Boolean +// Public signature: /ftest3|-468626791227486374[0] +// CHECK JS_IR NATIVE: +// Mangled name: #ftest3(kotlin.Float;kotlin.Float){} +// Public signature: /ftest3|735138896823635398[0] +fun ftest3(a: Float, b: Float): Boolean + +// CHECK JVM_IR: +// Mangled name: #ftest4(kotlin.Float;kotlin.Float){}kotlin.Boolean +// Public signature: /ftest4|-563998142236945116[0] +// CHECK JS_IR NATIVE: +// Mangled name: #ftest4(kotlin.Float;kotlin.Float){} +// Public signature: /ftest4|-6316245319701743761[0] +fun ftest4(a: Float, b: Float): Boolean + +// CHECK JVM_IR: +// Mangled name: #itest1(kotlin.Int;kotlin.Int){}kotlin.Boolean +// Public signature: /itest1|6340059804502952428[0] +// CHECK JS_IR NATIVE: +// Mangled name: #itest1(kotlin.Int;kotlin.Int){} +// Public signature: /itest1|2943936311178324727[0] +fun itest1(a: Int, b: Int): Boolean + +// CHECK JVM_IR: +// Mangled name: #itest2(kotlin.Int;kotlin.Int){}kotlin.Boolean +// Public signature: /itest2|6922746060529996151[0] +// CHECK JS_IR NATIVE: +// Mangled name: #itest2(kotlin.Int;kotlin.Int){} +// Public signature: /itest2|-2847434528416538539[0] +fun itest2(a: Int, b: Int): Boolean + +// CHECK JVM_IR: +// Mangled name: #itest3(kotlin.Int;kotlin.Int){}kotlin.Boolean +// Public signature: /itest3|-4434266925583117272[0] +// CHECK JS_IR NATIVE: +// Mangled name: #itest3(kotlin.Int;kotlin.Int){} +// Public signature: /itest3|-1930560630840536241[0] +fun itest3(a: Int, b: Int): Boolean + +// CHECK JVM_IR: +// Mangled name: #itest4(kotlin.Int;kotlin.Int){}kotlin.Boolean +// Public signature: /itest4|1388121819832551698[0] +// CHECK JS_IR NATIVE: +// Mangled name: #itest4(kotlin.Int;kotlin.Int){} +// Public signature: /itest4|7597396364397358070[0] +fun itest4(a: Int, b: Int): Boolean + +// CHECK JVM_IR: +// Mangled name: #ltest1(kotlin.Long;kotlin.Long){}kotlin.Boolean +// Public signature: /ltest1|9212930367460177077[0] +// CHECK JS_IR NATIVE: +// Mangled name: #ltest1(kotlin.Long;kotlin.Long){} +// Public signature: /ltest1|-8498134014415114523[0] +fun ltest1(a: Long, b: Long): Boolean + +// CHECK JVM_IR: +// Mangled name: #ltest2(kotlin.Long;kotlin.Long){}kotlin.Boolean +// Public signature: /ltest2|-3882280686576941701[0] +// CHECK JS_IR NATIVE: +// Mangled name: #ltest2(kotlin.Long;kotlin.Long){} +// Public signature: /ltest2|-6051755770291351912[0] +fun ltest2(a: Long, b: Long): Boolean + +// CHECK JVM_IR: +// Mangled name: #ltest3(kotlin.Long;kotlin.Long){}kotlin.Boolean +// Public signature: /ltest3|-658692317728529650[0] +// CHECK JS_IR NATIVE: +// Mangled name: #ltest3(kotlin.Long;kotlin.Long){} +// Public signature: /ltest3|6063756894384388964[0] +fun ltest3(a: Long, b: Long): Boolean + +// CHECK JVM_IR: +// Mangled name: #ltest4(kotlin.Long;kotlin.Long){}kotlin.Boolean +// Public signature: /ltest4|-7065839936524359450[0] +// CHECK JS_IR NATIVE: +// Mangled name: #ltest4(kotlin.Long;kotlin.Long){} +// Public signature: /ltest4|1773951101980382389[0] +fun ltest4(a: Long, b: Long): Boolean + +// CHECK JVM_IR: +// Mangled name: #stest1(kotlin.Short;kotlin.Short){}kotlin.Boolean +// Public signature: /stest1|2091834275868806980[0] +// CHECK JS_IR NATIVE: +// Mangled name: #stest1(kotlin.Short;kotlin.Short){} +// Public signature: /stest1|-2109438361398971372[0] +fun stest1(a: Short, b: Short): Boolean + +// CHECK JVM_IR: +// Mangled name: #stest2(kotlin.Short;kotlin.Short){}kotlin.Boolean +// Public signature: /stest2|-8199878878380259195[0] +// CHECK JS_IR NATIVE: +// Mangled name: #stest2(kotlin.Short;kotlin.Short){} +// Public signature: /stest2|4687807588444680071[0] +fun stest2(a: Short, b: Short): Boolean + +// CHECK JVM_IR: +// Mangled name: #stest3(kotlin.Short;kotlin.Short){}kotlin.Boolean +// Public signature: /stest3|-1498769342871932498[0] +// CHECK JS_IR NATIVE: +// Mangled name: #stest3(kotlin.Short;kotlin.Short){} +// Public signature: /stest3|-8085248862010978029[0] +fun stest3(a: Short, b: Short): Boolean + +// CHECK JVM_IR: +// Mangled name: #stest4(kotlin.Short;kotlin.Short){}kotlin.Boolean +// Public signature: /stest4|-5913675845898960216[0] +// CHECK JS_IR NATIVE: +// Mangled name: #stest4(kotlin.Short;kotlin.Short){} +// Public signature: /stest4|-4183064856238597809[0] +fun stest4(a: Short, b: Short): Boolean + diff --git a/compiler/testData/ir/irText/expressions/primitivesImplicitConversions.sig.kt.txt b/compiler/testData/ir/irText/expressions/primitivesImplicitConversions.sig.kt.txt new file mode 100644 index 00000000000..0de44fb1333 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/primitivesImplicitConversions.sig.kt.txt @@ -0,0 +1,105 @@ +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: Long + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Long + // Public signature: /test1.|-7756650713406824739[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test1.|-5735092642142423279[0] + get + +// CHECK: +// Mangled name: {}test2 +// Public signature: /test2|2517758057000911509[0] +val test2: Short + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Short + // Public signature: /test2.|3647244765573083120[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test2.|-5218942532816206869[0] + get + +// CHECK: +// Mangled name: {}test3 +// Public signature: /test3|7677556066983021166[0] +val test3: Byte + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Byte + // Public signature: /test3.|3590115425428046549[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test3.|-7333791615083236686[0] + get + +// CHECK: +// Mangled name: {}test4 +// Public signature: /test4|-9115637610245762085[0] +val test4: Long + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Long + // Public signature: /test4.|8355198295430948956[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test4.|4166854324968284003[0] + get + +// CHECK: +// Mangled name: {}test5 +// Public signature: /test5|4734809624271551895[0] +val test5: Short + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Short + // Public signature: /test5.|-6403114982829239942[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test5.|-839819880171293643[0] + get + +// CHECK: +// Mangled name: {}test6 +// Public signature: /test6|-2606527149405855403[0] +val test6: Byte + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Byte + // Public signature: /test6.|-8478196724021525234[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test6.|2028965735388282488[0] + get + +// CHECK: +// Mangled name: TestImplicitArguments +// Public signature: /TestImplicitArguments|null[0] +class TestImplicitArguments { + // CHECK: + // Mangled name: TestImplicitArguments{}x + // Public signature: /TestImplicitArguments.x|-8060530855978347579[0] + val x: Long + // CHECK JVM_IR: + // Mangled name: TestImplicitArguments#(){}kotlin.Long + // Public signature: /TestImplicitArguments.x.|-5038004036748815641[0] + // CHECK JS_IR NATIVE: + // Mangled name: TestImplicitArguments#(){} + // Public signature: /TestImplicitArguments.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: TestImplicitArguments#(kotlin.Long){} + // Public signature: /TestImplicitArguments.|5217973964116651322[0] + constructor(x: Long) /* primary */ + +} + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + +// CHECK: +// Mangled name: #testImplicitArguments(kotlin.Long){} +// Public signature: /testImplicitArguments|2321828765355433756[0] +fun testImplicitArguments(x: Long): Unit + diff --git a/compiler/testData/ir/irText/expressions/propertyReferences.sig.kt.txt b/compiler/testData/ir/irText/expressions/propertyReferences.sig.kt.txt new file mode 100644 index 00000000000..7ff6a6f9e6b --- /dev/null +++ b/compiler/testData/ir/irText/expressions/propertyReferences.sig.kt.txt @@ -0,0 +1,254 @@ +// CHECK: +// Mangled name: {}valWithBackingField +// Public signature: /valWithBackingField|-1300301669393450275[0] +val valWithBackingField: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /valWithBackingField.|-1831247219646478287[0] + get + +// CHECK: +// Mangled name: {}test_valWithBackingField +// Public signature: /test_valWithBackingField|313805254579030051[0] +val test_valWithBackingField: KProperty0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KProperty0 + // Public signature: /test_valWithBackingField.|-1062436817917850148[0] + get + +// CHECK: +// Mangled name: {}varWithBackingField +// Public signature: /varWithBackingField|-5551188429221341140[0] +var varWithBackingField: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /varWithBackingField.|1127596629659442842[0] + get + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /varWithBackingField.|-534437250090594268[0] + set + +// CHECK: +// Mangled name: {}test_varWithBackingField +// Public signature: /test_varWithBackingField|-2347677877274099973[0] +val test_varWithBackingField: KMutableProperty0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KMutableProperty0 + // Public signature: /test_varWithBackingField.|6081487848306132886[0] + get + +// CHECK: +// Mangled name: {}varWithBackingFieldAndAccessors +// Public signature: /varWithBackingFieldAndAccessors|843158391931632923[0] +var varWithBackingFieldAndAccessors: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /varWithBackingFieldAndAccessors.|2768930924142471122[0] + get(): Int + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /varWithBackingFieldAndAccessors.|-5839035169847435382[0] + set(value: Int): Unit + +// CHECK: +// Mangled name: {}test_varWithBackingFieldAndAccessors +// Public signature: /test_varWithBackingFieldAndAccessors|-2445303061936926860[0] +val test_varWithBackingFieldAndAccessors: KMutableProperty0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KMutableProperty0 + // Public signature: /test_varWithBackingFieldAndAccessors.|9147239181596359139[0] + get + +// CHECK: +// Mangled name: {}test_valWithAccessors +// Public signature: /test_valWithAccessors|3010356935899005810[0] +val test_valWithAccessors: KProperty0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KProperty0 + // Public signature: /test_valWithAccessors.|-1486014412324684270[0] + get + +// CHECK: +// Mangled name: {}test_varWithAccessors +// Public signature: /test_varWithAccessors|-1500633065892977652[0] +val test_varWithAccessors: KMutableProperty0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KMutableProperty0 + // Public signature: /test_varWithAccessors.|-6951143286383171060[0] + get + +// CHECK: +// Mangled name: {}delegatedVal +// Public signature: /delegatedVal|-2000059721355675607[0] +val delegatedVal: Int /* by */ + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /delegatedVal.|-6460066711738230051[0] + get(): Int + +// CHECK: +// Mangled name: {}test_delegatedVal +// Public signature: /test_delegatedVal|2231672952604843943[0] +val test_delegatedVal: KProperty0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KProperty0 + // Public signature: /test_delegatedVal.|1331025910107931364[0] + get + +// CHECK: +// Mangled name: {}delegatedVar +// Public signature: /delegatedVar|8351812919103314818[0] +var delegatedVar: Int /* by */ + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /delegatedVar.|-5392488440114938834[0] + get(): Int + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /delegatedVar.|-561950162883824863[0] + set(: Int): Unit + +// CHECK: +// Mangled name: {}test_delegatedVar +// Public signature: /test_delegatedVar|-2049424451239803052[0] +val test_delegatedVar: KMutableProperty0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KMutableProperty0 + // Public signature: /test_delegatedVar.|-7555389861967684049[0] + get + +// CHECK: +// Mangled name: {}constVal +// Public signature: /constVal|5027619947092790884[0] +val constVal: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /constVal.|-5615353796653730955[0] + get + +// CHECK: +// Mangled name: {}test_constVal +// Public signature: /test_constVal|6984849995991396531[0] +val test_constVal: KProperty0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KProperty0 + // Public signature: /test_constVal.|-1004323247463589518[0] + get + +// CHECK: +// Mangled name: {}test_J_CONST +// Public signature: /test_J_CONST|-7992728176633477973[0] +val test_J_CONST: KProperty0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KProperty0 + // Public signature: /test_J_CONST.|-5776298226410519637[0] + get + +// CHECK: +// Mangled name: {}test_J_nonConst +// Public signature: /test_J_nonConst|-2311727055358689765[0] +val test_J_nonConst: KMutableProperty0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KMutableProperty0 + // Public signature: /test_J_nonConst.|4445779398117724023[0] + get + +// CHECK: +// Mangled name: {}test_varWithPrivateSet +// Public signature: /test_varWithPrivateSet|2625543943670808283[0] +val test_varWithPrivateSet: KProperty1 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KProperty1 + // Public signature: /test_varWithPrivateSet.|8290622083592937536[0] + get + +// CHECK: +// Mangled name: {}test_varWithProtectedSet +// Public signature: /test_varWithProtectedSet|6087621839947174098[0] +val test_varWithProtectedSet: KProperty1 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KProperty1 + // Public signature: /test_varWithProtectedSet.|4791941401182475159[0] + get + +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +open class C { + // CHECK: + // Mangled name: C{}varWithPrivateSet + // Public signature: /C.varWithPrivateSet|5963227574618907567[0] + var varWithPrivateSet: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.varWithPrivateSet.|-8392476455600477334[0] + get + // CHECK: + // Mangled name: C#(kotlin.Int){} + // Public signature: /C.varWithPrivateSet.|6345817872201213518[0] + private set + + // CHECK: + // Mangled name: C{}varWithProtectedSet + // Public signature: /C.varWithProtectedSet|2406418248737323969[0] + var varWithProtectedSet: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.varWithProtectedSet.|6072113758305715267[0] + get + // CHECK: + // Mangled name: C#(kotlin.Int){} + // Public signature: /C.varWithProtectedSet.|213514706635969633[0] + protected set + + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: Delegate +// Public signature: /Delegate|null[0] +object Delegate { + // CHECK: + // Mangled name: Delegate#(){} + // Public signature: /Delegate.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Delegate#getValue(kotlin.Any?;kotlin.Any){}kotlin.Int + // Public signature: /Delegate.getValue|-4563103632143148557[0] + operator fun getValue(thisRef: Any?, kProp: Any): Int + + // CHECK: + // Mangled name: Delegate#setValue(kotlin.Any?;kotlin.Any;kotlin.Int){} + // Public signature: /Delegate.setValue|-4646360456097039533[0] + operator fun setValue(thisRef: Any?, kProp: Any, value: Int): Unit + +} + +// CHECK: +// Mangled name: {}valWithAccessors +// Public signature: /valWithAccessors|-4074148554018795668[0] +val valWithAccessors: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /valWithAccessors.|-9086063727459641516[0] + get(): Int + +// CHECK: +// Mangled name: {}varWithAccessors +// Public signature: /varWithAccessors|6848745058900328380[0] +var varWithAccessors: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /varWithAccessors.|-626234323258211195[0] + get(): Int + // CHECK: + // Mangled name: #(kotlin.Int){} + // Public signature: /varWithAccessors.|-8315955398927617126[0] + set(value: Int): Unit + diff --git a/compiler/testData/ir/irText/expressions/protectedJavaFieldRef.sig.kt.txt b/compiler/testData/ir/irText/expressions/protectedJavaFieldRef.sig.kt.txt new file mode 100644 index 00000000000..69af2c46061 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/protectedJavaFieldRef.sig.kt.txt @@ -0,0 +1,25 @@ +// CHECK: +// Mangled name: Derived +// Public signature: /Derived|null[0] +class Derived : Base { + // CHECK: + // Mangled name: Derived{}ref + // Public signature: /Derived.ref|-1081516401990928556[0] + val ref: KMutableProperty0 + // CHECK JVM_IR: + // Mangled name: Derived#(){}kotlin.reflect.KMutableProperty0 + // Public signature: /Derived.ref.|-6985556442168523841[0] + get + + // CHECK: + // Mangled name: Derived#(){} + // Public signature: /Derived.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Derived#set(){} + // Public signature: /Derived.set|-7365752122041802629[0] + fun set(): Unit + +} + diff --git a/compiler/testData/ir/irText/expressions/references.kt b/compiler/testData/ir/irText/expressions/references.kt index 5e30f763a0a..7216b45a124 100644 --- a/compiler/testData/ir/irText/expressions/references.kt +++ b/compiler/testData/ir/irText/expressions/references.kt @@ -1,4 +1,9 @@ // 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/references.sig.kt.txt b/compiler/testData/ir/irText/expressions/references.sig.kt.txt new file mode 100644 index 00000000000..f464d39da27 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/references.sig.kt.txt @@ -0,0 +1,88 @@ +// CHECK: +// Mangled name: {}ok +// Public signature: /ok|3084714860561867417[0] +val ok: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /ok.|-4000622060828023401[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /ok.|6963158084917262476[0] + get + +// CHECK: +// Mangled name: {}ok2 +// Public signature: /ok2|8310337683510143427[0] +val ok2: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /ok2.|-1465577528977290579[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /ok2.|7829439004828667170[0] + get + +// CHECK JVM_IR: +// Mangled name: #test1(){}kotlin.String +// Public signature: /test1|5794939649815924341[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +fun test1(): String + +// CHECK JVM_IR: +// Mangled name: #test2(kotlin.String){}kotlin.String +// Public signature: /test2|-9053313790968627079[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2(kotlin.String){} +// Public signature: /test2|8672709278877196328[0] +fun test2(x: String): String + +// CHECK JVM_IR: +// Mangled name: #test3(){}kotlin.String +// Public signature: /test3|3344305992477585251[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3(){} +// Public signature: /test3|-3759735065270951803[0] +fun test3(): String + +// CHECK JVM_IR: +// Mangled name: #test4(){}kotlin.String +// Public signature: /test4|4822743421999784081[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test4(){} +// Public signature: /test4|5588455914500386239[0] +fun test4(): String + +// CHECK JVM_IR: +// Mangled name: #test5@kotlin.String(){}kotlin.String +// Public signature: /test5|7396849134865790053[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test5@kotlin.String(){} +// Public signature: /test5|6764932899271361379[0] +fun String.test5(): String + +// CHECK: +// Mangled name: {}ok3 +// Public signature: /ok3|5885848835307275738[0] +val ok3: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /ok3.|-2021208757621779282[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /ok3.|-6867262654716867671[0] + get(): String + +// CHECK: +// Mangled name: @kotlin.String{}okext +// Public signature: /okext|-7546376167507800782[0] +val String.okext: String + // CHECK JVM_IR: + // Mangled name: #@kotlin.String(){}kotlin.String + // Public signature: /okext.|-4397362169527603922[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@kotlin.String(){} + // Public signature: /okext.|-5103161093403962760[0] + get(): String + diff --git a/compiler/testData/ir/irText/expressions/reflectionLiterals.kt b/compiler/testData/ir/irText/expressions/reflectionLiterals.kt index 80b2d462a2a..8272165c7d9 100644 --- a/compiler/testData/ir/irText/expressions/reflectionLiterals.kt +++ b/compiler/testData/ir/irText/expressions/reflectionLiterals.kt @@ -1,4 +1,9 @@ // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: JS_IR +// MUTE_SIGNATURE_COMPARISON_K2: NATIVE +// ^ KT-57818 + class A { fun foo() {} } @@ -10,4 +15,4 @@ val test2 = qux::class val test3 = A::foo val test4 = ::A val test5 = A()::foo -val test6 = ::bar \ No newline at end of file +val test6 = ::bar diff --git a/compiler/testData/ir/irText/expressions/reflectionLiterals.sig.kt.txt b/compiler/testData/ir/irText/expressions/reflectionLiterals.sig.kt.txt new file mode 100644 index 00000000000..ede5a686a63 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/reflectionLiterals.sig.kt.txt @@ -0,0 +1,105 @@ +// CHECK: +// Mangled name: {}qux +// Public signature: /qux|-2015941539611120266[0] +val qux: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /qux.|-1099208922439428320[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /qux.|-3266840963026289453[0] + get + +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: KClass + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KClass + // Public signature: /test1.|3298538394700924216[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test1.|-5735092642142423279[0] + get + +// CHECK: +// Mangled name: {}test2 +// Public signature: /test2|2517758057000911509[0] +val test2: KClass + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KClass + // Public signature: /test2.|-915744501252622944[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test2.|-5218942532816206869[0] + get + +// CHECK: +// Mangled name: {}test3 +// Public signature: /test3|7677556066983021166[0] +val test3: KFunction1 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KFunction1 + // Public signature: /test3.|2842505798415693843[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test3.|-7333791615083236686[0] + get + +// CHECK: +// Mangled name: {}test4 +// Public signature: /test4|-9115637610245762085[0] +val test4: KFunction0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KFunction0 + // Public signature: /test4.|4611528126156067014[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test4.|4166854324968284003[0] + get + +// CHECK: +// Mangled name: {}test5 +// Public signature: /test5|4734809624271551895[0] +val test5: KFunction0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KFunction0 + // Public signature: /test5.|-3888408401644908313[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test5.|-839819880171293643[0] + get + +// CHECK: +// Mangled name: {}test6 +// Public signature: /test6|-2606527149405855403[0] +val test6: KFunction0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KFunction0 + // Public signature: /test6.|1824677461908807980[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test6.|2028965735388282488[0] + get + +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: A#foo(){} + // Public signature: /A.foo|-1041209573719867811[0] + fun foo(): Unit + +} + +// CHECK: +// Mangled name: #bar(){} +// Public signature: /bar|496682602797471549[0] +fun bar(): Unit + diff --git a/compiler/testData/ir/irText/expressions/safeAssignment.sig.kt.txt b/compiler/testData/ir/irText/expressions/safeAssignment.sig.kt.txt new file mode 100644 index 00000000000..da6d677eaf9 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/safeAssignment.sig.kt.txt @@ -0,0 +1,32 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C{}x + // Public signature: /C.x|-8060530855978347579[0] + var x: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.x.|1482705010654679335[0] + get + // CHECK: + // Mangled name: C#(kotlin.Int){} + // Public signature: /C.x.|-740209739415615559[0] + set + + // CHECK: + // Mangled name: C#(kotlin.Int){} + // Public signature: /C.|-5182794243525578284[0] + constructor(x: Int) /* primary */ + +} + +// CHECK: +// Mangled name: #test(C?){} +// Public signature: /test|-9127084887599042119[0] +fun test(nc: C?): Unit + diff --git a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.kt b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.kt index 8e9c8073621..2e384ea63a5 100644 --- a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.kt +++ b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.kt @@ -1,3 +1,6 @@ +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57433 + package test class C diff --git a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.sig.kt.txt b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.sig.kt.txt new file mode 100644 index 00000000000..e1c9bf77b3b --- /dev/null +++ b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.sig.kt.txt @@ -0,0 +1,60 @@ +package test + +// CHECK: +// Mangled name: test.C +// Public signature: test/C|null[0] +class C { + // CHECK: + // Mangled name: test.C#(){} + // Public signature: test/C.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: test#get@kotlin.Int?(kotlin.Int){}kotlin.Int +// Public signature: test/get|-6221002532708237996[0] +// CHECK JS_IR NATIVE: +// Mangled name: test#get@kotlin.Int?(kotlin.Int){} +// Public signature: test/get|2096149375626254616[0] +operator fun Int?.get(index: Int): Int + +// CHECK JVM_IR: +// Mangled name: test#inc@kotlin.Int?(){}kotlin.Int? +// Public signature: test/inc|-8688916183051881962[0] +// CHECK JS_IR NATIVE: +// Mangled name: test#inc@kotlin.Int?(){} +// Public signature: test/inc|7389847627046551690[0] +operator fun Int?.inc(): Int? + +// CHECK: +// Mangled name: test#set@kotlin.Int?(kotlin.Int;kotlin.Int){} +// Public signature: test/set|6578463135726025700[0] +operator fun Int?.set(index: Int, value: Int): Unit + +// CHECK: +// Mangled name: test#testArrayAccess(test.C?){} +// Public signature: test/testArrayAccess|4252489655706845013[0] +fun testArrayAccess(nc: C?): Unit + +// CHECK: +// Mangled name: test#testProperty(test.C?){} +// Public signature: test/testProperty|-2369045043413337370[0] +fun testProperty(nc: C?): Unit + +// CHECK: +// Mangled name: test@test.C?{}p +// Public signature: test/p|-1845876355852807020[0] +var C?.p: Int + // CHECK JVM_IR: + // Mangled name: test#@test.C?(){}kotlin.Int + // Public signature: test/p.|-8557468444569568699[0] + // CHECK JS_IR NATIVE: + // Mangled name: test#@test.C?(){} + // Public signature: test/p.|-8829073944247347395[0] + get(): Int + // CHECK: + // Mangled name: test#@test.C?(kotlin.Int){} + // Public signature: test/p.|358628307976846417[0] + set(value: Int): Unit + diff --git a/compiler/testData/ir/irText/expressions/safeCalls.sig.kt.txt b/compiler/testData/ir/irText/expressions/safeCalls.sig.kt.txt new file mode 100644 index 00000000000..6a30e66dbd4 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/safeCalls.sig.kt.txt @@ -0,0 +1,92 @@ +// CHECK: +// Mangled name: Ref +// Public signature: /Ref|null[0] +class Ref { + // CHECK: + // Mangled name: Ref{}value + // Public signature: /Ref.value|1987073854177347439[0] + var value: Int + // CHECK JVM_IR: + // Mangled name: Ref#(){}kotlin.Int + // Public signature: /Ref.value.|-5900028706170996[0] + // CHECK JS_IR NATIVE: + // Mangled name: Ref#(){} + // Public signature: /Ref.value.|3260093555963109437[0] + get + // CHECK: + // Mangled name: Ref#(kotlin.Int){} + // Public signature: /Ref.value.|-195057410739577239[0] + set + + // CHECK: + // Mangled name: Ref#(kotlin.Int){} + // Public signature: /Ref.|-5182794243525578284[0] + constructor(value: Int) /* primary */ + +} + +// CHECK: +// Mangled name: IHost +// Public signature: /IHost|null[0] +interface IHost { + + // CHECK JVM_IR: + // Mangled name: IHost#extLength@kotlin.String(){}kotlin.Int + // Public signature: /IHost.extLength|-6119453020131348069[0] + // CHECK JS_IR NATIVE: + // Mangled name: IHost#extLength@kotlin.String(){} + // Public signature: /IHost.extLength|6995498075491607398[0] + fun String.extLength(): Int + +} + +// CHECK: +// Mangled name: #box(){} +// Public signature: /box|2173511048851971368[0] +fun box(): Unit + +// CHECK JVM_IR: +// Mangled name: #foo@kotlin.Int(){}kotlin.Int +// Public signature: /foo|-8806072392141306410[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo@kotlin.Int(){} +// Public signature: /foo|4521317896132265411[0] +fun Int.foo(): Int + +// CHECK JVM_IR: +// Mangled name: #test1(kotlin.String?){}kotlin.Int? +// Public signature: /test1|3311195222465373373[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1(kotlin.String?){} +// Public signature: /test1|-2987894258831182637[0] +fun test1(x: String?): Int? + +// CHECK JVM_IR: +// Mangled name: #test2(kotlin.String?){}kotlin.Int? +// Public signature: /test2|6693863336392834701[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2(kotlin.String?){} +// Public signature: /test2|-4736304558227690758[0] +fun test2(x: String?): Int? + +// CHECK JVM_IR: +// Mangled name: #test3(kotlin.String?;kotlin.Any?){}kotlin.Boolean? +// Public signature: /test3|-1947502248408841684[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3(kotlin.String?;kotlin.Any?){} +// Public signature: /test3|420341366861601133[0] +fun test3(x: String?, y: Any?): Boolean? + +// CHECK: +// Mangled name: #test4(Ref?){} +// Public signature: /test4|2004041778434234324[0] +fun test4(x: Ref?): Unit + +// CHECK JVM_IR: +// Mangled name: #test5@IHost(kotlin.String?){}kotlin.Int? +// Public signature: /test5|-1299994974065505995[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test5@IHost(kotlin.String?){} +// Public signature: /test5|7033598970433422701[0] +fun IHost.test5(s: String?): Int? + diff --git a/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.sig.kt.txt b/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.sig.kt.txt new file mode 100644 index 00000000000..b21e967989b --- /dev/null +++ b/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #test(kotlin.Function0;java.lang.Runnable;kotlin.Array){} +// Public signature: /test|-6479681129946022977[0] +fun test(fn: Function0, r: Runnable, arr: Array): Unit + diff --git a/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.sig.kt.txt b/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.sig.kt.txt new file mode 100644 index 00000000000..9a448659e25 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + diff --git a/compiler/testData/ir/irText/expressions/sam/genericSamSmartcast.sig.kt.txt b/compiler/testData/ir/irText/expressions/sam/genericSamSmartcast.sig.kt.txt new file mode 100644 index 00000000000..c0ef398b8a8 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/sam/genericSamSmartcast.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK JVM_IR: +// Mangled name: #f(kotlin.Any){}kotlin.String +// Public signature: /f|7796856655889654815[0] +fun f(x: Any): String + diff --git a/compiler/testData/ir/irText/expressions/sam/samByProjectedType.kt b/compiler/testData/ir/irText/expressions/sam/samByProjectedType.kt index fc087e1da54..d8a7dc574dc 100644 --- a/compiler/testData/ir/irText/expressions/sam/samByProjectedType.kt +++ b/compiler/testData/ir/irText/expressions/sam/samByProjectedType.kt @@ -1,5 +1,6 @@ // FIR_IDENTICAL // TARGET_BACKEND: JVM + // FILE: samByProjectedType.kt fun test1() { H.bar { x: Any -> x } @@ -13,4 +14,4 @@ public interface J { // FILE: H.java public class H { public static void bar(J j) {} -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/expressions/sam/samByProjectedType.sig.kt.txt b/compiler/testData/ir/irText/expressions/sam/samByProjectedType.sig.kt.txt new file mode 100644 index 00000000000..bbcccb9d294 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/sam/samByProjectedType.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +fun test1(): Unit + diff --git a/compiler/testData/ir/irText/expressions/sam/samConstructors.sig.kt.txt b/compiler/testData/ir/irText/expressions/sam/samConstructors.sig.kt.txt new file mode 100644 index 00000000000..6cf2ecb78e6 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/sam/samConstructors.sig.kt.txt @@ -0,0 +1,25 @@ +// CHECK: +// Mangled name: #foo(){} +// Public signature: /foo|-1041209573719867811[0] +fun foo(): Unit + +// CHECK JVM_IR: +// Mangled name: #test1(){}java.lang.Runnable +// Public signature: /test1|-613876279970827772[0] +fun test1(): Runnable + +// CHECK JVM_IR: +// Mangled name: #test2(kotlin.Function0){}java.lang.Runnable +// Public signature: /test2|-6701609995382300258[0] +fun test2(a: Function0): Runnable + +// CHECK JVM_IR: +// Mangled name: #test3(){}java.lang.Runnable +// Public signature: /test3|-2297362667420108091[0] +fun test3(): Runnable + +// CHECK JVM_IR: +// Mangled name: #test4(){}java.util.Comparator +// Public signature: /test4|-6683954143544750623[0] +fun test4(): Comparator + diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.kt b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.kt index 08561d0615a..e33336953ef 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.kt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.kt @@ -1,5 +1,9 @@ // FIR_IDENTICAL // TARGET_BACKEND: JVM + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429 + // FILE: samConversionInGenericConstructorCall.kt fun test3( f1: (String) -> String, diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.sig.kt.txt b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.sig.kt.txt new file mode 100644 index 00000000000..e5229a90a82 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.sig.kt.txt @@ -0,0 +1,60 @@ +// CHECK: +// Mangled name: Outer +// Public signature: /Outer|null[0] +class Outer { + // CHECK: + // Mangled name: Outer{}j11 + // Public signature: /Outer.j11|3042103907784946942[0] + val j11: J + // CHECK JVM_IR: + // Mangled name: Outer#(){}J<1:0,1:0> + // Public signature: /Outer.j11.|1291746945058754296[0] + get + + // CHECK: + // Mangled name: Outer.Inner + // Public signature: /Outer.Inner|null[0] + inner class Inner { + // CHECK: + // Mangled name: Outer.Inner{}j12 + // Public signature: /Outer.Inner.j12|8035547960084394556[0] + val j12: J + // CHECK JVM_IR: + // Mangled name: Outer.Inner#(){}J<2:0,1:0> + // Public signature: /Outer.Inner.j12.|-5099511302970927970[0] + get + + // CHECK: + // Mangled name: Outer.Inner#(J<2:0,1:0>){} + // Public signature: /Outer.Inner.|-1839564309215892252[0] + constructor(j12: J) /* primary */ + + } + + // CHECK: + // Mangled name: Outer#(J<1:0,1:0>){} + // Public signature: /Outer.|3621221723434232230[0] + constructor(j11: J) /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #test3(kotlin.Function1;kotlin.Function1){}C.D +// Public signature: /test3|-179639781639450333[0] +fun test3(f1: Function1, f2: Function1): D + +// CHECK JVM_IR: +// Mangled name: #test4(kotlin.Function1;kotlin.Function1){}Outer.Inner +// Public signature: /test4|7503778563590790519[0] +fun test4(f: Function1, g: Function1): Inner + +// CHECK JVM_IR: +// Mangled name: #testGenericJavaCtor1(kotlin.Function1){}G +// Public signature: /testGenericJavaCtor1|8726720168953319778[0] +fun testGenericJavaCtor1(f: Function1): G + +// CHECK: +// Mangled name: #testGenericJavaCtor2(kotlin.Any){} +// Public signature: /testGenericJavaCtor2|-6916979209934908350[0] +fun testGenericJavaCtor2(x: Any): Unit + diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.sig.kt.txt b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.sig.kt.txt new file mode 100644 index 00000000000..de37ceceea4 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.sig.kt.txt @@ -0,0 +1,50 @@ +// CHECK JVM_IR: +// Mangled name: #test1(){}J +// Public signature: /test1|8889900013954121507[0] +fun test1(): J + +// CHECK: +// Mangled name: #test10(kotlin.Function1){} +// Public signature: /test10|3769162614537259024[0] +fun test10(fn: Function1): Unit + +// CHECK JVM_IR: +// Mangled name: #test2(){}J +// Public signature: /test2|-2485267088492515783[0] +fun test2(): J + +// CHECK: +// Mangled name: #test3(){} +// Public signature: /test3|-3759735065270951803[0] +fun test3(): Unit + +// CHECK: +// Mangled name: #test4(kotlin.Any){} +// Public signature: /test4|-9023258848991787985[0] +fun test4(a: Any): Unit + +// CHECK: +// Mangled name: #test5(kotlin.Any){} +// Public signature: /test5|4504681808078971124[0] +fun test5(a: Any): Unit + +// CHECK: +// Mangled name: #test6(kotlin.Function1<0:0,0:0>){0§} +// Public signature: /test6|-3081320997310711341[0] +fun test6(a: Function1): Unit + +// CHECK: +// Mangled name: #test7(kotlin.Any){0§} +// Public signature: /test7|-5359981114052378429[0] +fun test7(a: Any): Unit + +// CHECK JVM_IR: +// Mangled name: #test8(kotlin.Function1){}J +// Public signature: /test8|-6112132748185879177[0] +fun test8(efn: @ExtensionFunctionType Function1): J + +// CHECK: +// Mangled name: #test9(kotlin.Function1){} +// Public signature: /test9|5682079641444556672[0] +fun test9(efn: @ExtensionFunctionType Function1): Unit + diff --git a/compiler/testData/ir/irText/expressions/sam/samConversions.kt b/compiler/testData/ir/irText/expressions/sam/samConversions.kt index c4442614de1..9c6027ee654 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversions.kt +++ b/compiler/testData/ir/irText/expressions/sam/samConversions.kt @@ -1,6 +1,7 @@ // FIR_IDENTICAL // TARGET_BACKEND: JVM // WITH_JDK + // FILE: samConversions.kt fun J.test0(a: Runnable) { J.runStatic(a) @@ -30,4 +31,4 @@ public class J { public void runIt(Runnable r) {} public void run2(Runnable r1, Runnable r2) {} -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/expressions/sam/samConversions.sig.kt.txt b/compiler/testData/ir/irText/expressions/sam/samConversions.sig.kt.txt new file mode 100644 index 00000000000..779b0e50771 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/sam/samConversions.sig.kt.txt @@ -0,0 +1,25 @@ +// CHECK: +// Mangled name: #test0@J(java.lang.Runnable){} +// Public signature: /test0|7082314898497215723[0] +fun J.test0(a: Runnable): Unit + +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +fun test1(): Unit + +// CHECK: +// Mangled name: #test2@J(){} +// Public signature: /test2|-509977306549568233[0] +fun J.test2(): Unit + +// CHECK: +// Mangled name: #test3@J(kotlin.Function0){} +// Public signature: /test3|3795186268197616186[0] +fun J.test3(a: Function0): Unit + +// CHECK: +// Mangled name: #test4@J(kotlin.Function0;kotlin.Function0;kotlin.Boolean){} +// Public signature: /test4|-7934218580139307891[0] +fun J.test4(a: Function0, b: Function0, flag: Boolean): Unit + diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.sig.kt.txt b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.sig.kt.txt new file mode 100644 index 00000000000..e297895456a --- /dev/null +++ b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.sig.kt.txt @@ -0,0 +1,50 @@ +// CHECK: +// Mangled name: #test1(kotlin.Function0){} +// Public signature: /test1|-2870537507416699845[0] +fun test1(a: Function0): Unit + +// CHECK: +// Mangled name: #test2(kotlin.Function0){} +// Public signature: /test2|-8241603768593447441[0] +fun test2(a: Function0): Unit + +// CHECK: +// Mangled name: #test3(kotlin.Function0){} +// Public signature: /test3|-1760685804488672424[0] +fun test3(a: Function0): Unit + +// CHECK: +// Mangled name: #test4(kotlin.Function0;kotlin.Function0){} +// Public signature: /test4|1443124276429499957[0] +fun test4(a: Function0, b: Function0): Unit + +// CHECK: +// Mangled name: #test5(kotlin.Any){} +// Public signature: /test5|4504681808078971124[0] +fun test5(a: Any): Unit + +// CHECK: +// Mangled name: #test5x(kotlin.Any){} +// Public signature: /test5x|8044678810048210306[0] +fun test5x(a: Any): Unit + +// CHECK: +// Mangled name: #test6(kotlin.Any){} +// Public signature: /test6|-7590017673454141671[0] +fun test6(a: Any): Unit + +// CHECK: +// Mangled name: #test7(kotlin.Function1){} +// Public signature: /test7|1095013294548842913[0] +fun test7(a: Function1): Unit + +// CHECK: +// Mangled name: #test8(kotlin.Function0){} +// Public signature: /test8|8321269803549472585[0] +fun test8(a: Function0): Unit + +// CHECK: +// Mangled name: #test9(){} +// Public signature: /test9|9214787561267119658[0] +fun test9(): Unit + diff --git a/compiler/testData/ir/irText/expressions/sam/samOperators.sig.kt.txt b/compiler/testData/ir/irText/expressions/sam/samOperators.sig.kt.txt new file mode 100644 index 00000000000..38adb5b3793 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/sam/samOperators.sig.kt.txt @@ -0,0 +1,20 @@ +// CHECK: +// Mangled name: #f(){} +// Public signature: /f|5316533450599009716[0] +fun f(): Unit + +// CHECK: +// Mangled name: #test1@J(){} +// Public signature: /test1|6869262091258899204[0] +fun J.test1(): Unit + +// CHECK: +// Mangled name: #test2@J(){} +// Public signature: /test2|-509977306549568233[0] +fun J.test2(): Unit + +// CHECK: +// Mangled name: #test3@J(){} +// Public signature: /test3|-2284942743287682332[0] +fun J.test3(): Unit + diff --git a/compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.sig.kt.txt b/compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.sig.kt.txt new file mode 100644 index 00000000000..e17cf4db49f --- /dev/null +++ b/compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.sig.kt.txt @@ -0,0 +1,16 @@ +// CHECK: +// Mangled name: Derived +// Public signature: /Derived|null[0] +class Derived : Base { + // CHECK: + // Mangled name: Derived#(){} + // Public signature: /Derived.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Derived#setValue(kotlin.Any){} + // Public signature: /Derived.setValue|6640123509702957343[0] + fun setValue(v: Any): Unit + +} + diff --git a/compiler/testData/ir/irText/expressions/signedToUnsignedConversions.sig.kt.txt b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions.sig.kt.txt new file mode 100644 index 00000000000..7d2931deafe --- /dev/null +++ b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions.sig.kt.txt @@ -0,0 +1,129 @@ +// FILE: signedToUnsignedConversions_annotation.kt +package kotlin.internal + +// CHECK: +// Mangled name: kotlin.internal.ImplicitIntegerCoercion +// Public signature: kotlin.internal/ImplicitIntegerCoercion|null[0] +open annotation class ImplicitIntegerCoercion : Annotation { + // CHECK: + // Mangled name: kotlin.internal.ImplicitIntegerCoercion#(){} + // Public signature: kotlin.internal/ImplicitIntegerCoercion.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// FILE: signedToUnsignedConversions_test.kt + +// CHECK: +// Mangled name: {}NON_CONST +// Public signature: /NON_CONST|-4803566926491846345[0] +@ImplicitIntegerCoercion +val NON_CONST: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /NON_CONST.|991601838629936197[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /NON_CONST.|-5428611507548024969[0] + get + +// CHECK: +// Mangled name: #takeLong(kotlin.Long){} +// Public signature: /takeLong|-7509231208527812056[0] +fun takeLong(@ImplicitIntegerCoercion l: Long): Unit + +// CHECK: +// Mangled name: #takeUByte(kotlin.UByte){} +// Public signature: /takeUByte|3111769148502345255[0] +fun takeUByte(@ImplicitIntegerCoercion u: UByte): Unit + +// CHECK: +// Mangled name: #takeUBytes(kotlin.UByteArray...){} +// Public signature: /takeUBytes|-7628407206907330338[0] +fun takeUBytes(@ImplicitIntegerCoercion vararg u: UByte): Unit + +// CHECK: +// Mangled name: #takeUInt(kotlin.UInt){} +// Public signature: /takeUInt|-8114543311657604451[0] +fun takeUInt(@ImplicitIntegerCoercion u: UInt): Unit + +// CHECK: +// Mangled name: #takeULong(kotlin.ULong){} +// Public signature: /takeULong|1215277262956617682[0] +fun takeULong(@ImplicitIntegerCoercion u: ULong): Unit + +// CHECK: +// Mangled name: #takeUShort(kotlin.UShort){} +// Public signature: /takeUShort|-5644206260671679522[0] +fun takeUShort(@ImplicitIntegerCoercion u: UShort): Unit + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + +// CHECK: +// Mangled name: {}BIGGER_THAN_UBYTE +// Public signature: /BIGGER_THAN_UBYTE|4216646662695832822[0] +@ImplicitIntegerCoercion +const val BIGGER_THAN_UBYTE: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /BIGGER_THAN_UBYTE.|-3586420332237318918[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /BIGGER_THAN_UBYTE.|3874178522908266564[0] + get + +// CHECK: +// Mangled name: {}EXPLICIT_INT +// Public signature: /EXPLICIT_INT|5543930282148953941[0] +@ImplicitIntegerCoercion +const val EXPLICIT_INT: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /EXPLICIT_INT.|-1305181552966507212[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /EXPLICIT_INT.|-2807246340269758912[0] + get + +// CHECK: +// Mangled name: {}IMPLICIT_INT +// Public signature: /IMPLICIT_INT|8774414386062212374[0] +@ImplicitIntegerCoercion +const val IMPLICIT_INT: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /IMPLICIT_INT.|-1175271202914280523[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /IMPLICIT_INT.|-5720776855566649215[0] + get + +// CHECK: +// Mangled name: {}LONG_CONST +// Public signature: /LONG_CONST|-5731655167745376835[0] +@ImplicitIntegerCoercion +const val LONG_CONST: Long + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Long + // Public signature: /LONG_CONST.|-7734005070309874987[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /LONG_CONST.|6497266276251766459[0] + get + +// CHECK: +// Mangled name: {}UINT_CONST +// Public signature: /UINT_CONST|6421919319877907708[0] +@ImplicitIntegerCoercion +const val UINT_CONST: UInt + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.UInt + // Public signature: /UINT_CONST.|-8736947558233336085[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /UINT_CONST.|7117473646004511278[0] + get + diff --git a/compiler/testData/ir/irText/expressions/simpleOperators.sig.kt.txt b/compiler/testData/ir/irText/expressions/simpleOperators.sig.kt.txt new file mode 100644 index 00000000000..d79ae4b37bd --- /dev/null +++ b/compiler/testData/ir/irText/expressions/simpleOperators.sig.kt.txt @@ -0,0 +1,88 @@ +// CHECK JVM_IR: +// Mangled name: #test1(kotlin.Int;kotlin.Int){}kotlin.Int +// Public signature: /test1|-7697640899277328116[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1(kotlin.Int;kotlin.Int){} +// Public signature: /test1|-6134767217751638375[0] +fun test1(a: Int, b: Int): Int + +// CHECK JVM_IR: +// Mangled name: #test1x(kotlin.Int;kotlin.Int){}kotlin.Int +// Public signature: /test1x|-5498284681962390624[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1x(kotlin.Int;kotlin.Int){} +// Public signature: /test1x|-6406641760254042927[0] +fun test1x(a: Int, b: Int): Int + +// CHECK JVM_IR: +// Mangled name: #test2(kotlin.Int;kotlin.Int){}kotlin.Int +// Public signature: /test2|5359184932542830643[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2(kotlin.Int;kotlin.Int){} +// Public signature: /test2|-1200247296907510564[0] +fun test2(a: Int, b: Int): Int + +// CHECK JVM_IR: +// Mangled name: #test2x(kotlin.Int;kotlin.Int){}kotlin.Int +// Public signature: /test2x|-5033054795170644611[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2x(kotlin.Int;kotlin.Int){} +// Public signature: /test2x|-5135897409521978624[0] +fun test2x(a: Int, b: Int): Int + +// CHECK JVM_IR: +// Mangled name: #test3(kotlin.Int;kotlin.Int){}kotlin.Int +// Public signature: /test3|113160628592048958[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3(kotlin.Int;kotlin.Int){} +// Public signature: /test3|1510814219519386190[0] +fun test3(a: Int, b: Int): Int + +// CHECK JVM_IR: +// Mangled name: #test3x(kotlin.Int;kotlin.Int){}kotlin.Int +// Public signature: /test3x|-1387842059076164098[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3x(kotlin.Int;kotlin.Int){} +// Public signature: /test3x|1722805008522433651[0] +fun test3x(a: Int, b: Int): Int + +// CHECK JVM_IR: +// Mangled name: #test4(kotlin.Int;kotlin.Int){}kotlin.Int +// Public signature: /test4|-3915516577528979463[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test4(kotlin.Int;kotlin.Int){} +// Public signature: /test4|-490448388534816120[0] +fun test4(a: Int, b: Int): Int + +// CHECK JVM_IR: +// Mangled name: #test4x(kotlin.Int;kotlin.Int){}kotlin.Int +// Public signature: /test4x|7349060524077498643[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test4x(kotlin.Int;kotlin.Int){} +// Public signature: /test4x|4214384274819330783[0] +fun test4x(a: Int, b: Int): Int + +// CHECK JVM_IR: +// Mangled name: #test5(kotlin.Int;kotlin.Int){}kotlin.Int +// Public signature: /test5|-1250205450627939858[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test5(kotlin.Int;kotlin.Int){} +// Public signature: /test5|2321095467793921266[0] +fun test5(a: Int, b: Int): Int + +// CHECK JVM_IR: +// Mangled name: #test5x(kotlin.Int;kotlin.Int){}kotlin.Int +// Public signature: /test5x|6043197125676702572[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test5x(kotlin.Int;kotlin.Int){} +// Public signature: /test5x|3967859070339155556[0] +fun test5x(a: Int, b: Int): Int + +// CHECK JVM_IR: +// Mangled name: #test6(kotlin.Int;kotlin.Int){}kotlin.ranges.IntRange +// Public signature: /test6|4933738173333996909[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test6(kotlin.Int;kotlin.Int){} +// Public signature: /test6|-1980698528780914991[0] +fun test6(a: Int, b: Int): IntRange + diff --git a/compiler/testData/ir/irText/expressions/simpleUnaryOperators.sig.kt.txt b/compiler/testData/ir/irText/expressions/simpleUnaryOperators.sig.kt.txt new file mode 100644 index 00000000000..d08cb5ec948 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/simpleUnaryOperators.sig.kt.txt @@ -0,0 +1,48 @@ +// CHECK JVM_IR: +// Mangled name: #test1(kotlin.Int){}kotlin.Int +// Public signature: /test1|135491646798962448[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1(kotlin.Int){} +// Public signature: /test1|-3111244057316668638[0] +fun test1(x: Int): Int + +// CHECK JVM_IR: +// Mangled name: #test2(){}kotlin.Int +// Public signature: /test2|5542371834528279174[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2(){} +// Public signature: /test2|4279114864133353152[0] +fun test2(): Int + +// CHECK JVM_IR: +// Mangled name: #test3(kotlin.Int){}kotlin.Int +// Public signature: /test3|4444212326709071419[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3(kotlin.Int){} +// Public signature: /test3|7508947747710505690[0] +fun test3(x: Int): Int + +// CHECK JVM_IR: +// Mangled name: #test4(){}kotlin.Int +// Public signature: /test4|3513867399525975921[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test4(){} +// Public signature: /test4|5588455914500386239[0] +fun test4(): Int + +// CHECK JVM_IR: +// Mangled name: #test5(kotlin.Boolean){}kotlin.Boolean +// Public signature: /test5|5789064363105651650[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test5(kotlin.Boolean){} +// Public signature: /test5|-1911074993921234175[0] +fun test5(x: Boolean): Boolean + +// CHECK JVM_IR: +// Mangled name: #test6(){}kotlin.Boolean +// Public signature: /test6|8631689306238556839[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test6(){} +// Public signature: /test6|-6357717956567725919[0] +fun test6(): Boolean + diff --git a/compiler/testData/ir/irText/expressions/smartCasts.sig.kt.txt b/compiler/testData/ir/irText/expressions/smartCasts.sig.kt.txt new file mode 100644 index 00000000000..a3e269ef0ad --- /dev/null +++ b/compiler/testData/ir/irText/expressions/smartCasts.sig.kt.txt @@ -0,0 +1,47 @@ +// CHECK: +// Mangled name: #expectsInt(kotlin.Int){} +// Public signature: /expectsInt|7060157470192889404[0] +fun expectsInt(i: Int): Unit + +// CHECK: +// Mangled name: #expectsString(kotlin.String){} +// Public signature: /expectsString|229423483676830816[0] +fun expectsString(s: String): Unit + +// CHECK JVM_IR: +// Mangled name: #overloaded(kotlin.String){}kotlin.String +// Public signature: /overloaded|-6751807575913949015[0] +// CHECK JS_IR NATIVE: +// Mangled name: #overloaded(kotlin.String){} +// Public signature: /overloaded|-6953470175034220057[0] +fun overloaded(s: String): String + +// CHECK JVM_IR: +// Mangled name: #overloaded(kotlin.Any){}kotlin.Any +// Public signature: /overloaded|-9074611933282297931[0] +// CHECK JS_IR NATIVE: +// Mangled name: #overloaded(kotlin.Any){} +// Public signature: /overloaded|7013236472054747107[0] +fun overloaded(x: Any): Any + +// CHECK: +// Mangled name: #test1(kotlin.Any){} +// Public signature: /test1|-4133164698161335314[0] +fun test1(x: Any): Unit + +// CHECK JVM_IR: +// Mangled name: #test2(kotlin.Any){}kotlin.String +// Public signature: /test2|1843573308398339018[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2(kotlin.Any){} +// Public signature: /test2|-8648451680149324146[0] +fun test2(x: Any): String + +// CHECK JVM_IR: +// Mangled name: #test3(kotlin.Any){}kotlin.String +// Public signature: /test3|-5895248493644150217[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3(kotlin.Any){} +// Public signature: /test3|165168275269731002[0] +fun test3(x: Any): String + diff --git a/compiler/testData/ir/irText/expressions/smartCastsWithDestructuring.sig.kt.txt b/compiler/testData/ir/irText/expressions/smartCastsWithDestructuring.sig.kt.txt new file mode 100644 index 00000000000..9bf6be4fcd9 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/smartCastsWithDestructuring.sig.kt.txt @@ -0,0 +1,35 @@ +// CHECK: +// Mangled name: I1 +// Public signature: /I1|null[0] +interface I1 { + +} + +// CHECK: +// Mangled name: I2 +// Public signature: /I2|null[0] +interface I2 { + +} + +// CHECK JVM_IR: +// Mangled name: #component1@I1(){}kotlin.Int +// Public signature: /component1|8801376328143328436[0] +// CHECK JS_IR NATIVE: +// Mangled name: #component1@I1(){} +// Public signature: /component1|-7381230852082083752[0] +operator fun I1.component1(): Int + +// CHECK JVM_IR: +// Mangled name: #component2@I2(){}kotlin.String +// Public signature: /component2|-3393912940495634771[0] +// CHECK JS_IR NATIVE: +// Mangled name: #component2@I2(){} +// Public signature: /component2|-7506551577483428650[0] +operator fun I2.component2(): String + +// CHECK: +// Mangled name: #test(I1){} +// Public signature: /test|-2567635956051433615[0] +fun test(x: I1): Unit + diff --git a/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.kt b/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.kt index 57c0329224f..352a0ddf755 100644 --- a/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.kt +++ b/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.kt @@ -1,3 +1,6 @@ +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR +// ^ KT-57429 + class Cell(val value: T) typealias IntAlias = Cell diff --git a/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.sig.kt.txt b/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.sig.kt.txt new file mode 100644 index 00000000000..2ad268ea083 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.sig.kt.txt @@ -0,0 +1,35 @@ +// CHECK: +// Mangled name: Cell +// Public signature: /Cell|null[0] +class Cell { + // CHECK: + // Mangled name: Cell{}value + // Public signature: /Cell.value|1987073854177347439[0] + val value: T + // CHECK JVM_IR: + // Mangled name: Cell#(){}1:0 + // Public signature: /Cell.value.|3167862337988859752[0] + // CHECK JS_IR NATIVE: + // Mangled name: Cell#(){} + // Public signature: /Cell.value.|3260093555963109437[0] + get + + // CHECK: + // Mangled name: Cell#(1:0){} + // Public signature: /Cell.|-8731461708390519279[0] + constructor(value: T) /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #test(){}Cell +// Public signature: /test|-4810339714221695945[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Cell + +// CHECK: +// Mangled name: IntAlias +// Public signature: /IntAlias|null[0] +typealias IntAlias = Cell diff --git a/compiler/testData/ir/irText/expressions/stringComparisons.sig.kt.txt b/compiler/testData/ir/irText/expressions/stringComparisons.sig.kt.txt new file mode 100644 index 00000000000..270db9dabab --- /dev/null +++ b/compiler/testData/ir/irText/expressions/stringComparisons.sig.kt.txt @@ -0,0 +1,32 @@ +// CHECK JVM_IR: +// Mangled name: #test1(kotlin.String;kotlin.String){}kotlin.Boolean +// Public signature: /test1|6790785447655035499[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1(kotlin.String;kotlin.String){} +// Public signature: /test1|8554714824822456836[0] +fun test1(a: String, b: String): Boolean + +// CHECK JVM_IR: +// Mangled name: #test2(kotlin.String;kotlin.String){}kotlin.Boolean +// Public signature: /test2|7858239913425663674[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2(kotlin.String;kotlin.String){} +// Public signature: /test2|-3623168192394156345[0] +fun test2(a: String, b: String): Boolean + +// CHECK JVM_IR: +// Mangled name: #test3(kotlin.String;kotlin.String){}kotlin.Boolean +// Public signature: /test3|-7031649260333243795[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3(kotlin.String;kotlin.String){} +// Public signature: /test3|-5165614332197612058[0] +fun test3(a: String, b: String): Boolean + +// CHECK JVM_IR: +// Mangled name: #test4(kotlin.String;kotlin.String){}kotlin.Boolean +// Public signature: /test4|6371007876260764309[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test4(kotlin.String;kotlin.String){} +// Public signature: /test4|7384031049358806214[0] +fun test4(a: String, b: String): Boolean + diff --git a/compiler/testData/ir/irText/expressions/stringPlus.sig.kt.txt b/compiler/testData/ir/irText/expressions/stringPlus.sig.kt.txt new file mode 100644 index 00000000000..6eb091f961e --- /dev/null +++ b/compiler/testData/ir/irText/expressions/stringPlus.sig.kt.txt @@ -0,0 +1,24 @@ +// CHECK JVM_IR: +// Mangled name: #test1(kotlin.String;kotlin.Any){}kotlin.String +// Public signature: /test1|2440544200321987910[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1(kotlin.String;kotlin.Any){} +// Public signature: /test1|-8076416945130465068[0] +fun test1(a: String, b: Any): String + +// CHECK JVM_IR: +// Mangled name: #test2(kotlin.String;kotlin.Int){}kotlin.String +// Public signature: /test2|9065897195329223931[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2(kotlin.String;kotlin.Int){} +// Public signature: /test2|6075955926134197604[0] +fun test2(a: String, b: Int): String + +// CHECK JVM_IR: +// Mangled name: #test3(kotlin.String;kotlin.Int){}kotlin.String +// Public signature: /test3|3363196109253524910[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3(kotlin.String;kotlin.Int){} +// Public signature: /test3|-788223786464412990[0] +fun test3(a: String, b: Int): String + diff --git a/compiler/testData/ir/irText/expressions/stringTemplates.kt b/compiler/testData/ir/irText/expressions/stringTemplates.kt index 6d0724ec657..0c0807c774d 100644 --- a/compiler/testData/ir/irText/expressions/stringTemplates.kt +++ b/compiler/testData/ir/irText/expressions/stringTemplates.kt @@ -1,5 +1,9 @@ // FIR_IDENTICAL +// MUTE_SIGNATURE_COMPARISON_K2: JS_IR +// MUTE_SIGNATURE_COMPARISON_K2: NATIVE +// ^ KT-57818 + fun foo(): String = "" val x = 42 @@ -14,4 +18,4 @@ val test6 = "$test1 ${foo()}" val test7 = "$test1" val test8 = "${foo()}" -val test9 = "$x" \ No newline at end of file +val test9 = "$x" diff --git a/compiler/testData/ir/irText/expressions/stringTemplates.sig.kt.txt b/compiler/testData/ir/irText/expressions/stringTemplates.sig.kt.txt new file mode 100644 index 00000000000..6d16e072814 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/stringTemplates.sig.kt.txt @@ -0,0 +1,128 @@ +// CHECK: +// Mangled name: {}x +// Public signature: /x|-8060530855978347579[0] +val x: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /x.|1482705010654679335[0] + get + +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /test1.|-7403750508378492770[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test1.|-5735092642142423279[0] + get + +// CHECK: +// Mangled name: {}test2 +// Public signature: /test2|2517758057000911509[0] +val test2: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /test2.|-8062412501290172814[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test2.|-5218942532816206869[0] + get + +// CHECK: +// Mangled name: {}test3 +// Public signature: /test3|7677556066983021166[0] +val test3: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /test3.|-2084248125648281731[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test3.|-7333791615083236686[0] + get + +// CHECK: +// Mangled name: {}test4 +// Public signature: /test4|-9115637610245762085[0] +val test4: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /test4.|5046196083583551233[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test4.|4166854324968284003[0] + get + +// CHECK: +// Mangled name: {}test5 +// Public signature: /test5|4734809624271551895[0] +val test5: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /test5.|-4328606172995874356[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test5.|-839819880171293643[0] + get + +// CHECK: +// Mangled name: {}test6 +// Public signature: /test6|-2606527149405855403[0] +val test6: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /test6.|-6697119911909222618[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test6.|2028965735388282488[0] + get + +// CHECK: +// Mangled name: {}test7 +// Public signature: /test7|1362036650170262859[0] +val test7: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /test7.|3397337933130018237[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test7.|-4463638325142628163[0] + get + +// CHECK: +// Mangled name: {}test8 +// Public signature: /test8|5640428216506241852[0] +val test8: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /test8.|-2649216934894616359[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test8.|-4670710835380513070[0] + get + +// CHECK: +// Mangled name: {}test9 +// Public signature: /test9|2260604978975893973[0] +val test9: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /test9.|5350098084251804677[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test9.|-4967207149018192355[0] + get + +// CHECK JVM_IR: +// Mangled name: #foo(){}kotlin.String +// Public signature: /foo|485335955883620819[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo(){} +// Public signature: /foo|-1041209573719867811[0] +fun foo(): String + diff --git a/compiler/testData/ir/irText/expressions/suspendConversionForExtensionFunction.kt b/compiler/testData/ir/irText/expressions/suspendConversionForExtensionFunction.kt index b42f88b5d52..b040fc4729c 100644 --- a/compiler/testData/ir/irText/expressions/suspendConversionForExtensionFunction.kt +++ b/compiler/testData/ir/irText/expressions/suspendConversionForExtensionFunction.kt @@ -1,6 +1,9 @@ // SKIP_KT_DUMP // !LANGUAGE: +SuspendConversion +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR +// ^ KT-57755 + fun main() { val foo: String.(suspend () -> Unit) -> Unit = {} val f: () -> Unit = {} diff --git a/compiler/testData/ir/irText/expressions/suspendConversionForExtensionFunction.sig.kt.txt b/compiler/testData/ir/irText/expressions/suspendConversionForExtensionFunction.sig.kt.txt new file mode 100644 index 00000000000..251c719c893 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/suspendConversionForExtensionFunction.sig.kt.txt @@ -0,0 +1,9 @@ +// CHECK JVM_IR: +// Mangled name computed from Ir: #main(){} +// Mangled name computed from Descriptor: #main(){}%suspendConversionForExtensionFunction.kt +// Public signature: /main|8952895695315889943[0] +// CHECK JS_IR NATIVE: +// Mangled name: #main(){} +// Public signature: /main|-4284757841571462650[0] +fun main(): Unit + diff --git a/compiler/testData/ir/irText/expressions/suspendConversionInVararg.sig.kt.txt b/compiler/testData/ir/irText/expressions/suspendConversionInVararg.sig.kt.txt new file mode 100644 index 00000000000..eda5f07a4f7 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/suspendConversionInVararg.sig.kt.txt @@ -0,0 +1,15 @@ +// CHECK: +// Mangled name: #testSuspendConversionInVarargElementsAll(kotlin.Function0;kotlin.Function0;kotlin.Function0){} +// Public signature: /testSuspendConversionInVarargElementsAll|7160265821198055848[0] +fun testSuspendConversionInVarargElementsAll(f1: Function0, f2: Function0, f3: Function0): Unit + +// CHECK: +// Mangled name: #testSuspendConversionInVarargElementsSome(kotlin.Function0;kotlin.coroutines.SuspendFunction0;kotlin.Function0){} +// Public signature: /testSuspendConversionInVarargElementsSome|1432579013054877862[0] +fun testSuspendConversionInVarargElementsSome(f1: Function0, sf2: SuspendFunction0, f3: Function0): Unit + +// CHECK: +// Mangled name: #useSuspendVararg(kotlin.Array>...){} +// Public signature: /useSuspendVararg|6945312118968967398[0] +fun useSuspendVararg(vararg sfn: SuspendFunction0): Unit + diff --git a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.sig.kt.txt b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.sig.kt.txt new file mode 100644 index 00000000000..3e70544f55d --- /dev/null +++ b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.sig.kt.txt @@ -0,0 +1,123 @@ +// CHECK JVM_IR: +// Mangled name: #produceFun(){}kotlin.Function0 +// Public signature: /produceFun|4804189546570931998[0] +// CHECK JS_IR NATIVE: +// Mangled name: #produceFun(){} +// Public signature: /produceFun|6933842891382874270[0] +fun produceFun(): Function0 + +// CHECK: +// Mangled name: #testExtAsExt(kotlin.Function1){} +// Public signature: /testExtAsExt|-7977860665221117368[0] +fun testExtAsExt(fn: @ExtensionFunctionType Function1): Unit + +// CHECK: +// Mangled name: #testExtAsExtT(kotlin.Function1){} +// Public signature: /testExtAsExtT|7097873516490245685[0] +fun testExtAsExtT(fn: @ExtensionFunctionType Function1): Unit + +// CHECK: +// Mangled name: #testExtAsSimple(kotlin.Function1){} +// Public signature: /testExtAsSimple|-1067298536485961384[0] +fun testExtAsSimple(fn: @ExtensionFunctionType Function1): Unit + +// CHECK: +// Mangled name: #testExtAsSimpleT(kotlin.Function1){} +// Public signature: /testExtAsSimpleT|2898108913573127027[0] +fun testExtAsSimpleT(fn: @ExtensionFunctionType Function1): Unit + +// CHECK: +// Mangled name: #testExtSAsExtT(kotlin.Function1<0:0,kotlin.Unit>){0§} +// Public signature: /testExtSAsExtT|1144176814022208305[0] +fun testExtSAsExtT(fn: @ExtensionFunctionType Function1): Unit + +// CHECK: +// Mangled name: #testExtSAsSimpleT(kotlin.Function1<0:0,kotlin.Unit>){0§} +// Public signature: /testExtSAsSimpleT|-2358609713172847328[0] +fun testExtSAsSimpleT(fn: @ExtensionFunctionType Function1): Unit + +// CHECK: +// Mangled name: #testIntersectionVsSuspendConversion(0:0){0§&kotlin.coroutines.SuspendFunction0>} +// Public signature: /testIntersectionVsSuspendConversion|3036580114518012351[0] +fun testIntersectionVsSuspendConversion(x: T): Unit where T : Function0, T : SuspendFunction0 + +// CHECK: +// Mangled name: #testSimple(kotlin.Function0){} +// Public signature: /testSimple|-2671092887420400255[0] +fun testSimple(fn: Function0): Unit + +// CHECK: +// Mangled name: #testSimpleAsExt(kotlin.Function1){} +// Public signature: /testSimpleAsExt|9047906843313761541[0] +fun testSimpleAsExt(fn: Function1): Unit + +// CHECK: +// Mangled name: #testSimpleAsExtT(kotlin.Function1){} +// Public signature: /testSimpleAsExtT|6234667294456337247[0] +fun testSimpleAsExtT(fn: Function1): Unit + +// CHECK: +// Mangled name: #testSimpleAsSimpleT(kotlin.Function1){} +// Public signature: /testSimpleAsSimpleT|4911702590190727707[0] +fun testSimpleAsSimpleT(fn: Function1): Unit + +// CHECK: +// Mangled name: #testSimpleNonVal(){} +// Public signature: /testSimpleNonVal|8897109715568911238[0] +fun testSimpleNonVal(): Unit + +// CHECK: +// Mangled name: #testSimpleSAsExtT(kotlin.Function1<0:0,kotlin.Unit>){0§} +// Public signature: /testSimpleSAsExtT|6597420463751673979[0] +fun testSimpleSAsExtT(fn: Function1): Unit + +// CHECK: +// Mangled name: #testSimpleSAsSimpleT(kotlin.Function1<0:0,kotlin.Unit>){0§} +// Public signature: /testSimpleSAsSimpleT|8425022052538754664[0] +fun testSimpleSAsSimpleT(fn: Function1): Unit + +// CHECK: +// Mangled name: #testSmartCastOnVarVsSuspendConversion(kotlin.Function0){} +// Public signature: /testSmartCastOnVarVsSuspendConversion|2087060806377142132[0] +fun testSmartCastOnVarVsSuspendConversion(a: Function0): Unit + +// CHECK: +// Mangled name: #testSmartCastOnVarWithSuspendConversion(kotlin.Any){} +// Public signature: /testSmartCastOnVarWithSuspendConversion|9105739241469619247[0] +fun testSmartCastOnVarWithSuspendConversion(a: Any): Unit + +// CHECK: +// Mangled name: #testSmartCastVsSuspendConversion(kotlin.Function0){} +// Public signature: /testSmartCastVsSuspendConversion|-8980078119905187795[0] +fun testSmartCastVsSuspendConversion(a: Function0): Unit + +// CHECK: +// Mangled name: #testSmartCastWithSuspendConversion(kotlin.Any){} +// Public signature: /testSmartCastWithSuspendConversion|7215678361079943817[0] +fun testSmartCastWithSuspendConversion(a: Any): Unit + +// CHECK: +// Mangled name: #useSuspend(kotlin.coroutines.SuspendFunction0){} +// Public signature: /useSuspend|60604456614172212[0] +fun useSuspend(sfn: SuspendFunction0): Unit + +// CHECK: +// Mangled name: #useSuspendArg(kotlin.coroutines.SuspendFunction1){} +// Public signature: /useSuspendArg|3426050309145504362[0] +fun useSuspendArg(sfn: SuspendFunction1): Unit + +// CHECK: +// Mangled name: #useSuspendArgT(kotlin.coroutines.SuspendFunction1<0:0,kotlin.Unit>){0§} +// Public signature: /useSuspendArgT|6442526549851733448[0] +fun useSuspendArgT(sfn: SuspendFunction1): Unit + +// CHECK: +// Mangled name: #useSuspendExt(kotlin.coroutines.SuspendFunction1){} +// Public signature: /useSuspendExt|-8690505892244175114[0] +fun useSuspendExt(sfn: @ExtensionFunctionType SuspendFunction1): Unit + +// CHECK: +// Mangled name: #useSuspendExtT(kotlin.coroutines.SuspendFunction1<0:0,kotlin.Unit>){0§} +// Public signature: /useSuspendExtT|-926225216925468449[0] +fun useSuspendExtT(sfn: @ExtensionFunctionType SuspendFunction1): Unit + diff --git a/compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.sig.kt.txt b/compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.sig.kt.txt new file mode 100644 index 00000000000..9d65410a288 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/suspendConversionWithFunInterfaces.sig.kt.txt @@ -0,0 +1,48 @@ +// CHECK: +// Mangled name: SuspendRunnable +// Public signature: /SuspendRunnable|null[0] +fun interface SuspendRunnable { + + // CHECK: + // Mangled name: SuspendRunnable#invoke(){} + // Public signature: /SuspendRunnable.invoke|-4663091332620260873[0] + abstract suspend fun invoke(): Unit + +} + +// CHECK: +// Mangled name: #bar1(){} +// Public signature: /bar1|1669926808669747346[0] +fun bar1(): Unit + +// CHECK JVM_IR: +// Mangled name: #bar2(kotlin.String){}kotlin.Int +// Public signature: /bar2|3267780493794663662[0] +// CHECK JS_IR NATIVE: +// Mangled name: #bar2(kotlin.String){} +// Public signature: /bar2|871846488143355822[0] +fun bar2(s: String): Int + +// CHECK: +// Mangled name: #bar3(){} +// Public signature: /bar3|-4458378888622542195[0] +fun bar3(): Unit + +// CHECK JVM_IR: +// Mangled name: #bar3(kotlin.String){}kotlin.Int +// Public signature: /bar3|-5694254873370624097[0] +// CHECK JS_IR NATIVE: +// Mangled name: #bar3(kotlin.String){} +// Public signature: /bar3|-8604784325283105439[0] +suspend fun bar3(s: String): Int + +// CHECK: +// Mangled name: #box(){} +// Public signature: /box|2173511048851971368[0] +fun box(): Unit + +// CHECK: +// Mangled name: #foo1(SuspendRunnable){} +// Public signature: /foo1|-5121966172672447653[0] +fun foo1(s: SuspendRunnable): Unit + diff --git a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.kt b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.kt index bb84e7adfc9..02b0c6f151e 100644 --- a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.kt +++ b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.kt @@ -1,6 +1,9 @@ // 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/temporaryInEnumEntryInitializer.sig.kt.txt b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.sig.kt.txt new file mode 100644 index 00000000000..4dad8410f38 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.sig.kt.txt @@ -0,0 +1,128 @@ +// CHECK: +// Mangled name: {}n +// Public signature: /n|-1061662854873377138[0] +val n: Any? + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Any? + // Public signature: /n.|7208370094191018600[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /n.|6911753306564452317[0] + get + +// CHECK: +// Mangled name: En +// Public signature: /En|null[0] +enum class En : Enum { + // CHECK: + // Mangled name: En{}x + // Public signature: /En.x|-8060530855978347579[0] + val x: String? + // CHECK JVM_IR: + // Mangled name: En#(){}kotlin.String? + // Public signature: /En.x.|1655337285200701437[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#(){} + // Public signature: /En.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: En#(kotlin.String?){} + // Public signature: /En.|392868513202821770[0] + private constructor(x: String?) /* primary */ + // CHECK: + // Mangled name: En.ENTRY + // Public signature: /En.ENTRY|null[0] + ENTRY + + // CHECK JVM_IR: + // Mangled name: En#valueOf#static(kotlin.String){}En + // Public signature: /En.valueOf|-1047188124757226812[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#valueOf#static(kotlin.String){} + // Public signature: /En.valueOf|-4683474617854611729[0] + fun valueOf(value: String): En + + // CHECK JVM_IR: + // Mangled name: En#values#static(){}kotlin.Array + // Public signature: /En.values|-6442868649398371099[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#values#static(){} + // Public signature: /En.values|-8715569000920726747[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: En#clone(){}kotlin.Any + // Public signature: /En.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#compareTo(En){} + // Public signature: /En.compareTo|3555292261046836181[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: En#compareTo(En){}kotlin.Int + // Public signature: /En.compareTo|7450321438177070471[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#equals(kotlin.Any?){} + // Public signature: /En.equals|4638265728071529943[0] + /* fake */ override operator fun compareTo(other: En): Int + + // CHECK JVM_IR: + // Mangled name: En#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /En.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#hashCode(){} + // Public signature: /En.hashCode|3409210261493131192[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: En#hashCode(){}kotlin.Int + // Public signature: /En.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#toString(){} + // Public signature: /En.toString|-1522858123163872138[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: En#toString(){}kotlin.String + // Public signature: /En.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#static{}entries + // Public signature: /En.entries|-5134227801081826149[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: En#static{}entries + // Public signature: /En.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: En##static(){}kotlin.enums.EnumEntries + // Public signature: /En.entries.|7832995474718587298[0] + // CHECK JS_IR NATIVE: + // Mangled name: En{}name + // Public signature: /En.name|4231860309499509769[0] + get(): EnumEntries + + // CHECK: + // Mangled name: En{}name + // Public signature: /En.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: En#(){}kotlin.String + // Public signature: /En.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: En{}ordinal + // Public signature: /En.ordinal|1912745122988592376[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: En{}ordinal + // Public signature: /En.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: En#(){}kotlin.Int + // Public signature: /En.ordinal.|-6902664390061762634[0] + /* fake */ override get(): Int + +} + diff --git a/compiler/testData/ir/irText/expressions/temporaryInInitBlock.sig.kt.txt b/compiler/testData/ir/irText/expressions/temporaryInInitBlock.sig.kt.txt new file mode 100644 index 00000000000..dd562ce2bb5 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/temporaryInInitBlock.sig.kt.txt @@ -0,0 +1,23 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C{}s + // Public signature: /C.s|7217541905509134881[0] + val s: String? + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.String? + // Public signature: /C.s.|-8914674600070030279[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.s.|-1662172381559511151[0] + get + + // CHECK: + // Mangled name: C#(kotlin.Any?){} + // Public signature: /C.|-8205545948568413246[0] + constructor(x: Any?) /* primary */ + +} + diff --git a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.kt b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.kt index 2352d9a001c..7b096d2edc5 100644 --- a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.kt +++ b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.kt @@ -1,3 +1,6 @@ +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR +// ^ KT-57429 + class Outer(val x: T) { open inner class Inner(val y: Int) } @@ -5,4 +8,4 @@ class Outer(val x: T) { fun Outer.test() = object : Outer.Inner(42) { val xx = x + y - } \ No newline at end of file + } diff --git a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.sig.kt.txt b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.sig.kt.txt new file mode 100644 index 00000000000..83dc97caab8 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.sig.kt.txt @@ -0,0 +1,54 @@ +// CHECK: +// Mangled name: Outer +// Public signature: /Outer|null[0] +class Outer { + // CHECK: + // Mangled name: Outer{}x + // Public signature: /Outer.x|-8060530855978347579[0] + val x: T + // CHECK JVM_IR: + // Mangled name: Outer#(){}1:0 + // Public signature: /Outer.x.|-8893883356128097563[0] + // CHECK JS_IR NATIVE: + // Mangled name: Outer#(){} + // Public signature: /Outer.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Outer.Inner + // Public signature: /Outer.Inner|null[0] + open inner class Inner { + // CHECK: + // Mangled name: Outer.Inner{}y + // Public signature: /Outer.Inner.y|3625903257357557171[0] + val y: Int + // CHECK JVM_IR: + // Mangled name: Outer.Inner#(){}kotlin.Int + // Public signature: /Outer.Inner.y.|-6745575372101973707[0] + // CHECK JS_IR NATIVE: + // Mangled name: Outer.Inner#(){} + // Public signature: /Outer.Inner.y.|-7902422373892128922[0] + get + + // CHECK: + // Mangled name: Outer.Inner#(kotlin.Int){} + // Public signature: /Outer.Inner.|-5182794243525578284[0] + constructor(y: Int) /* primary */ + + } + + // CHECK: + // Mangled name: Outer#(1:0){} + // Public signature: /Outer.|-8731461708390519279[0] + constructor(x: T) /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #test@Outer(){}Outer.Inner +// Public signature: /test|7679810293855475963[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test@Outer(){} +// Public signature: /test|6770853626275071541[0] +fun Outer.test(): Inner + diff --git a/compiler/testData/ir/irText/expressions/thisRefToObjectInNestedClassConstructorCall.sig.kt.txt b/compiler/testData/ir/irText/expressions/thisRefToObjectInNestedClassConstructorCall.sig.kt.txt new file mode 100644 index 00000000000..076ca3d54b3 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/thisRefToObjectInNestedClassConstructorCall.sig.kt.txt @@ -0,0 +1,80 @@ +// CHECK: +// Mangled name: Base +// Public signature: /Base|null[0] +open class Base { + // CHECK: + // Mangled name: Base{}x + // Public signature: /Base.x|-8060530855978347579[0] + val x: Any + // CHECK JVM_IR: + // Mangled name: Base#(){}kotlin.Any + // Public signature: /Base.x.|98409022523676208[0] + // CHECK JS_IR NATIVE: + // Mangled name: Base#(){} + // Public signature: /Base.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Base#(kotlin.Any){} + // Public signature: /Base.|4518179880532599055[0] + constructor(x: Any) /* primary */ + +} + +// CHECK: +// Mangled name: Host +// Public signature: /Host|null[0] +object Host { + // CHECK: + // Mangled name: Host.Derived1 + // Public signature: /Host.Derived1|null[0] + class Derived1 : Base { + // CHECK: + // Mangled name: Host.Derived1#(){} + // Public signature: /Host.Derived1.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Host.Derived1{}x + // Public signature: /Host.Derived1.x|-8060530855978347579[0] + /* fake */ override val x: Any + // CHECK JVM_IR: + // Mangled name: Host.Derived1#(){}kotlin.Any + // Public signature: /Host.Derived1.x.|98409022523676208[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host.Derived1#(){} + // Public signature: /Host.Derived1.x.|1482705010654679335[0] + /* fake */ override get(): Any + + } + + // CHECK: + // Mangled name: Host.Derived2 + // Public signature: /Host.Derived2|null[0] + class Derived2 : Base { + // CHECK: + // Mangled name: Host.Derived2#(){} + // Public signature: /Host.Derived2.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Host.Derived2{}x + // Public signature: /Host.Derived2.x|-8060530855978347579[0] + /* fake */ override val x: Any + // CHECK JVM_IR: + // Mangled name: Host.Derived2#(){}kotlin.Any + // Public signature: /Host.Derived2.x.|98409022523676208[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host.Derived2#(){} + // Public signature: /Host.Derived2.x.|1482705010654679335[0] + /* fake */ override get(): Any + + } + + // CHECK: + // Mangled name: Host#(){} + // Public signature: /Host.|-5645683436151566731[0] + private constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.kt b/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.kt index c6eea151f97..8dd43e36472 100644 --- a/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.kt +++ b/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.kt @@ -1,4 +1,9 @@ // FIR_IDENTICAL +// DUMP_LOCAL_DECLARATION_SIGNATURES + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57430 + fun WithCompanion.test() { val test1 = object : WithCompanion(this) {} val test2 = object : WithCompanion(this.foo()) {} @@ -8,4 +13,4 @@ open class WithCompanion(a: WithCompanion.Companion) { companion object { fun foo(): WithCompanion.Companion = this } -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.sig.kt.txt b/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.sig.kt.txt new file mode 100644 index 00000000000..690efb660a2 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.sig.kt.txt @@ -0,0 +1,52 @@ +// CHECK: +// Mangled name: WithCompanion +// Public signature: /WithCompanion|null[0] +open class WithCompanion { + // CHECK: + // Mangled name: WithCompanion.Companion + // Public signature: /WithCompanion.Companion|null[0] + companion object Companion { + // CHECK: + // Mangled name: WithCompanion.Companion#(){} + // Public signature: /WithCompanion.Companion.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: WithCompanion.Companion#foo(){}WithCompanion.Companion + // Public signature: /WithCompanion.Companion.foo|3115869173477949534[0] + // CHECK JS_IR NATIVE: + // Mangled name: WithCompanion.Companion#foo(){} + // Public signature: /WithCompanion.Companion.foo|-1041209573719867811[0] + fun foo(): Companion + + } + + // CHECK: + // Mangled name: WithCompanion#(WithCompanion.Companion){} + // Public signature: /WithCompanion.|-2521748254232742494[0] + constructor(a: Companion) /* primary */ + +} + +// CHECK: +// Mangled name: #test@WithCompanion(){} +// Public signature: /test|4153745090133876513[0] +fun WithCompanion.test(): Unit + // CHECK: + // Mangled name: #test@WithCompanion(){}. + local class : WithCompanion { + // CHECK: + // Mangled name: #test@WithCompanion(){}.#(){} + constructor() /* primary */ + + } + + // CHECK: + // Mangled name: #test@WithCompanion(){}. + local class : WithCompanion { + // CHECK: + // Mangled name: #test@WithCompanion(){}.#(){} + constructor() /* primary */ + + } + diff --git a/compiler/testData/ir/irText/expressions/throw.sig.kt.txt b/compiler/testData/ir/irText/expressions/throw.sig.kt.txt new file mode 100644 index 00000000000..6cf042414c7 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/throw.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +fun test1(): Unit + +// CHECK: +// Mangled name: #testImplicitCast(kotlin.Any){} +// Public signature: /testImplicitCast|3599450462487506190[0] +fun testImplicitCast(a: Any): Unit + diff --git a/compiler/testData/ir/irText/expressions/tryCatch.sig.kt.txt b/compiler/testData/ir/irText/expressions/tryCatch.sig.kt.txt new file mode 100644 index 00000000000..08dac3ac417 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/tryCatch.sig.kt.txt @@ -0,0 +1,13 @@ +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +fun test1(): Unit + +// CHECK JVM_IR: +// Mangled name: #test2(){}kotlin.Int +// Public signature: /test2|5542371834528279174[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2(){} +// Public signature: /test2|4279114864133353152[0] +fun test2(): Int + diff --git a/compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.sig.kt.txt b/compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.sig.kt.txt new file mode 100644 index 00000000000..7b0e41447cd --- /dev/null +++ b/compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #testImplicitCast(kotlin.Any){} +// Public signature: /testImplicitCast|3599450462487506190[0] +fun testImplicitCast(a: Any): Unit + diff --git a/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.kt b/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.kt index 91d00c524d7..f57078cf97c 100644 --- a/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.kt +++ b/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.kt @@ -1,3 +1,7 @@ +// MUTE_SIGNATURE_COMPARISON_K2: JS_IR +// MUTE_SIGNATURE_COMPARISON_K2: NATIVE +// ^ KT-57818 + import Host.Nested class C(x: Int) @@ -11,4 +15,4 @@ object Host { typealias NA = Nested val test1: (Int) -> CA = ::CA -val test2: (Int) -> NA = ::NA \ No newline at end of file +val test2: (Int) -> NA = ::NA diff --git a/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.sig.kt.txt b/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.sig.kt.txt new file mode 100644 index 00000000000..3117a76d8bf --- /dev/null +++ b/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.sig.kt.txt @@ -0,0 +1,65 @@ +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: Function1 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function1 + // Public signature: /test1.|3885954913991504024[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test1.|-5735092642142423279[0] + get + +// CHECK: +// Mangled name: {}test2 +// Public signature: /test2|2517758057000911509[0] +val test2: Function1 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function1 + // Public signature: /test2.|7753417540311277623[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test2.|-5218942532816206869[0] + get + +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C#(kotlin.Int){} + // Public signature: /C.|-5182794243525578284[0] + constructor(x: Int) /* primary */ + +} + +// CHECK: +// Mangled name: Host +// Public signature: /Host|null[0] +object Host { + // CHECK: + // Mangled name: Host.Nested + // Public signature: /Host.Nested|null[0] + class Nested { + // CHECK: + // Mangled name: Host.Nested#(kotlin.Int){} + // Public signature: /Host.Nested.|-5182794243525578284[0] + constructor(x: Int) /* primary */ + + } + + // CHECK: + // Mangled name: Host#(){} + // Public signature: /Host.|-5645683436151566731[0] + private constructor() /* primary */ + +} + +// CHECK: +// Mangled name: CA +// Public signature: /CA|null[0] +typealias CA = C +// CHECK: +// Mangled name: NA +// Public signature: /NA|null[0] +typealias NA = Nested diff --git a/compiler/testData/ir/irText/expressions/typeArguments.sig.kt.txt b/compiler/testData/ir/irText/expressions/typeArguments.sig.kt.txt new file mode 100644 index 00000000000..01cf42542b2 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/typeArguments.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK JVM_IR: +// Mangled name: #test1(kotlin.Any){}kotlin.Boolean +// Public signature: /test1|1992455603103220352[0] +fun test1(x: Any): Boolean + diff --git a/compiler/testData/ir/irText/expressions/typeOperators.sig.kt.txt b/compiler/testData/ir/irText/expressions/typeOperators.sig.kt.txt new file mode 100644 index 00000000000..f102ceda3f7 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/typeOperators.sig.kt.txt @@ -0,0 +1,39 @@ +// CHECK: +// Mangled name: IThing +// Public signature: /IThing|null[0] +interface IThing { + +} + +// CHECK JVM_IR: +// Mangled name: #test1(kotlin.Any){}kotlin.Boolean +// Public signature: /test1|1992455603103220352[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1(kotlin.Any){} +// Public signature: /test1|-4133164698161335314[0] +fun test1(x: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test2(kotlin.Any){}kotlin.Boolean +// Public signature: /test2|3521389046788459849[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2(kotlin.Any){} +// Public signature: /test2|-8648451680149324146[0] +fun test2(x: Any): Boolean + +// CHECK JVM_IR: +// Mangled name: #test3(kotlin.Any){}IThing +// Public signature: /test3|4511496264328134559[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3(kotlin.Any){} +// Public signature: /test3|165168275269731002[0] +fun test3(x: Any): IThing + +// CHECK JVM_IR: +// Mangled name: #test4(kotlin.Any){}IThing? +// Public signature: /test4|754810918571935352[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test4(kotlin.Any){} +// Public signature: /test4|-9023258848991787985[0] +fun test4(x: Any): IThing? + diff --git a/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.kt b/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.kt index 7876d051e26..9d2f1ff1ff8 100644 --- a/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.kt +++ b/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.kt @@ -1,4 +1,8 @@ // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^KT-57436 + inline fun classRefFun() = T::class inline fun Any.classRefExtFun() = T::class diff --git a/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.sig.kt.txt b/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.sig.kt.txt new file mode 100644 index 00000000000..327709b888b --- /dev/null +++ b/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.sig.kt.txt @@ -0,0 +1,67 @@ +// CHECK: +// Mangled name: Host +// Public signature: /Host|null[0] +class Host { + // CHECK: + // Mangled name: Host#(){} + // Public signature: /Host.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Host#classRefGenericMemberExtFun@kotlin.Any(){0§}kotlin.reflect.KClass<0:0> + // Public signature: /Host.classRefGenericMemberExtFun|3649030800014668260[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#classRefGenericMemberExtFun@kotlin.Any(){0§} + // Public signature: /Host.classRefGenericMemberExtFun|-4515238060105953539[0] + inline fun Any.classRefGenericMemberExtFun(): KClass + + // CHECK JVM_IR: + // Mangled name: Host#classRefGenericMemberFun(){0§}kotlin.reflect.KClass<0:0> + // Public signature: /Host.classRefGenericMemberFun|3400078441198881955[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#classRefGenericMemberFun(){0§} + // Public signature: /Host.classRefGenericMemberFun|184046997078409627[0] + inline fun classRefGenericMemberFun(): KClass + + // CHECK: + // Mangled name: Host@0:0{0§}classRefGenericMemberExtVal + // Public signature: /Host.classRefGenericMemberExtVal|-8932160824632385145[0] + val TV.classRefGenericMemberExtVal: KClass + // CHECK JVM_IR: + // Mangled name: Host#@0:0(){0§}kotlin.reflect.KClass<0:0> + // Public signature: /Host.classRefGenericMemberExtVal.|-5755261364292961598[0] + // CHECK JS_IR NATIVE: + // Mangled name: Host#@0:0(){0§} + // Public signature: /Host.classRefGenericMemberExtVal.|-6412952020535883296[0] + inline get(): KClass + +} + +// CHECK JVM_IR: +// Mangled name: #classRefExtFun@kotlin.Any(){0§}kotlin.reflect.KClass<0:0> +// Public signature: /classRefExtFun|-1864950045386016139[0] +// CHECK JS_IR NATIVE: +// Mangled name: #classRefExtFun@kotlin.Any(){0§} +// Public signature: /classRefExtFun|9090772127767101131[0] +inline fun Any.classRefExtFun(): KClass + +// CHECK JVM_IR: +// Mangled name: #classRefFun(){0§}kotlin.reflect.KClass<0:0> +// Public signature: /classRefFun|3938071424191927837[0] +// CHECK JS_IR NATIVE: +// Mangled name: #classRefFun(){0§} +// Public signature: /classRefFun|-2224735520893898761[0] +inline fun classRefFun(): KClass + +// CHECK: +// Mangled name: @0:0{0§}classRefExtVal +// Public signature: /classRefExtVal|-7311932072197705388[0] +val T.classRefExtVal: KClass + // CHECK JVM_IR: + // Mangled name: #@0:0(){0§}kotlin.reflect.KClass<0:0> + // Public signature: /classRefExtVal.|6348231485331432921[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@0:0(){0§} + // Public signature: /classRefExtVal.|-4372549339255610381[0] + inline get(): KClass + diff --git a/compiler/testData/ir/irText/expressions/unsignedIntegerLiterals.sig.kt.txt b/compiler/testData/ir/irText/expressions/unsignedIntegerLiterals.sig.kt.txt new file mode 100644 index 00000000000..97e9b6ef4b9 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/unsignedIntegerLiterals.sig.kt.txt @@ -0,0 +1,120 @@ +// CHECK: +// Mangled name: {}testSimpleUIntLiteral +// Public signature: /testSimpleUIntLiteral|-5462154717039801349[0] +val testSimpleUIntLiteral: UInt + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.UInt + // Public signature: /testSimpleUIntLiteral.|-4653191023207023329[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testSimpleUIntLiteral.|-6704568008056559053[0] + get + +// CHECK: +// Mangled name: {}testSimpleUIntLiteralWithOverflow +// Public signature: /testSimpleUIntLiteralWithOverflow|5568529828713576484[0] +val testSimpleUIntLiteralWithOverflow: UInt + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.UInt + // Public signature: /testSimpleUIntLiteralWithOverflow.|-8518123773042217261[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testSimpleUIntLiteralWithOverflow.|-3684407297918930915[0] + get + +// CHECK: +// Mangled name: {}testUByteWithExpectedType +// Public signature: /testUByteWithExpectedType|3852078077095318718[0] +val testUByteWithExpectedType: UByte + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.UByte + // Public signature: /testUByteWithExpectedType.|-6501427247498652278[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testUByteWithExpectedType.|-2486015478697901588[0] + get + +// CHECK: +// Mangled name: {}testUShortWithExpectedType +// Public signature: /testUShortWithExpectedType|6165338656044520744[0] +val testUShortWithExpectedType: UShort + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.UShort + // Public signature: /testUShortWithExpectedType.|-7410031910894675749[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testUShortWithExpectedType.|1132366278871381249[0] + get + +// CHECK: +// Mangled name: {}testUIntWithExpectedType +// Public signature: /testUIntWithExpectedType|6767656315821705452[0] +val testUIntWithExpectedType: UInt + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.UInt + // Public signature: /testUIntWithExpectedType.|870704205305295065[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testUIntWithExpectedType.|-7635408390937372758[0] + get + +// CHECK: +// Mangled name: {}testULongWithExpectedType +// Public signature: /testULongWithExpectedType|-2014270652591396342[0] +val testULongWithExpectedType: ULong + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.ULong + // Public signature: /testULongWithExpectedType.|4475524496791661545[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testULongWithExpectedType.|7861557248796768147[0] + get + +// CHECK: +// Mangled name: {}testToUByte +// Public signature: /testToUByte|5171013167243366088[0] +val testToUByte: UByte + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.UByte + // Public signature: /testToUByte.|4718877243529221360[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testToUByte.|-1224639133109235261[0] + get + +// CHECK: +// Mangled name: {}testToUShort +// Public signature: /testToUShort|-7150535629935793542[0] +val testToUShort: UShort + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.UShort + // Public signature: /testToUShort.|1257054497303804599[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testToUShort.|-8157516695178985946[0] + get + +// CHECK: +// Mangled name: {}testToUInt +// Public signature: /testToUInt|9156445495607337470[0] +val testToUInt: UInt + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.UInt + // Public signature: /testToUInt.|-5858848290517809988[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testToUInt.|2688223986243812534[0] + get + +// CHECK: +// Mangled name: {}testToULong +// Public signature: /testToULong|901391237959692446[0] +val testToULong: ULong + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.ULong + // Public signature: /testToULong.|-1569892355870406141[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /testToULong.|4327718520579802868[0] + get + diff --git a/compiler/testData/ir/irText/expressions/useImportedMember.kt b/compiler/testData/ir/irText/expressions/useImportedMember.kt index 83b806eb024..5ab9867e31b 100644 --- a/compiler/testData/ir/irText/expressions/useImportedMember.kt +++ b/compiler/testData/ir/irText/expressions/useImportedMember.kt @@ -1,3 +1,6 @@ +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57436 + import C.f import C.p import C.ext @@ -47,4 +50,4 @@ fun box(): String { if (genericFromSuper("11") != "11") return "11" return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/expressions/useImportedMember.sig.kt.txt b/compiler/testData/ir/irText/expressions/useImportedMember.sig.kt.txt new file mode 100644 index 00000000000..fbcfd007a40 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/useImportedMember.sig.kt.txt @@ -0,0 +1,165 @@ +// CHECK: +// Mangled name: BaseClass +// Public signature: /BaseClass|null[0] +open class BaseClass { + // CHECK: + // Mangled name: BaseClass#(){} + // Public signature: /BaseClass.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: BaseClass@0:0{0§}fromClass + // Public signature: /BaseClass.fromClass|-434634369200779905[0] + val T.fromClass: T + // CHECK JVM_IR: + // Mangled name: BaseClass#@0:0(){0§}0:0 + // Public signature: /BaseClass.fromClass.|1075975932794232667[0] + // CHECK JS_IR NATIVE: + // Mangled name: BaseClass#@0:0(){0§} + // Public signature: /BaseClass.fromClass.|8463340725421946486[0] + get(): T + +} + +// CHECK: +// Mangled name: I +// Public signature: /I|null[0] +interface I { + + // CHECK JVM_IR: + // Mangled name: I#fromInterface@0:0(){0§}0:0 + // Public signature: /I.fromInterface|-4942486396992795009[0] + // CHECK JS_IR NATIVE: + // Mangled name: I#fromInterface@0:0(){0§} + // Public signature: /I.fromInterface|5511198429410705347[0] + fun T.fromInterface(): T + + // CHECK JVM_IR: + // Mangled name: I#genericFromSuper(1:0){}1:0 + // Public signature: /I.genericFromSuper|8776773144406187108[0] + // CHECK JS_IR NATIVE: + // Mangled name: I#genericFromSuper(1:0){} + // Public signature: /I.genericFromSuper|-1644691372973676049[0] + fun genericFromSuper(g: G): G + +} + +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +object C : BaseClass, I { + // CHECK: + // Mangled name: C{}p + // Public signature: /C.p|6715504260787941082[0] + var p: Int + // CHECK JVM_IR: + // Mangled name: C#(){}kotlin.Int + // Public signature: /C.p.|5329635969197638839[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.p.|-1162552463316289847[0] + get + // CHECK: + // Mangled name: C#(kotlin.Int){} + // Public signature: /C.p.|-6346582004572228570[0] + set + + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: C#fromInterface@0:0(){0§}0:0 + // Public signature: /C.fromInterface|-4942486396992795009[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#fromInterface@0:0(){0§} + // Public signature: /C.fromInterface|5511198429410705347[0] + /* fake */ override fun T.fromInterface(): T + + // CHECK JVM_IR: + // Mangled name: C#genericFromSuper(kotlin.String){}kotlin.String + // Public signature: /C.genericFromSuper|-3774933388415552430[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#genericFromSuper(kotlin.String){} + // Public signature: /C.genericFromSuper|-3764809794745363336[0] + /* fake */ override fun genericFromSuper(g: String): String + + // CHECK JVM_IR: + // Mangled name: C#f@kotlin.Boolean(){}kotlin.Int + // Public signature: /C.f|-2085546679212506947[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#f@kotlin.Boolean(){} + // Public signature: /C.f|-7209860956633916761[0] + fun Boolean.f(): Int + + // CHECK JVM_IR: + // Mangled name: C#f(kotlin.Int){}kotlin.Int + // Public signature: /C.f|-3963816453364174180[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#f(kotlin.Int){} + // Public signature: /C.f|-3170307087267241726[0] + fun f(s: Int): Int + + // CHECK JVM_IR: + // Mangled name: C#f(kotlin.String){}kotlin.Int + // Public signature: /C.f|-4014058920923284658[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#f(kotlin.String){} + // Public signature: /C.f|5157548403930815746[0] + fun f(s: String): Int + + // CHECK JVM_IR: + // Mangled name: C#g1(0:0){0§}0:0 + // Public signature: /C.g1|600972423589629792[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#g1(0:0){0§} + // Public signature: /C.g1|-2502969624600571326[0] + fun g1(t: T): T + + // CHECK: + // Mangled name: C@0:0{0§}fromClass + // Public signature: /C.fromClass|-434634369200779905[0] + /* fake */ override val T.fromClass: T + // CHECK JVM_IR: + // Mangled name: C#@0:0(){0§}0:0 + // Public signature: /C.fromClass.|1075975932794232667[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#@0:0(){0§} + // Public signature: /C.fromClass.|8463340725421946486[0] + /* fake */ override get(): T + + // CHECK: + // Mangled name: C@kotlin.Int{}ext + // Public signature: /C.ext|-8111988424022289676[0] + val Int.ext: Int + // CHECK JVM_IR: + // Mangled name: C#@kotlin.Int(){}kotlin.Int + // Public signature: /C.ext.|6877487399042398312[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#@kotlin.Int(){} + // Public signature: /C.ext.|4181680515445802017[0] + get(): Int + + // CHECK: + // Mangled name: C@0:0{0§}g2 + // Public signature: /C.g2|8414340838395849892[0] + val T.g2: T + // CHECK JVM_IR: + // Mangled name: C#@0:0(){0§}0:0 + // Public signature: /C.g2.|6685580240509732107[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#@0:0(){0§} + // Public signature: /C.g2.|-386868283857669113[0] + get(): T + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +// CHECK JS_IR NATIVE: +// Mangled name: #box(){} +// Public signature: /box|2173511048851971368[0] +fun box(): String + diff --git a/compiler/testData/ir/irText/expressions/values.kt b/compiler/testData/ir/irText/expressions/values.kt index c98a648a187..4d3df96572c 100644 --- a/compiler/testData/ir/irText/expressions/values.kt +++ b/compiler/testData/ir/irText/expressions/values.kt @@ -1,6 +1,9 @@ // 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/values.sig.kt.txt b/compiler/testData/ir/irText/expressions/values.sig.kt.txt new file mode 100644 index 00000000000..747b68a0ea3 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/values.sig.kt.txt @@ -0,0 +1,181 @@ +// CHECK: +// Mangled name: {}a +// Public signature: /a|-1200697420457237799[0] +val a: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /a.|4232747788241509192[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /a.|6785176174175479410[0] + get + +// CHECK: +// Mangled name: Z +// Public signature: /Z|null[0] +class Z { + // CHECK: + // Mangled name: Z.Companion + // Public signature: /Z.Companion|null[0] + companion object Companion { + // CHECK: + // Mangled name: Z.Companion#(){} + // Public signature: /Z.Companion.|-5645683436151566731[0] + private constructor() /* primary */ + + } + + // CHECK: + // Mangled name: Z#(){} + // Public signature: /Z.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: Enum +// Public signature: /Enum|null[0] +enum class Enum : Enum { + // CHECK: + // Mangled name: Enum#(){} + // Public signature: /Enum.|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK: + // Mangled name: Enum.A + // Public signature: /Enum.A|null[0] + A + + // CHECK JVM_IR: + // Mangled name: Enum#valueOf#static(kotlin.String){}Enum + // Public signature: /Enum.valueOf|3536549559141182245[0] + // CHECK JS_IR NATIVE: + // Mangled name: Enum#valueOf#static(kotlin.String){} + // Public signature: /Enum.valueOf|-4683474617854611729[0] + fun valueOf(value: String): Enum + + // CHECK JVM_IR: + // Mangled name: Enum#values#static(){}kotlin.Array + // Public signature: /Enum.values|7836551505611991213[0] + // CHECK JS_IR NATIVE: + // Mangled name: Enum#values#static(){} + // Public signature: /Enum.values|-8715569000920726747[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: Enum#clone(){}kotlin.Any + // Public signature: /Enum.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: Enum#compareTo(Enum){} + // Public signature: /Enum.compareTo|-4443884423672358900[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: Enum#compareTo(Enum){}kotlin.Int + // Public signature: /Enum.compareTo|5116290257178107514[0] + // CHECK JS_IR NATIVE: + // Mangled name: Enum#equals(kotlin.Any?){} + // Public signature: /Enum.equals|4638265728071529943[0] + /* fake */ override operator fun compareTo(other: Enum): Int + + // CHECK JVM_IR: + // Mangled name: Enum#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Enum.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: Enum#hashCode(){} + // Public signature: /Enum.hashCode|3409210261493131192[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Enum#hashCode(){}kotlin.Int + // Public signature: /Enum.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: Enum#toString(){} + // Public signature: /Enum.toString|-1522858123163872138[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Enum#toString(){}kotlin.String + // Public signature: /Enum.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: Enum#static{}entries + // Public signature: /Enum.entries|-5134227801081826149[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: Enum#static{}entries + // Public signature: /Enum.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: Enum##static(){}kotlin.enums.EnumEntries + // Public signature: /Enum.entries.|-2213733217881289366[0] + // CHECK JS_IR NATIVE: + // Mangled name: Enum{}name + // Public signature: /Enum.name|4231860309499509769[0] + get(): EnumEntries + + // CHECK: + // Mangled name: Enum{}name + // Public signature: /Enum.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: Enum#(){}kotlin.String + // Public signature: /Enum.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: Enum{}ordinal + // Public signature: /Enum.ordinal|1912745122988592376[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Enum{}ordinal + // Public signature: /Enum.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: Enum#(){}kotlin.Int + // Public signature: /Enum.ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: A + // Public signature: /A|null[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +object A { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + private constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #test1(){}Enum +// Public signature: /test1|2327660247328941000[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2(){} +// Public signature: /test2|4279114864133353152[0] +fun test1(): Enum + +// CHECK JVM_IR: +// Mangled name: #test2(){}A +// Public signature: /test2|-3343341839692584744[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3(){} +// Public signature: /test3|-3759735065270951803[0] +fun test2(): A + +// CHECK JVM_IR: +// Mangled name: #test3(){}kotlin.Int +// Public signature: /test3|-1546181855196587449[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test4(){} +// Public signature: /test4|5588455914500386239[0] +fun test3(): Int + +// CHECK JVM_IR: +// Mangled name: #test4(){}Z.Companion +// Public signature: /test4|5728287137046346436[0] +fun test4(): Companion + diff --git a/compiler/testData/ir/irText/expressions/vararg.kt b/compiler/testData/ir/irText/expressions/vararg.kt index 45694544bb9..360379261b8 100644 --- a/compiler/testData/ir/irText/expressions/vararg.kt +++ b/compiler/testData/ir/irText/expressions/vararg.kt @@ -1,4 +1,9 @@ // 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") \ No newline at end of file +val test3 = arrayOf("0", *test2, *test1, "4") diff --git a/compiler/testData/ir/irText/expressions/vararg.sig.kt.txt b/compiler/testData/ir/irText/expressions/vararg.sig.kt.txt new file mode 100644 index 00000000000..c4eb13f3f6a --- /dev/null +++ b/compiler/testData/ir/irText/expressions/vararg.sig.kt.txt @@ -0,0 +1,36 @@ +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: Array + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Array + // Public signature: /test1.|8996074039281467609[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test1.|-5735092642142423279[0] + get + +// CHECK: +// Mangled name: {}test2 +// Public signature: /test2|2517758057000911509[0] +val test2: Array + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Array + // Public signature: /test2.|8356930717205409793[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test2.|-5218942532816206869[0] + get + +// CHECK: +// Mangled name: {}test3 +// Public signature: /test3|7677556066983021166[0] +val test3: Array + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Array + // Public signature: /test3.|5125705621547713034[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test3.|-7333791615083236686[0] + get + diff --git a/compiler/testData/ir/irText/expressions/varargWithImplicitCast.sig.kt.txt b/compiler/testData/ir/irText/expressions/varargWithImplicitCast.sig.kt.txt new file mode 100644 index 00000000000..4b77db63f0f --- /dev/null +++ b/compiler/testData/ir/irText/expressions/varargWithImplicitCast.sig.kt.txt @@ -0,0 +1,16 @@ +// CHECK JVM_IR: +// Mangled name: #testScalar(kotlin.Any){}kotlin.IntArray +// Public signature: /testScalar|-7300349592361569657[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testScalar(kotlin.Any){} +// Public signature: /testScalar|5015664091652776532[0] +fun testScalar(a: Any): IntArray + +// CHECK JVM_IR: +// Mangled name: #testSpread(kotlin.Any){}kotlin.IntArray +// Public signature: /testSpread|-65767048159588156[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testSpread(kotlin.Any){} +// Public signature: /testSpread|7513462184387724605[0] +fun testSpread(a: Any): IntArray + diff --git a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.sig.kt.txt b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.sig.kt.txt new file mode 100644 index 00000000000..93feaf66483 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.sig.kt.txt @@ -0,0 +1,34 @@ +// CHECK JVM_IR: +// Mangled name: #k@kotlin.String(){}kotlin.Function0 +// Public signature: /k|-4623891636485044145[0] +// CHECK JS_IR NATIVE: +// Mangled name: #k@kotlin.String(){} +// Public signature: /k|603037284564559001[0] +fun String.k(): Function0 + +// CHECK: +// Mangled name: #test1(kotlin.Function0){} +// Public signature: /test1|-2870537507416699845[0] +fun test1(f: Function0): Unit + +// CHECK: +// Mangled name: #test2(kotlin.Function1){} +// Public signature: /test2|4596316013814715028[0] +fun test2(f: @ExtensionFunctionType Function1): Unit + +// CHECK JVM_IR: +// Mangled name: #test3(){}kotlin.String +// Public signature: /test3|3344305992477585251[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3(){} +// Public signature: /test3|-3759735065270951803[0] +fun test3(): String + +// CHECK JVM_IR: +// Mangled name: #test4(kotlin.String?){}kotlin.String? +// Public signature: /test4|-1434334118883225411[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test4(kotlin.String?){} +// Public signature: /test4|-2246924836724040051[0] +fun test4(ns: String?): String? + diff --git a/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.kt b/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.kt index e22c38363b2..d0b4d2f5389 100644 --- a/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.kt +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.kt @@ -1,4 +1,7 @@ // FIR_IDENTICAL +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429 + val T.gk: () -> T get() = { -> this } diff --git a/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.sig.kt.txt b/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.sig.kt.txt new file mode 100644 index 00000000000..51b82ed7e72 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.sig.kt.txt @@ -0,0 +1,40 @@ +// CHECK JVM_IR: +// Mangled name: #kt26531(){}kotlin.Int +// Public signature: /kt26531|-5036677741316309709[0] +// CHECK JS_IR NATIVE: +// Mangled name: #kt26531(){} +// Public signature: /kt26531|7300576202386148897[0] +fun kt26531(): Int + +// CHECK JVM_IR: +// Mangled name: #testGeneric1(kotlin.String){}kotlin.String +// Public signature: /testGeneric1|-7724827201218857505[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testGeneric1(kotlin.String){} +// Public signature: /testGeneric1|-5931195457682017374[0] +fun testGeneric1(x: String): String + +// CHECK: +// Mangled name: @0:0{0§}gk +// Public signature: /gk|9014869081681113059[0] +val T.gk: Function0 + // CHECK JVM_IR: + // Mangled name: #@0:0(){0§}kotlin.Function0<0:0> + // Public signature: /gk.|7271261295339366926[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@0:0(){0§} + // Public signature: /gk.|1726105423392935976[0] + get(): Function0 + +// CHECK: +// Mangled name: @0:0{0§}kt26531Val +// Public signature: /kt26531Val|-1273322007718616598[0] +val T.kt26531Val: Function0 + // CHECK JVM_IR: + // Mangled name: #@0:0(){0§}kotlin.Function0<0:0> + // Public signature: /kt26531Val.|5121802790804301435[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@0:0(){0§} + // Public signature: /kt26531Val.|-5027838736242807292[0] + get(): Function0 + diff --git a/compiler/testData/ir/irText/expressions/when.sig.kt.txt b/compiler/testData/ir/irText/expressions/when.sig.kt.txt new file mode 100644 index 00000000000..7310f6f1f88 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/when.sig.kt.txt @@ -0,0 +1,35 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +object A { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + private constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #test(kotlin.Any?){}kotlin.String +// Public signature: /test|3065596719711130696[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test(kotlin.Any?){} +// Public signature: /test|4942271194395271693[0] +fun test(x: Any?): String + +// CHECK JVM_IR: +// Mangled name: #testComma(kotlin.Int){}kotlin.String +// Public signature: /testComma|5053559742575177933[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testComma(kotlin.Int){} +// Public signature: /testComma|4186632876755351218[0] +fun testComma(x: Int): String + +// CHECK JVM_IR: +// Mangled name: #testWithSubject(kotlin.Any?){}kotlin.String +// Public signature: /testWithSubject|-4105857294025109172[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testWithSubject(kotlin.Any?){} +// Public signature: /testWithSubject|-5529846970111950585[0] +fun testWithSubject(x: Any?): String + diff --git a/compiler/testData/ir/irText/expressions/whenCoercedToUnit.sig.kt.txt b/compiler/testData/ir/irText/expressions/whenCoercedToUnit.sig.kt.txt new file mode 100644 index 00000000000..a0193880c4b --- /dev/null +++ b/compiler/testData/ir/irText/expressions/whenCoercedToUnit.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #foo(kotlin.Int){} +// Public signature: /foo|-104159190164110731[0] +fun foo(x: Int): Unit + diff --git a/compiler/testData/ir/irText/expressions/whenElse.sig.kt.txt b/compiler/testData/ir/irText/expressions/whenElse.sig.kt.txt new file mode 100644 index 00000000000..45f51d6c3af --- /dev/null +++ b/compiler/testData/ir/irText/expressions/whenElse.sig.kt.txt @@ -0,0 +1,8 @@ +// CHECK JVM_IR: +// Mangled name: #test(){}kotlin.Int +// Public signature: /test|4216975235718029399[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Int + diff --git a/compiler/testData/ir/irText/expressions/whenReturn.sig.kt.txt b/compiler/testData/ir/irText/expressions/whenReturn.sig.kt.txt new file mode 100644 index 00000000000..a912ac9d4f6 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/whenReturn.sig.kt.txt @@ -0,0 +1,8 @@ +// CHECK JVM_IR: +// Mangled name: #toString(kotlin.String){}kotlin.String +// Public signature: /toString|4425972968165869572[0] +// CHECK JS_IR NATIVE: +// Mangled name: #toString(kotlin.String){} +// Public signature: /toString|-3383991056988645668[0] +fun toString(grade: String): String + diff --git a/compiler/testData/ir/irText/expressions/whenReturnUnit.sig.kt.txt b/compiler/testData/ir/irText/expressions/whenReturnUnit.sig.kt.txt new file mode 100644 index 00000000000..db6c2b02c3d --- /dev/null +++ b/compiler/testData/ir/irText/expressions/whenReturnUnit.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #branch(kotlin.Int){} +// Public signature: /branch|-1878617393485869904[0] +fun branch(x: Int): Unit + +// CHECK: +// Mangled name: #run(kotlin.Function0){} +// Public signature: /run|-7851331300955833905[0] +fun run(block: Function0): Unit + diff --git a/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.kt b/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.kt index 9b6dea1c212..641362c9f33 100644 --- a/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.kt +++ b/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.kt @@ -1,6 +1,9 @@ // 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/expressions/whenSmartCastToEnum.sig.kt.txt b/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.sig.kt.txt new file mode 100644 index 00000000000..688c13fb51f --- /dev/null +++ b/compiler/testData/ir/irText/expressions/whenSmartCastToEnum.sig.kt.txt @@ -0,0 +1,122 @@ +// CHECK: +// Mangled name: En +// Public signature: /En|null[0] +enum class En : Enum { + // CHECK: + // Mangled name: En#(){} + // Public signature: /En.|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK: + // Mangled name: En.A + // Public signature: /En.A|null[0] + A + + // CHECK: + // Mangled name: En.B + // Public signature: /En.B|null[0] + B + + // CHECK: + // Mangled name: En.C + // Public signature: /En.C|null[0] + C + + // CHECK JVM_IR: + // Mangled name: En#valueOf#static(kotlin.String){}En + // Public signature: /En.valueOf|-1047188124757226812[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#valueOf#static(kotlin.String){} + // Public signature: /En.valueOf|-4683474617854611729[0] + fun valueOf(value: String): En + + // CHECK JVM_IR: + // Mangled name: En#values#static(){}kotlin.Array + // Public signature: /En.values|-6442868649398371099[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#values#static(){} + // Public signature: /En.values|-8715569000920726747[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: En#clone(){}kotlin.Any + // Public signature: /En.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#compareTo(En){} + // Public signature: /En.compareTo|3555292261046836181[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: En#compareTo(En){}kotlin.Int + // Public signature: /En.compareTo|7450321438177070471[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#equals(kotlin.Any?){} + // Public signature: /En.equals|4638265728071529943[0] + /* fake */ override operator fun compareTo(other: En): Int + + // CHECK JVM_IR: + // Mangled name: En#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /En.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#hashCode(){} + // Public signature: /En.hashCode|3409210261493131192[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: En#hashCode(){}kotlin.Int + // Public signature: /En.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#toString(){} + // Public signature: /En.toString|-1522858123163872138[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: En#toString(){}kotlin.String + // Public signature: /En.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: En#static{}entries + // Public signature: /En.entries|-5134227801081826149[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: En#static{}entries + // Public signature: /En.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: En##static(){}kotlin.enums.EnumEntries + // Public signature: /En.entries.|7832995474718587298[0] + // CHECK JS_IR NATIVE: + // Mangled name: En{}name + // Public signature: /En.name|4231860309499509769[0] + get(): EnumEntries + + // CHECK: + // Mangled name: En{}name + // Public signature: /En.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: En#(){}kotlin.String + // Public signature: /En.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: En{}ordinal + // Public signature: /En.ordinal|1912745122988592376[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: En{}ordinal + // Public signature: /En.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: En#(){}kotlin.Int + // Public signature: /En.ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: #test(){} + // Public signature: /test|6620506149988718649[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + diff --git a/compiler/testData/ir/irText/expressions/whenUnusedExpression.sig.kt.txt b/compiler/testData/ir/irText/expressions/whenUnusedExpression.sig.kt.txt new file mode 100644 index 00000000000..9ea622d15d0 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/whenUnusedExpression.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #test(kotlin.Boolean;kotlin.Int){} +// Public signature: /test|4952296091557857650[0] +fun test(b: Boolean, i: Int): Unit + diff --git a/compiler/testData/ir/irText/expressions/whenWithSubjectVariable.sig.kt.txt b/compiler/testData/ir/irText/expressions/whenWithSubjectVariable.sig.kt.txt new file mode 100644 index 00000000000..239cf395c9e --- /dev/null +++ b/compiler/testData/ir/irText/expressions/whenWithSubjectVariable.sig.kt.txt @@ -0,0 +1,16 @@ +// CHECK JVM_IR: +// Mangled name: #foo(){}kotlin.Any +// Public signature: /foo|-9059697968601777418[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo(){} +// Public signature: /foo|-1041209573719867811[0] +fun foo(): Any + +// CHECK JVM_IR: +// Mangled name: #test(){}kotlin.Int +// Public signature: /test|4216975235718029399[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Int + diff --git a/compiler/testData/ir/irText/expressions/whileDoWhile.sig.kt.txt b/compiler/testData/ir/irText/expressions/whileDoWhile.sig.kt.txt new file mode 100644 index 00000000000..ee4fa99a3e3 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/whileDoWhile.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + +// CHECK: +// Mangled name: #testSmartcastInCondition(){} +// Public signature: /testSmartcastInCondition|-5923754457814780223[0] +fun testSmartcastInCondition(): Unit + diff --git a/compiler/testData/ir/irText/firProblems/AbstractMutableMap.kt b/compiler/testData/ir/irText/firProblems/AbstractMutableMap.kt index dc89cacbad3..3a107ad62ae 100644 --- a/compiler/testData/ir/irText/firProblems/AbstractMutableMap.kt +++ b/compiler/testData/ir/irText/firProblems/AbstractMutableMap.kt @@ -3,6 +3,9 @@ // JVM_TARGET: 1.8 // TARGET_BACKEND: JVM_IR +// SKIP_SIGNATURE_DUMP +// ^ Value parameters in fake overrides generated by K1 and K2 are different + class MyMap : AbstractMutableMap() { override fun put(key: K, value: V): V? = null diff --git a/compiler/testData/ir/irText/firProblems/AllCandidates.kt b/compiler/testData/ir/irText/firProblems/AllCandidates.kt index c8e9c53d15b..946305cb8db 100644 --- a/compiler/testData/ir/irText/firProblems/AllCandidates.kt +++ b/compiler/testData/ir/irText/firProblems/AllCandidates.kt @@ -1,6 +1,10 @@ // TARGET_BACKEND: JVM // WITH_STDLIB // FULL_JDK + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57778 + // FILE: OverloadResolutionResultsImpl.java import java.util.*; diff --git a/compiler/testData/ir/irText/firProblems/AllCandidates.sig.kt.txt b/compiler/testData/ir/irText/firProblems/AllCandidates.sig.kt.txt new file mode 100644 index 00000000000..8de0865a332 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/AllCandidates.sig.kt.txt @@ -0,0 +1,36 @@ +// CHECK: +// Mangled name: MyCandidate +// Public signature: /MyCandidate|null[0] +class MyCandidate { + // CHECK: + // Mangled name: MyCandidate{}resolvedCall + // Public signature: /MyCandidate.resolvedCall|-2429780263902948392[0] + val resolvedCall: ResolvedCall<*> + // CHECK JVM_IR: + // Mangled name: MyCandidate#(){}ResolvedCall<*> + // Public signature: /MyCandidate.resolvedCall.|2961495013206965605[0] + get + + // CHECK: + // Mangled name: MyCandidate#(ResolvedCall<*>){} + // Public signature: /MyCandidate.|-1587603405695784398[0] + constructor(resolvedCall: ResolvedCall<*>) /* primary */ + +} + +// CHECK: +// Mangled name: ResolvedCall +// Public signature: /ResolvedCall|null[0] +class ResolvedCall { + // CHECK: + // Mangled name: ResolvedCall#(){} + // Public signature: /ResolvedCall.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #allCandidatesResult(kotlin.collections.Collection){0§}OverloadResolutionResultsImpl<0:0?>? +// Public signature: [ File 'AllCandidates.kt' <- /allCandidatesResult|-4417746287859138452[0] ] +private fun allCandidatesResult(allCandidates: Collection): OverloadResolutionResultsImpl? + diff --git a/compiler/testData/ir/irText/firProblems/AnnotationInAnnotation.sig.kt.txt b/compiler/testData/ir/irText/firProblems/AnnotationInAnnotation.sig.kt.txt new file mode 100644 index 00000000000..8aefdbdaef8 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/AnnotationInAnnotation.sig.kt.txt @@ -0,0 +1,61 @@ +// CHECK: +// Mangled name: State +// Public signature: /State|null[0] +open annotation class State : Annotation { + // CHECK: + // Mangled name: State{}name + // Public signature: /State.name|4231860309499509769[0] + val name: String + // CHECK JVM_IR: + // Mangled name: State#(){}kotlin.String + // Public signature: /State.name.|-8006111524522882650[0] + get + + // CHECK: + // Mangled name: State{}storages + // Public signature: /State.storages|6878252279913860320[0] + val storages: Array + // CHECK JVM_IR: + // Mangled name: State#(){}kotlin.Array + // Public signature: /State.storages.|3736036355422962101[0] + get + + // CHECK: + // Mangled name: State#(kotlin.String;kotlin.Array){} + // Public signature: /State.|-8165230928430738910[0] + constructor(name: String, storages: Array) /* primary */ + +} + +// CHECK: +// Mangled name: Storage +// Public signature: /Storage|null[0] +open annotation class Storage : Annotation { + // CHECK: + // Mangled name: Storage{}value + // Public signature: /Storage.value|1987073854177347439[0] + val value: String + // CHECK JVM_IR: + // Mangled name: Storage#(){}kotlin.String + // Public signature: /Storage.value.|-7202092821145242726[0] + get + + // CHECK: + // Mangled name: Storage#(kotlin.String){} + // Public signature: /Storage.|1280618353163213788[0] + constructor(value: String) /* primary */ + +} + +// CHECK: +// Mangled name: Test +// Public signature: /Test|null[0] +@State(name = "1", storages = [Storage(value = "HELLO")]) +class Test { + // CHECK: + // Mangled name: Test#(){} + // Public signature: /Test.|-5645683436151566731[0] + constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/firProblems/AnnotationLoader.sig.kt.txt b/compiler/testData/ir/irText/firProblems/AnnotationLoader.sig.kt.txt new file mode 100644 index 00000000000..bd571b31f78 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/AnnotationLoader.sig.kt.txt @@ -0,0 +1,47 @@ +// CHECK: +// Mangled name: AnnotationLoader +// Public signature: /AnnotationLoader|null[0] +class AnnotationLoader { + // CHECK: + // Mangled name: AnnotationLoader#(){} + // Public signature: /AnnotationLoader.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: AnnotationLoader#loadAnnotation(){}Visitor? + // Public signature: /AnnotationLoader.loadAnnotation|-7081476927485882760[0] + // CHECK JS_IR NATIVE: + // Mangled name: AnnotationLoader#loadAnnotation(){} + // Public signature: /AnnotationLoader.loadAnnotation|-6649617337478670271[0] + fun loadAnnotation(): Visitor? + +} + +// CHECK: +// Mangled name: Visitor +// Public signature: /Visitor|null[0] +interface Visitor { + + // CHECK: + // Mangled name: Visitor#visit(){} + // Public signature: /Visitor.visit|-7531698844362190050[0] + abstract fun visit(): Unit + + // CHECK JVM_IR: + // Mangled name: Visitor#visitAnnotation(){}Visitor? + // Public signature: /Visitor.visitAnnotation|-8142708510940079695[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visitor#visitAnnotation(){} + // Public signature: /Visitor.visitAnnotation|4794980067153158180[0] + fun visitAnnotation(): Visitor? + + // CHECK JVM_IR: + // Mangled name: Visitor#visitArray(){}Visitor? + // Public signature: /Visitor.visitArray|-7483008353702058436[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visitor#visitArray(){} + // Public signature: /Visitor.visitArray|-4548341020158450010[0] + fun visitArray(): Visitor? + +} + diff --git a/compiler/testData/ir/irText/firProblems/AnonymousAsReturnOfGenericFunction.kt b/compiler/testData/ir/irText/firProblems/AnonymousAsReturnOfGenericFunction.kt index 26f5a8401b6..57f2190928f 100644 --- a/compiler/testData/ir/irText/firProblems/AnonymousAsReturnOfGenericFunction.kt +++ b/compiler/testData/ir/irText/firProblems/AnonymousAsReturnOfGenericFunction.kt @@ -1,4 +1,9 @@ // FIR_IDENTICAL +// DUMP_LOCAL_DECLARATION_SIGNATURES + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57430, KT-57778 + interface NestedGroupFragment private fun addMavenOptionsGroupFragment() = addOptionsGroup() diff --git a/compiler/testData/ir/irText/firProblems/AnonymousAsReturnOfGenericFunction.sig.kt.txt b/compiler/testData/ir/irText/firProblems/AnonymousAsReturnOfGenericFunction.sig.kt.txt new file mode 100644 index 00000000000..361e60e9833 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/AnonymousAsReturnOfGenericFunction.sig.kt.txt @@ -0,0 +1,33 @@ +// CHECK: +// Mangled name: NestedGroupFragment +// Public signature: /NestedGroupFragment|null[0] +interface NestedGroupFragment { + +} + +// CHECK JVM_IR: +// Mangled name: #addMavenOptionsGroupFragment(){}#addOptionsGroup. +// Public signature: [ File 'AnonymousAsReturnOfGenericFunction.kt' <- /addMavenOptionsGroupFragment|1068646653174639665[0] ] +// CHECK JS_IR NATIVE: +// Mangled name: #addMavenOptionsGroupFragment(){} +private fun addMavenOptionsGroupFragment(): + +// CHECK JVM_IR: +// Mangled name: #addOptionsGroup(){0§}#addOptionsGroup.<0:0> +// Public signature: [ File 'AnonymousAsReturnOfGenericFunction.kt' <- /addOptionsGroup|1295014906395670038[0] ] +// CHECK JS_IR NATIVE: +// Mangled name: #addOptionsGroup(){0§} +private fun addOptionsGroup(): + // CHECK JVM_IR: + // Mangled name: #addOptionsGroup(){0§}#addOptionsGroup.<1:0>. + // CHECK JS_IR NATIVE: + // Mangled name: #addOptionsGroup(){0§}. + local class : NestedGroupFragment { + // CHECK JVM_IR: + // Mangled name: #addOptionsGroup(){0§}#addOptionsGroup.<2:0>.#(){} + // CHECK JS_IR NATIVE: + // Mangled name: #addOptionsGroup(){0§}.#(){} + constructor() /* primary */ + + } + diff --git a/compiler/testData/ir/irText/firProblems/ArrayListOverrides.kt b/compiler/testData/ir/irText/firProblems/ArrayListOverrides.kt index beea1023d53..62893e47648 100644 --- a/compiler/testData/ir/irText/firProblems/ArrayListOverrides.kt +++ b/compiler/testData/ir/irText/firProblems/ArrayListOverrides.kt @@ -2,6 +2,9 @@ // SKIP_KLIB_TEST // TARGET_BACKEND: JVM_IR +// SKIP_SIGNATURE_DUMP +// ^ Value parameters in fake overrides generated by K1 and K2 are different + class A1 : java.util.ArrayList() class A2 : java.util.ArrayList() { diff --git a/compiler/testData/ir/irText/firProblems/ArrayMap.kt b/compiler/testData/ir/irText/firProblems/ArrayMap.kt index 55955fb3e10..35ee41d36c9 100644 --- a/compiler/testData/ir/irText/firProblems/ArrayMap.kt +++ b/compiler/testData/ir/irText/firProblems/ArrayMap.kt @@ -3,6 +3,9 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429 + sealed class ArrayMap : Iterable { abstract val size: Int diff --git a/compiler/testData/ir/irText/firProblems/ArrayMap.sig.kt.txt b/compiler/testData/ir/irText/firProblems/ArrayMap.sig.kt.txt new file mode 100644 index 00000000000..9330f5dbcbd --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/ArrayMap.sig.kt.txt @@ -0,0 +1,407 @@ +// CHECK: +// Mangled name: ArrayMap +// Public signature: /ArrayMap|null[0] +sealed class ArrayMap : Iterable { + // CHECK: + // Mangled name: ArrayMap#(){} + // Public signature: /ArrayMap.|-5645683436151566731[0] + protected constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: ArrayMap#iterator(){}kotlin.collections.Iterator<1:0> + // Public signature: /ArrayMap.iterator|6283263045548554825[0] + // CHECK JS_IR NATIVE: + // Mangled name: ArrayMap#iterator(){} + // Public signature: /ArrayMap.iterator|8062689420742628886[0] + abstract /* fake */ override operator fun iterator(): Iterator + + // CHECK JVM_IR: + // Mangled name: ArrayMap#copy(){}ArrayMap<1:0> + // Public signature: /ArrayMap.copy|547614334273986924[0] + // CHECK JS_IR NATIVE: + // Mangled name: ArrayMap#copy(){} + // Public signature: /ArrayMap.copy|2165055706622424950[0] + abstract fun copy(): ArrayMap + + // CHECK JVM_IR: + // Mangled name: ArrayMap#get(kotlin.Int){}1:0? + // Public signature: /ArrayMap.get|7872141219897475972[0] + // CHECK JS_IR NATIVE: + // Mangled name: ArrayMap#get(kotlin.Int){} + // Public signature: /ArrayMap.get|-1406503945102116889[0] + abstract operator fun get(index: Int): T? + + // CHECK: + // Mangled name: ArrayMap#set(kotlin.Int;1:0){} + // Public signature: /ArrayMap.set|366827667513302185[0] + abstract operator fun set(index: Int, value: T): Unit + + // CHECK: + // Mangled name: ArrayMap{}size + // Public signature: /ArrayMap.size|-6253659984320132064[0] + abstract val size: Int + // CHECK JVM_IR: + // Mangled name: ArrayMap#(){}kotlin.Int + // Public signature: /ArrayMap.size.|-3941649985161900780[0] + // CHECK JS_IR NATIVE: + // Mangled name: ArrayMap#(){} + // Public signature: /ArrayMap.size.|-8255337774232345969[0] + abstract get + +} + +// CHECK: +// Mangled name: ArrayMapImpl +// Public signature: /ArrayMapImpl|null[0] +internal class ArrayMapImpl : ArrayMap { + // CHECK: + // Mangled name: ArrayMapImpl{}data + // Public signature: /ArrayMapImpl.data|4273011692695536650[0] + private var data: Array + // CHECK JVM_IR: + // Mangled name: ArrayMapImpl#(){}kotlin.Array + // Public signature: /ArrayMapImpl.data.|5490366642916416835[0] + // CHECK JS_IR NATIVE: + // Mangled name: ArrayMapImpl#(){} + // Public signature: /ArrayMapImpl.data.|1739072241679156117[0] + private get + // CHECK: + // Mangled name: ArrayMapImpl#(kotlin.Array){} + // Public signature: /ArrayMapImpl.data.|1302271608139098175[0] + private set + + // CHECK: + // Mangled name: ArrayMapImpl{}size + // Public signature: /ArrayMapImpl.size|-6253659984320132064[0] + override var size: Int + // CHECK JVM_IR: + // Mangled name: ArrayMapImpl#(){}kotlin.Int + // Public signature: /ArrayMapImpl.size.|-3941649985161900780[0] + // CHECK JS_IR NATIVE: + // Mangled name: ArrayMapImpl#(){} + // Public signature: /ArrayMapImpl.size.|-8255337774232345969[0] + override get + // CHECK: + // Mangled name: ArrayMapImpl#(kotlin.Int){} + // Public signature: /ArrayMapImpl.size.|3088904159210893297[0] + private open set + + // CHECK: + // Mangled name: ArrayMapImpl.Entry + // Public signature: /ArrayMapImpl.Entry|null[0] + data class Entry : Entry { + // CHECK: + // Mangled name: ArrayMapImpl.Entry{}key + // Public signature: /ArrayMapImpl.Entry.key|1144547298251177939[0] + override val key: Int + // CHECK JVM_IR: + // Mangled name: ArrayMapImpl.Entry#(){}kotlin.Int + // Public signature: /ArrayMapImpl.Entry.key.|-7928552352363699078[0] + // CHECK JS_IR NATIVE: + // Mangled name: ArrayMapImpl.Entry#(){} + // Public signature: /ArrayMapImpl.Entry.key.|1208603132254675950[0] + override get + + // CHECK: + // Mangled name: ArrayMapImpl.Entry{}value + // Public signature: /ArrayMapImpl.Entry.value|1987073854177347439[0] + override val value: T + // CHECK JVM_IR: + // Mangled name: ArrayMapImpl.Entry#(){}1:0 + // Public signature: /ArrayMapImpl.Entry.value.|3167862337988859752[0] + // CHECK JS_IR NATIVE: + // Mangled name: ArrayMapImpl.Entry#(){} + // Public signature: /ArrayMapImpl.Entry.value.|3260093555963109437[0] + override get + + // CHECK: + // Mangled name: ArrayMapImpl.Entry#(kotlin.Int;1:0){} + // Public signature: /ArrayMapImpl.Entry.|437318787564761214[0] + constructor(key: Int, value: T) /* primary */ + // CHECK JVM_IR: + // Mangled name: ArrayMapImpl.Entry#component1(){}kotlin.Int + // Public signature: /ArrayMapImpl.Entry.component1|-8217597213800111288[0] + // CHECK JS_IR NATIVE: + // Mangled name: ArrayMapImpl.Entry#component1(){} + // Public signature: /ArrayMapImpl.Entry.component1|162597135895221648[0] + operator fun component1(): Int + + // CHECK JVM_IR: + // Mangled name: ArrayMapImpl.Entry#component2(){}1:0 + // Public signature: /ArrayMapImpl.Entry.component2|15991383605318669[0] + // CHECK JS_IR NATIVE: + // Mangled name: ArrayMapImpl.Entry#component2(){} + // Public signature: /ArrayMapImpl.Entry.component2|3796717572321500973[0] + operator fun component2(): T + + // CHECK JVM_IR: + // Mangled name: ArrayMapImpl.Entry#copy(kotlin.Int;1:0){}ArrayMapImpl.Entry<1:0> + // Public signature: /ArrayMapImpl.Entry.copy|-2005463288207303075[0] + // CHECK JS_IR NATIVE: + // Mangled name: ArrayMapImpl.Entry#copy(kotlin.Int;1:0){} + // Public signature: /ArrayMapImpl.Entry.copy|4234458596034602341[0] + fun copy(key: Int, value: T): Entry + + // CHECK JVM_IR: + // Mangled name: ArrayMapImpl.Entry#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /ArrayMapImpl.Entry.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: ArrayMapImpl.Entry#equals(kotlin.Any?){} + // Public signature: /ArrayMapImpl.Entry.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: ArrayMapImpl.Entry#hashCode(){}kotlin.Int + // Public signature: /ArrayMapImpl.Entry.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: ArrayMapImpl.Entry#hashCode(){} + // Public signature: /ArrayMapImpl.Entry.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: ArrayMapImpl.Entry#toString(){}kotlin.String + // Public signature: /ArrayMapImpl.Entry.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: ArrayMapImpl.Entry#toString(){} + // Public signature: /ArrayMapImpl.Entry.toString|-1522858123163872138[0] + override fun toString(): String + + } + + // CHECK: + // Mangled name: ArrayMapImpl.Companion + // Public signature: /ArrayMapImpl.Companion|null[0] + companion object Companion { + // CHECK: + // Mangled name: ArrayMapImpl.Companion#(){} + // Public signature: /ArrayMapImpl.Companion.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK: + // Mangled name: ArrayMapImpl.Companion{}DEFAULT_SIZE + // Public signature: /ArrayMapImpl.Companion.DEFAULT_SIZE|-2519126992484260687[0] + private const val DEFAULT_SIZE: Int + // CHECK JVM_IR: + // Mangled name: ArrayMapImpl.Companion#(){}kotlin.Int + // Public signature: /ArrayMapImpl.Companion.DEFAULT_SIZE.|-825092515895884543[0] + // CHECK JS_IR NATIVE: + // Mangled name: ArrayMapImpl.Companion#(){} + // Public signature: /ArrayMapImpl.Companion.DEFAULT_SIZE.|4238718331414410587[0] + private get + + // CHECK: + // Mangled name: ArrayMapImpl.Companion{}INCREASE_K + // Public signature: /ArrayMapImpl.Companion.INCREASE_K|7964000577208016171[0] + private const val INCREASE_K: Int + // CHECK JVM_IR: + // Mangled name: ArrayMapImpl.Companion#(){}kotlin.Int + // Public signature: /ArrayMapImpl.Companion.INCREASE_K.|-381728285012206517[0] + // CHECK JS_IR NATIVE: + // Mangled name: ArrayMapImpl.Companion#(){} + // Public signature: /ArrayMapImpl.Companion.INCREASE_K.|-8039715070655458049[0] + private get + + } + + // CHECK: + // Mangled name: ArrayMapImpl#(kotlin.Array){} + // Public signature: /ArrayMapImpl.|-940489726603364367[0] + private constructor(data: Array) /* primary */ + // CHECK: + // Mangled name: ArrayMapImpl#(){} + // Public signature: /ArrayMapImpl.|-5645683436151566731[0] + constructor() + + // CHECK JVM_IR: + // Mangled name: ArrayMapImpl#copy(){}ArrayMap<1:0> + // Public signature: /ArrayMapImpl.copy|547614334273986924[0] + // CHECK JS_IR NATIVE: + // Mangled name: ArrayMapImpl#copy(){} + // Public signature: /ArrayMapImpl.copy|2165055706622424950[0] + override fun copy(): ArrayMap + + // CHECK: + // Mangled name: ArrayMapImpl#ensureCapacity(kotlin.Int){} + // Public signature: /ArrayMapImpl.ensureCapacity|-7913402150632352615[0] + private fun ensureCapacity(index: Int): Unit + + // CHECK JVM_IR: + // Mangled name: ArrayMapImpl#entries(){}kotlin.collections.List> + // Public signature: /ArrayMapImpl.entries|-1049561237604241333[0] + // CHECK JS_IR NATIVE: + // Mangled name: ArrayMapImpl#entries(){} + // Public signature: /ArrayMapImpl.entries|-2912856062162906895[0] + fun entries(): List> + + // CHECK JVM_IR: + // Mangled name: ArrayMapImpl#get(kotlin.Int){}1:0? + // Public signature: /ArrayMapImpl.get|7872141219897475972[0] + // CHECK JS_IR NATIVE: + // Mangled name: ArrayMapImpl#get(kotlin.Int){} + // Public signature: /ArrayMapImpl.get|-1406503945102116889[0] + override operator fun get(index: Int): T? + + // CHECK JVM_IR: + // Mangled name: ArrayMapImpl#iterator(){}kotlin.collections.Iterator<1:0> + // Public signature: /ArrayMapImpl.iterator|6283263045548554825[0] + // CHECK JS_IR NATIVE: + // Mangled name: ArrayMapImpl#iterator(){} + // Public signature: /ArrayMapImpl.iterator|8062689420742628886[0] + override operator fun iterator(): Iterator + + // CHECK: + // Mangled name: ArrayMapImpl#remove(kotlin.Int){} + // Public signature: /ArrayMapImpl.remove|-6905763659499399195[0] + fun remove(index: Int): Unit + + // CHECK: + // Mangled name: ArrayMapImpl#set(kotlin.Int;1:0){} + // Public signature: /ArrayMapImpl.set|366827667513302185[0] + override operator fun set(index: Int, value: T): Unit + +} + +// CHECK: +// Mangled name: OneElementArrayMap +// Public signature: /OneElementArrayMap|null[0] +internal class OneElementArrayMap : ArrayMap { + // CHECK: + // Mangled name: OneElementArrayMap{}value + // Public signature: /OneElementArrayMap.value|1987073854177347439[0] + val value: T + // CHECK JVM_IR: + // Mangled name: OneElementArrayMap#(){}1:0 + // Public signature: /OneElementArrayMap.value.|3167862337988859752[0] + // CHECK JS_IR NATIVE: + // Mangled name: OneElementArrayMap#(){} + // Public signature: /OneElementArrayMap.value.|3260093555963109437[0] + get + + // CHECK: + // Mangled name: OneElementArrayMap{}index + // Public signature: /OneElementArrayMap.index|-7442989064208524072[0] + val index: Int + // CHECK JVM_IR: + // Mangled name: OneElementArrayMap#(){}kotlin.Int + // Public signature: /OneElementArrayMap.index.|-8397313606796909404[0] + // CHECK JS_IR NATIVE: + // Mangled name: OneElementArrayMap#(){} + // Public signature: /OneElementArrayMap.index.|-1266836019908630770[0] + get + + // CHECK: + // Mangled name: OneElementArrayMap#(1:0;kotlin.Int){} + // Public signature: /OneElementArrayMap.|7281397193015694517[0] + constructor(value: T, index: Int) /* primary */ + + // CHECK JVM_IR: + // Mangled name: OneElementArrayMap#copy(){}ArrayMap<1:0> + // Public signature: /OneElementArrayMap.copy|547614334273986924[0] + // CHECK JS_IR NATIVE: + // Mangled name: OneElementArrayMap#copy(){} + // Public signature: /OneElementArrayMap.copy|2165055706622424950[0] + override fun copy(): ArrayMap + + // CHECK JVM_IR: + // Mangled name: OneElementArrayMap#get(kotlin.Int){}1:0? + // Public signature: /OneElementArrayMap.get|7872141219897475972[0] + // CHECK JS_IR NATIVE: + // Mangled name: OneElementArrayMap#get(kotlin.Int){} + // Public signature: /OneElementArrayMap.get|-1406503945102116889[0] + override operator fun get(index: Int): T? + + // CHECK JVM_IR: + // Mangled name: OneElementArrayMap#iterator(){}kotlin.collections.Iterator<1:0> + // Public signature: /OneElementArrayMap.iterator|6283263045548554825[0] + // CHECK JS_IR NATIVE: + // Mangled name: OneElementArrayMap#iterator(){} + // Public signature: /OneElementArrayMap.iterator|8062689420742628886[0] + override operator fun iterator(): Iterator + + // CHECK: + // Mangled name: OneElementArrayMap#set(kotlin.Int;1:0){} + // Public signature: /OneElementArrayMap.set|366827667513302185[0] + override operator fun set(index: Int, value: T): Unit + + // CHECK: + // Mangled name: OneElementArrayMap{}size + // Public signature: /OneElementArrayMap.size|-6253659984320132064[0] + override val size: Int + // CHECK JVM_IR: + // Mangled name: OneElementArrayMap#(){}kotlin.Int + // Public signature: /OneElementArrayMap.size.|-3941649985161900780[0] + // CHECK JS_IR NATIVE: + // Mangled name: OneElementArrayMap#(){} + // Public signature: /OneElementArrayMap.size.|-8255337774232345969[0] + override get(): Int + +} + +// CHECK: +// Mangled name: EmptyArrayMap +// Public signature: /EmptyArrayMap|null[0] +internal object EmptyArrayMap : ArrayMap { + // CHECK: + // Mangled name: EmptyArrayMap#(){} + // Public signature: /EmptyArrayMap.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: EmptyArrayMap#copy(){}ArrayMap + // Public signature: /EmptyArrayMap.copy|-4610758081204118207[0] + // CHECK JS_IR NATIVE: + // Mangled name: EmptyArrayMap#copy(){} + // Public signature: /EmptyArrayMap.copy|2165055706622424950[0] + override fun copy(): ArrayMap + + // CHECK JVM_IR: + // Mangled name: EmptyArrayMap#get(kotlin.Int){}kotlin.Nothing? + // Public signature: /EmptyArrayMap.get|-5899437872230381284[0] + // CHECK JS_IR NATIVE: + // Mangled name: EmptyArrayMap#get(kotlin.Int){} + // Public signature: /EmptyArrayMap.get|-1406503945102116889[0] + override operator fun get(index: Int): Nothing? + + // CHECK JVM_IR: + // Mangled name: EmptyArrayMap#iterator(){}kotlin.collections.Iterator + // Public signature: /EmptyArrayMap.iterator|5538760664730176758[0] + // CHECK JS_IR NATIVE: + // Mangled name: EmptyArrayMap#iterator(){} + // Public signature: /EmptyArrayMap.iterator|8062689420742628886[0] + override operator fun iterator(): Iterator + + // CHECK: + // Mangled name: EmptyArrayMap#set(kotlin.Int;kotlin.Nothing){} + // Public signature: /EmptyArrayMap.set|-6638106378891901866[0] + override operator fun set(index: Int, value: Nothing): Unit + + // CHECK: + // Mangled name: EmptyArrayMap{}size + // Public signature: /EmptyArrayMap.size|-6253659984320132064[0] + override val size: Int + // CHECK JVM_IR: + // Mangled name: EmptyArrayMap#(){}kotlin.Int + // Public signature: /EmptyArrayMap.size.|-3941649985161900780[0] + // CHECK JS_IR NATIVE: + // Mangled name: EmptyArrayMap#(){} + // Public signature: /EmptyArrayMap.size.|-8255337774232345969[0] + override get(): Int + +} + +// CHECK JVM_IR: +// Mangled name: #isEmpty@ArrayMap<*>(){}kotlin.Boolean +// Public signature: /isEmpty|-1737302757312965016[0] +// CHECK JS_IR NATIVE: +// Mangled name: #isEmpty@ArrayMap<*>(){} +// Public signature: /isEmpty|-8159164810895607055[0] +fun ArrayMap<*>.isEmpty(): Boolean + +// CHECK JVM_IR: +// Mangled name: #isNotEmpty@ArrayMap<*>(){}kotlin.Boolean +// Public signature: /isNotEmpty|-1968768410773210268[0] +// CHECK JS_IR NATIVE: +// Mangled name: #isNotEmpty@ArrayMap<*>(){} +// Public signature: /isNotEmpty|4886925442264610807[0] +fun ArrayMap<*>.isNotEmpty(): Boolean + diff --git a/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.kt b/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.kt index ca44a889099..5df97a5b302 100644 --- a/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.kt +++ b/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.kt @@ -2,6 +2,9 @@ // FULL_JDK // WITH_STDLIB +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429 + import java.lang.reflect.Type interface ComponentContainer diff --git a/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.sig.kt.txt b/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.sig.kt.txt new file mode 100644 index 00000000000..78fd63ce738 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.sig.kt.txt @@ -0,0 +1,84 @@ +// CHECK: +// Mangled name: {}registrationMap +// Public signature: [ File 'ClashResolutionDescriptor.kt' <- /registrationMap|8184441143918876435[0] ] +private val registrationMap: HashMap + // CHECK JVM_IR: + // Mangled name: #(){}java.util.HashMap + // Public signature: [ File 'ClashResolutionDescriptor.kt' <- /registrationMap.|3119298927482099509[0] ] + private get + +// CHECK: +// Mangled name: ClashResolutionDescriptor +// Public signature: /ClashResolutionDescriptor|null[0] +class ClashResolutionDescriptor> { + // CHECK: + // Mangled name: ClashResolutionDescriptor{}resolver + // Public signature: /ClashResolutionDescriptor.resolver|8912854618409758647[0] + private val resolver: PlatformExtensionsClashResolver + // CHECK JVM_IR: + // Mangled name: ClashResolutionDescriptor#(){}PlatformExtensionsClashResolver<1:0> + // Public signature: /ClashResolutionDescriptor.resolver.|3490691458597764818[0] + private get + + // CHECK: + // Mangled name: ClashResolutionDescriptor{}clashedComponents + // Public signature: /ClashResolutionDescriptor.clashedComponents|1468680588633000446[0] + private val clashedComponents: List + // CHECK JVM_IR: + // Mangled name: ClashResolutionDescriptor#(){}kotlin.collections.List + // Public signature: /ClashResolutionDescriptor.clashedComponents.|-246985097775886667[0] + private get + + // CHECK: + // Mangled name: ClashResolutionDescriptor#(ComponentContainer;PlatformExtensionsClashResolver<1:0>;kotlin.collections.List){} + // Public signature: /ClashResolutionDescriptor.|5507710378195680379[0] + constructor(container: ComponentContainer, resolver: PlatformExtensionsClashResolver, clashedComponents: List) /* primary */ + +} + +// CHECK: +// Mangled name: PlatformExtensionsClashResolver +// Public signature: /PlatformExtensionsClashResolver|null[0] +abstract class PlatformExtensionsClashResolver> { + // CHECK: + // Mangled name: PlatformExtensionsClashResolver{}applicableTo + // Public signature: /PlatformExtensionsClashResolver.applicableTo|6029537505993816165[0] + val applicableTo: Class + // CHECK JVM_IR: + // Mangled name: PlatformExtensionsClashResolver#(){}java.lang.Class<1:0> + // Public signature: /PlatformExtensionsClashResolver.applicableTo.|7304285895281171874[0] + get + + // CHECK: + // Mangled name: PlatformExtensionsClashResolver#(java.lang.Class<1:0>){} + // Public signature: /PlatformExtensionsClashResolver.|5119314677210520097[0] + constructor(applicableTo: Class) /* primary */ + +} + +// CHECK: +// Mangled name: ComponentContainer +// Public signature: /ComponentContainer|null[0] +interface ComponentContainer { + +} + +// CHECK: +// Mangled name: ComponentDescriptor +// Public signature: /ComponentDescriptor|null[0] +interface ComponentDescriptor { + +} + +// CHECK: +// Mangled name: PlatformSpecificExtension +// Public signature: /PlatformSpecificExtension|null[0] +interface PlatformSpecificExtension> { + +} + +// CHECK: +// Mangled name: #resolveClashesIfAny(ComponentContainer;kotlin.collections.List>){} +// Public signature: /resolveClashesIfAny|1954676013070349118[0] +fun resolveClashesIfAny(container: ComponentContainer, clashResolvers: List>): Unit + diff --git a/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.sig.kt.txt b/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.sig.kt.txt new file mode 100644 index 00000000000..5d1b596c462 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.sig.kt.txt @@ -0,0 +1,132 @@ +// CHECK: +// Mangled name: DeepCopyIrTreeWithSymbols +// Public signature: /DeepCopyIrTreeWithSymbols|null[0] +class DeepCopyIrTreeWithSymbols { + // CHECK: + // Mangled name: DeepCopyIrTreeWithSymbols{}typeRemapper + // Public signature: /DeepCopyIrTreeWithSymbols.typeRemapper|4793044681928918608[0] + private val typeRemapper: TypeRemapper + // CHECK JVM_IR: + // Mangled name: DeepCopyIrTreeWithSymbols#(){}TypeRemapper + // Public signature: /DeepCopyIrTreeWithSymbols.typeRemapper.|5098073462906324888[0] + // CHECK JS_IR NATIVE: + // Mangled name: DeepCopyIrTreeWithSymbols#(){} + // Public signature: /DeepCopyIrTreeWithSymbols.typeRemapper.|-798235115100843732[0] + private get + + // CHECK: + // Mangled name: DeepCopyIrTreeWithSymbols#(TypeRemapper){} + // Public signature: /DeepCopyIrTreeWithSymbols.|1455758733659253884[0] + constructor(typeRemapper: TypeRemapper) /* primary */ + + // CHECK JVM_IR: + // Mangled name: DeepCopyIrTreeWithSymbols#copyTypeParameter(IrTypeParameter){}IrTypeParameter + // Public signature: /DeepCopyIrTreeWithSymbols.copyTypeParameter|3854275171797584519[0] + // CHECK JS_IR NATIVE: + // Mangled name: DeepCopyIrTreeWithSymbols#copyTypeParameter(IrTypeParameter){} + // Public signature: /DeepCopyIrTreeWithSymbols.copyTypeParameter|-4022519238744481010[0] + private fun copyTypeParameter(declaration: IrTypeParameter): IrTypeParameter + + // CHECK: + // Mangled name: DeepCopyIrTreeWithSymbols#copyTypeParametersFrom@IrTypeParametersContainer(IrTypeParametersContainer){} + // Public signature: /DeepCopyIrTreeWithSymbols.copyTypeParametersFrom|2148396968414493997[0] + fun IrTypeParametersContainer.copyTypeParametersFrom(other: IrTypeParametersContainer): Unit + +} + +// CHECK: +// Mangled name: IrDeclaration +// Public signature: /IrDeclaration|null[0] +interface IrDeclaration { + +} + +// CHECK: +// Mangled name: IrDeclarationParent +// Public signature: /IrDeclarationParent|null[0] +interface IrDeclarationParent { + +} + +// CHECK: +// Mangled name: IrType +// Public signature: /IrType|null[0] +interface IrType { + +} + +// CHECK: +// Mangled name: IrTypeParameter +// Public signature: /IrTypeParameter|null[0] +interface IrTypeParameter : IrDeclaration { + + // CHECK: + // Mangled name: IrTypeParameter{}superTypes + // Public signature: /IrTypeParameter.superTypes|4746750561425700979[0] + abstract val superTypes: MutableList + // CHECK JVM_IR: + // Mangled name: IrTypeParameter#(){}kotlin.collections.MutableList + // Public signature: /IrTypeParameter.superTypes.|-6696770425648193325[0] + // CHECK JS_IR NATIVE: + // Mangled name: IrTypeParameter#(){} + // Public signature: /IrTypeParameter.superTypes.|3059481600436183874[0] + abstract get + +} + +// CHECK: +// Mangled name: IrTypeParametersContainer +// Public signature: /IrTypeParametersContainer|null[0] +interface IrTypeParametersContainer : IrDeclaration, IrDeclarationParent { + + // CHECK: + // Mangled name: IrTypeParametersContainer{}typeParameters + // Public signature: /IrTypeParametersContainer.typeParameters|551746886075737521[0] + abstract var typeParameters: List + // CHECK JVM_IR: + // Mangled name: IrTypeParametersContainer#(){}kotlin.collections.List + // Public signature: /IrTypeParametersContainer.typeParameters.|6508048225555086161[0] + // CHECK JS_IR NATIVE: + // Mangled name: IrTypeParametersContainer#(){} + // Public signature: /IrTypeParametersContainer.typeParameters.|4309431784881504663[0] + abstract get + // CHECK: + // Mangled name: IrTypeParametersContainer#(kotlin.collections.List){} + // Public signature: /IrTypeParametersContainer.typeParameters.|-1608351996457643427[0] + abstract set + +} + +// CHECK: +// Mangled name: TypeRemapper +// Public signature: /TypeRemapper|null[0] +interface TypeRemapper { + + // CHECK: + // Mangled name: TypeRemapper#enterScope(IrTypeParametersContainer){} + // Public signature: /TypeRemapper.enterScope|1651098445614641728[0] + abstract fun enterScope(irTypeParametersContainer: IrTypeParametersContainer): Unit + + // CHECK: + // Mangled name: TypeRemapper#leaveScope(){} + // Public signature: /TypeRemapper.leaveScope|-4405470612310357271[0] + abstract fun leaveScope(): Unit + + // CHECK JVM_IR: + // Mangled name: TypeRemapper#remapType(IrType){}IrType + // Public signature: /TypeRemapper.remapType|-9004737899985615010[0] + // CHECK JS_IR NATIVE: + // Mangled name: TypeRemapper#remapType(IrType){} + // Public signature: /TypeRemapper.remapType|-1053291438258692872[0] + abstract fun remapType(type: IrType): IrType + +} + +// CHECK JVM_IR: +// Mangled name: #withinScope@TypeRemapper(IrTypeParametersContainer;kotlin.Function0<0:0>){0§}0:0 +// Public signature: /withinScope|-8757375077287758446[0] +// CHECK JS_IR NATIVE: +// Mangled name: #withinScope@TypeRemapper(IrTypeParametersContainer;kotlin.Function0<0:0>){0§} +// Public signature: /withinScope|6960001535933584538[0] +inline fun TypeRemapper.withinScope(irTypeParametersContainer: IrTypeParametersContainer, fn: Function0): T + diff --git a/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.kt b/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.kt index a306fb420ae..f8a797f92cb 100644 --- a/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.kt +++ b/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.kt @@ -1,4 +1,8 @@ // TARGET_BACKEND: JVM + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57754 + // FILE: Foo.java import java.util.Set; diff --git a/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.sig.kt.txt b/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.sig.kt.txt new file mode 100644 index 00000000000..36afc213d47 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.sig.kt.txt @@ -0,0 +1,78 @@ +// CHECK: +// Mangled name: Impl +// Public signature: /Impl|null[0] +class Impl : A, B { + // CHECK: + // Mangled name: Impl#(Foo.B){} + // Public signature: /Impl.|1084968671839233134[0] + constructor(b: B) /* primary */ + // CHECK: + // Mangled name: Impl.$$delegate_0 + // Public signature: /Impl.$$delegate_0|-7286425919675154353[0] + private /* final field */ val $$delegate_0: B + // CHECK JVM_IR: + // Mangled name: Impl#add(kotlin.String?){}kotlin.Boolean + // Public signature: /Impl.add|-2525808668243873976[0] + override fun add(element: String?): Boolean + + // CHECK JVM_IR: + // Mangled name: Impl#addAll(kotlin.collections.Collection){}kotlin.Boolean + // Public signature: /Impl.addAll|-3089528969221638255[0] + override fun addAll(elements: Collection): Boolean + + // CHECK: + // Mangled name: Impl#clear(){} + // Public signature: /Impl.clear|-6446868449915108923[0] + override fun clear(): Unit + + // CHECK JVM_IR: + // Mangled name: Impl#contains(kotlin.String?){}kotlin.Boolean + // Public signature: /Impl.contains|5952569342946134495[0] + override operator fun contains(element: String?): Boolean + + // CHECK JVM_IR: + // Mangled name: Impl#containsAll(kotlin.collections.Collection){}kotlin.Boolean + // Public signature: /Impl.containsAll|1049727718390523309[0] + override fun containsAll(elements: Collection): Boolean + + // CHECK JVM_IR: + // Mangled name: Impl#isEmpty(){}kotlin.Boolean + // Public signature: /Impl.isEmpty|-626562167393617703[0] + override fun isEmpty(): Boolean + + // CHECK JVM_IR: + // Mangled name: Impl#iterator(){}kotlin.collections.MutableIterator + // Public signature: /Impl.iterator|-2471973611389785770[0] + override operator fun iterator(): MutableIterator + + // CHECK JVM_IR: + // Mangled name: Impl#remove(kotlin.String?){}kotlin.Boolean + // Public signature: /Impl.remove|8505628602427100346[0] + override fun remove(element: String?): Boolean + + // CHECK JVM_IR: + // Mangled name: Impl#removeAll(kotlin.collections.Collection){}kotlin.Boolean + // Public signature: /Impl.removeAll|-7838912124890825774[0] + override fun removeAll(elements: Collection): Boolean + + // CHECK JVM_IR: + // Mangled name: Impl#retainAll(kotlin.collections.Collection){}kotlin.Boolean + // Public signature: /Impl.retainAll|6732730442391802777[0] + override fun retainAll(elements: Collection): Boolean + + // CHECK: + // Mangled name: Impl{}size + // Public signature: /Impl.size|-6253659984320132064[0] + override val size: Int + // CHECK JVM_IR: + // Mangled name: Impl#(){}kotlin.Int + // Public signature: /Impl.size.|-3941649985161900780[0] + override get(): Int + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +fun box(): String + diff --git a/compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.sig.kt.txt b/compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.sig.kt.txt new file mode 100644 index 00000000000..5f524cdc93c --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.sig.kt.txt @@ -0,0 +1,64 @@ +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +class B : A { + // CHECK: + // Mangled name: B#(){} + // Public signature: /B.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: B#f(kotlin.String){}kotlin.String + // Public signature: /B.f|-2199490409267413998[0] + // CHECK JS_IR NATIVE: + // Mangled name: B#f(kotlin.String){} + // Public signature: /B.f|5157548403930815746[0] + override fun f(x: String): String + +} + +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C : A { + // CHECK: + // Mangled name: C{}x + // Public signature: /C.x|-8060530855978347579[0] + val x: A + // CHECK JVM_IR: + // Mangled name: C#(){}A + // Public signature: /C.x.|-8084666749302497299[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: C#(A){} + // Public signature: /C.|-3166999336802030902[0] + constructor(x: A) /* primary */ + // CHECK JVM_IR: + // Mangled name: C#f(kotlin.String){}kotlin.String + // Public signature: /C.f|-2199490409267413998[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#f(kotlin.String){} + // Public signature: /C.f|5157548403930815746[0] + override fun f(x: String): String + +} + +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +interface A { + + // CHECK JVM_IR: + // Mangled name: A#f(kotlin.String){}kotlin.String + // Public signature: /A.f|-2199490409267413998[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#f(kotlin.String){} + // Public signature: /A.f|5157548403930815746[0] + abstract fun f(x: String): String + +} + diff --git a/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.kt b/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.kt index 740fc2332a5..24a8e412adb 100644 --- a/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.kt +++ b/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.kt @@ -1,3 +1,8 @@ +// DUMP_LOCAL_DECLARATION_SIGNATURES + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57430 + class Wrapper { private val dummy = object : Bar {} private val bar = object : Bar by dummy {} diff --git a/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.sig.kt.txt b/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.sig.kt.txt new file mode 100644 index 00000000000..20c612191b2 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.sig.kt.txt @@ -0,0 +1,114 @@ +// CHECK: +// Mangled name: Wrapper +// Public signature: /Wrapper|null[0] +class Wrapper { + // CHECK: + // Mangled name: Wrapper{}dummy + // Public signature: /Wrapper.dummy|-4015397354973262001[0] + private val dummy: + field + // CHECK JVM_IR: + // Mangled name (compatible mode: false): Wrapper{}dummy. + // Mangled name (compatible mode: true): Wrapper.dummy. + // CHECK JS_IR NATIVE: + // Mangled name (compatible mode: false): Wrapper{}dummy. + // Mangled name (compatible mode: true): Wrapper.dummy. + local class : Bar { + // CHECK: + // Mangled name (compatible mode: false): Wrapper{}dummy.#(){} + // Mangled name (compatible mode: true): Wrapper.dummy.#(){} + constructor() /* primary */ + + // CHECK: + // Mangled name (compatible mode: false): Wrapper{}dummy.{}foo + // Mangled name (compatible mode: true): Wrapper.dummy.{}foo + /* fake */ override val foo: String + // CHECK JVM_IR: + // Mangled name (compatible mode: false): Wrapper{}dummy.#(){}kotlin.String + // Mangled name (compatible mode: true): Wrapper.dummy.#(){}kotlin.String + // CHECK JS_IR NATIVE: + // Mangled name (compatible mode: false): Wrapper{}dummy.#(){} + // Mangled name (compatible mode: true): Wrapper.dummy.#(){} + /* fake */ override get(): String + + } + + // CHECK JVM_IR: + // Mangled name (compatible mode: false): Wrapper#(){}Wrapper{}dummy. + // Mangled name (compatible mode: true): Wrapper#(){}Wrapper.dummy. + // Public signature: /Wrapper.dummy.|-1011589390871666922[0] + // CHECK JS_IR NATIVE: + // Mangled name: Wrapper#(){} + // Public signature: /Wrapper.dummy.|2827030438021585844[0] + private get + + // CHECK: + // Mangled name: Wrapper{}bar + // Public signature: /Wrapper.bar|-7864284097863469857[0] + private val bar: + field + // CHECK JVM_IR: + // Mangled name (compatible mode: false): Wrapper{}bar. + // Mangled name (compatible mode: true): Wrapper.bar. + // CHECK JS_IR NATIVE: + // Mangled name (compatible mode: false): Wrapper{}bar. + // Mangled name (compatible mode: true): Wrapper.bar. + local class : Bar { + // CHECK: + // Mangled name (compatible mode: false): Wrapper{}bar.#(){} + // Mangled name (compatible mode: true): Wrapper.bar.#(){} + constructor() /* primary */ + // CHECK: + // Mangled name (compatible mode: false): Wrapper{}bar..$$delegate_0 + // Mangled name (compatible mode: true): Wrapper.bar..$$delegate_0 + private /* final field */ val $$delegate_0: + + // CHECK: + // Mangled name (compatible mode: false): Wrapper{}bar.{}foo + // Mangled name (compatible mode: true): Wrapper.bar.{}foo + override val foo: String + // CHECK JVM_IR: + // Mangled name (compatible mode: false): Wrapper{}bar.#(){}kotlin.String + // Mangled name (compatible mode: true): Wrapper.bar.#(){}kotlin.String + // CHECK JS_IR NATIVE: + // Mangled name (compatible mode: false): Wrapper{}bar.#(){} + // Mangled name (compatible mode: true): Wrapper.bar.#(){} + override get(): String + + } + + // CHECK JVM_IR: + // Mangled name (compatible mode: false): Wrapper#(){}Wrapper{}bar. + // Mangled name (compatible mode: true): Wrapper#(){}Wrapper.bar. + // Public signature: /Wrapper.bar.|-6775654681164748186[0] + // CHECK JS_IR NATIVE: + // Mangled name: Wrapper#(){} + // Public signature: /Wrapper.bar.|6880642144337645699[0] + private get + + // CHECK: + // Mangled name: Wrapper#(){} + // Public signature: /Wrapper.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: Bar +// Public signature: /Bar|null[0] +interface Bar { + + // CHECK: + // Mangled name: Bar{}foo + // Public signature: /Bar.foo|1688079488202778848[0] + val foo: String + // CHECK JVM_IR: + // Mangled name: Bar#(){}kotlin.String + // Public signature: /Bar.foo.|9191418659696353323[0] + // CHECK JS_IR NATIVE: + // Mangled name: Bar#(){} + // Public signature: /Bar.foo.|-2462361841367688099[0] + get(): String + +} + diff --git a/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.sig.kt.txt b/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.sig.kt.txt new file mode 100644 index 00000000000..cfaab7d8cc2 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.sig.kt.txt @@ -0,0 +1,152 @@ +// CHECK: +// Mangled name: Fir2IrClassifierStorage +// Public signature: /Fir2IrClassifierStorage|null[0] +class Fir2IrClassifierStorage : Fir2IrComponents { + // CHECK: + // Mangled name: Fir2IrClassifierStorage{}components + // Public signature: /Fir2IrClassifierStorage.components|4078011610978737739[0] + private val components: Fir2IrComponents + // CHECK JVM_IR: + // Mangled name: Fir2IrClassifierStorage#(){}Fir2IrComponents + // Public signature: /Fir2IrClassifierStorage.components.|-8289335322148381223[0] + // CHECK JS_IR NATIVE: + // Mangled name: Fir2IrClassifierStorage#(){} + // Public signature: /Fir2IrClassifierStorage.components.|7539133630823831154[0] + private get + + // CHECK: + // Mangled name: Fir2IrClassifierStorage{}name + // Public signature: /Fir2IrClassifierStorage.name|4231860309499509769[0] + private val name: String + // CHECK JVM_IR: + // Mangled name: Fir2IrClassifierStorage#(){}kotlin.String + // Public signature: /Fir2IrClassifierStorage.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: Fir2IrClassifierStorage#(){} + // Public signature: /Fir2IrClassifierStorage.name.|5879344792307730109[0] + private get + + // CHECK: + // Mangled name: Fir2IrClassifierStorage#(Fir2IrComponents){} + // Public signature: /Fir2IrClassifierStorage.|-9000355074851799366[0] + constructor(components: Fir2IrComponents) /* primary */ + + // CHECK: + // Mangled name: Fir2IrClassifierStorage{}classifierStorage + // Public signature: /Fir2IrClassifierStorage.classifierStorage|-9190759179670631614[0] + override val classifierStorage: Fir2IrClassifierStorage + // CHECK JVM_IR: + // Mangled name: Fir2IrClassifierStorage#(){}Fir2IrClassifierStorage + // Public signature: /Fir2IrClassifierStorage.classifierStorage.|3872686339912673063[0] + // CHECK JS_IR NATIVE: + // Mangled name: Fir2IrClassifierStorage#(){} + // Public signature: /Fir2IrClassifierStorage.classifierStorage.|-7373157649530412207[0] + override get(): Fir2IrClassifierStorage + + // CHECK: + // Mangled name: Fir2IrClassifierStorage{}session + // Public signature: /Fir2IrClassifierStorage.session|5876162548717009254[0] + override val session: FirSession + // CHECK JVM_IR: + // Mangled name: Fir2IrClassifierStorage#(){}FirSession + // Public signature: /Fir2IrClassifierStorage.session.|-987114078791317060[0] + // CHECK JS_IR NATIVE: + // Mangled name: Fir2IrClassifierStorage#(){} + // Public signature: /Fir2IrClassifierStorage.session.|-846408160347892823[0] + override get(): FirSession + +} + +// CHECK: +// Mangled name: Fir2IrComponentsStorage +// Public signature: /Fir2IrComponentsStorage|null[0] +class Fir2IrComponentsStorage : Fir2IrComponents { + // CHECK: + // Mangled name: Fir2IrComponentsStorage{}session + // Public signature: /Fir2IrComponentsStorage.session|5876162548717009254[0] + override val session: FirSession + // CHECK JVM_IR: + // Mangled name: Fir2IrComponentsStorage#(){}FirSession + // Public signature: /Fir2IrComponentsStorage.session.|-987114078791317060[0] + // CHECK JS_IR NATIVE: + // Mangled name: Fir2IrComponentsStorage#(){} + // Public signature: /Fir2IrComponentsStorage.session.|-846408160347892823[0] + override get + + // CHECK: + // Mangled name: Fir2IrComponentsStorage{}classifierStorage + // Public signature: /Fir2IrComponentsStorage.classifierStorage|-9190759179670631614[0] + override lateinit var classifierStorage: Fir2IrClassifierStorage + // CHECK JVM_IR: + // Mangled name: Fir2IrComponentsStorage#(){}Fir2IrClassifierStorage + // Public signature: /Fir2IrComponentsStorage.classifierStorage.|3872686339912673063[0] + // CHECK JS_IR NATIVE: + // Mangled name: Fir2IrComponentsStorage#(){} + // Public signature: /Fir2IrComponentsStorage.classifierStorage.|-7373157649530412207[0] + override get + // CHECK: + // Mangled name: Fir2IrComponentsStorage#(Fir2IrClassifierStorage){} + // Public signature: /Fir2IrComponentsStorage.classifierStorage.|5982694170574938742[0] + open set + + // CHECK: + // Mangled name: Fir2IrComponentsStorage#(FirSession){} + // Public signature: /Fir2IrComponentsStorage.|-3192465151719300095[0] + constructor(session: FirSession) /* primary */ + +} + +// CHECK: +// Mangled name: FirSession +// Public signature: /FirSession|null[0] +class FirSession { + // CHECK: + // Mangled name: FirSession{}name + // Public signature: /FirSession.name|4231860309499509769[0] + val name: String + // CHECK JVM_IR: + // Mangled name: FirSession#(){}kotlin.String + // Public signature: /FirSession.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: FirSession#(){} + // Public signature: /FirSession.name.|5879344792307730109[0] + get + + // CHECK: + // Mangled name: FirSession#(kotlin.String){} + // Public signature: /FirSession.|1280618353163213788[0] + constructor(name: String) /* primary */ + +} + +// CHECK: +// Mangled name: Fir2IrComponents +// Public signature: /Fir2IrComponents|null[0] +interface Fir2IrComponents { + + // CHECK: + // Mangled name: Fir2IrComponents{}classifierStorage + // Public signature: /Fir2IrComponents.classifierStorage|-9190759179670631614[0] + abstract val classifierStorage: Fir2IrClassifierStorage + // CHECK JVM_IR: + // Mangled name: Fir2IrComponents#(){}Fir2IrClassifierStorage + // Public signature: /Fir2IrComponents.classifierStorage.|3872686339912673063[0] + // CHECK JS_IR NATIVE: + // Mangled name: Fir2IrComponents#(){} + // Public signature: /Fir2IrComponents.classifierStorage.|-7373157649530412207[0] + abstract get + + // CHECK: + // Mangled name: Fir2IrComponents{}session + // Public signature: /Fir2IrComponents.session|5876162548717009254[0] + abstract val session: FirSession + // CHECK JVM_IR: + // Mangled name: Fir2IrComponents#(){}FirSession + // Public signature: /Fir2IrComponents.session.|-987114078791317060[0] + // CHECK JS_IR NATIVE: + // Mangled name: Fir2IrComponents#(){} + // Public signature: /Fir2IrComponents.session.|-846408160347892823[0] + abstract get + +} + diff --git a/compiler/testData/ir/irText/firProblems/FirBuilder.sig.kt.txt b/compiler/testData/ir/irText/firProblems/FirBuilder.sig.kt.txt new file mode 100644 index 00000000000..78e742ce144 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/FirBuilder.sig.kt.txt @@ -0,0 +1,63 @@ +// MODULE: m1 +// FILE: BaseFirBuilder.kt + +// CHECK: +// Mangled name: BaseFirBuilder +// Public signature: /BaseFirBuilder|null[0] +abstract class BaseFirBuilder { + // CHECK: + // Mangled name: BaseFirBuilder#(){} + // Public signature: /BaseFirBuilder.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: BaseFirBuilder#withCapturedTypeParameters(kotlin.Function0<0:0>){0§}0:0 + // Public signature: /BaseFirBuilder.withCapturedTypeParameters|9205970479583592258[0] + // CHECK JS_IR NATIVE: + // Mangled name: BaseFirBuilder#withCapturedTypeParameters(kotlin.Function0<0:0>){0§} + // Public signature: /BaseFirBuilder.withCapturedTypeParameters|6883879135586930649[0] + inline fun withCapturedTypeParameters(block: Function0): T + +} + +// MODULE: m2 +// FILE: FirBuilder.kt + +// CHECK: +// Mangled name: BaseConverter +// Public signature: /BaseConverter|null[0] +open class BaseConverter : BaseFirBuilder { + // CHECK: + // Mangled name: BaseConverter#(){} + // Public signature: /BaseConverter.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: BaseConverter#withCapturedTypeParameters(kotlin.Function0<0:0>){0§}0:0 + // Public signature: /BaseConverter.withCapturedTypeParameters|9205970479583592258[0] + // CHECK JS_IR NATIVE: + // Mangled name: BaseConverter#withCapturedTypeParameters(kotlin.Function0<0:0>){0§} + // Public signature: /BaseConverter.withCapturedTypeParameters|6883879135586930649[0] + /* fake */ override inline fun withCapturedTypeParameters(block: Function0): T + +} + +// CHECK: +// Mangled name: DeclarationsConverter +// Public signature: /DeclarationsConverter|null[0] +class DeclarationsConverter : BaseConverter { + // CHECK: + // Mangled name: DeclarationsConverter#(){} + // Public signature: /DeclarationsConverter.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: DeclarationsConverter#withCapturedTypeParameters(kotlin.Function0<0:0>){0§}0:0 + // Public signature: /DeclarationsConverter.withCapturedTypeParameters|9205970479583592258[0] + // CHECK JS_IR NATIVE: + // Mangled name: DeclarationsConverter#withCapturedTypeParameters(kotlin.Function0<0:0>){0§} + // Public signature: /DeclarationsConverter.withCapturedTypeParameters|6883879135586930649[0] + /* fake */ override inline fun withCapturedTypeParameters(block: Function0): T + +} + diff --git a/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.kt b/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.kt index 5e9498307f2..4214bb2df41 100644 --- a/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.kt +++ b/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.kt @@ -1,6 +1,10 @@ // TARGET_BACKEND: JVM_IR +// DUMP_LOCAL_DECLARATION_SIGNATURES // SKIP_KLIB_TEST +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57430 + // FILE: Collector.java public class Collector { diff --git a/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.sig.kt.txt b/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.sig.kt.txt new file mode 100644 index 00000000000..f4152f26abb --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.sig.kt.txt @@ -0,0 +1,33 @@ +// CHECK: +// Mangled name: Serializer +// Public signature: /Serializer|null[0] +class Serializer { + // CHECK: + // Mangled name: Serializer#(){} + // Public signature: /Serializer.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Serializer#createMessageCollector(){}Serializer#createMessageCollector. + // Public signature: /Serializer.createMessageCollector|2610567021773551177[0] + private fun createMessageCollector(): + // CHECK: + // Mangled name: Serializer#createMessageCollector(){}Serializer#createMessageCollector.. + local class : Collector { + // CHECK: + // Mangled name: Serializer#createMessageCollector(){}Serializer#createMessageCollector..#(){} + constructor() /* primary */ + + // CHECK: + // Mangled name: Serializer#createMessageCollector(){}Serializer#createMessageCollector..#flush(){} + /* fake */ override fun flush(): Unit + + } + + // CHECK: + // Mangled name: Serializer#serialize(){} + // Public signature: /Serializer.serialize|2218225496927039174[0] + fun serialize(): Unit + +} + diff --git a/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.kt b/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.kt index a87ccaae16d..36903ae1cc9 100644 --- a/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.kt +++ b/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.kt @@ -4,6 +4,9 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429, KT-57788 + interface SymbolOwner> interface Symbol> diff --git a/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.sig.kt.txt b/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.sig.kt.txt new file mode 100644 index 00000000000..288a7cd861a --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.sig.kt.txt @@ -0,0 +1,175 @@ +// CHECK: +// Mangled name: ImplicitReceiverStack +// Public signature: /ImplicitReceiverStack|null[0] +abstract class ImplicitReceiverStack : Iterable> { + // CHECK: + // Mangled name: ImplicitReceiverStack#(){} + // Public signature: /ImplicitReceiverStack.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: ImplicitReceiverStack#forEach(java.util.function.Consumer?>?){} + // Public signature: /ImplicitReceiverStack.forEach|-3306751441263527018[0] + /* fake */ override fun forEach(p0: Consumer?>?): Unit + + // CHECK JVM_IR: + // Mangled name: ImplicitReceiverStack#iterator(){}kotlin.collections.Iterator> + // Public signature: /ImplicitReceiverStack.iterator|-837055222250609728[0] + // CHECK JS_IR NATIVE: + // Mangled name: ImplicitReceiverStack#get(kotlin.String?){} + // Public signature: /ImplicitReceiverStack.get|-2385095576760729731[0] + abstract /* fake */ override operator fun iterator(): Iterator> + + // CHECK JVM_IR: + // Mangled name: ImplicitReceiverStack#spliterator(){}java.util.Spliterator{EnhancedNullability}>{EnhancedNullability} + // Public signature: /ImplicitReceiverStack.spliterator|-1087522279462133212[0] + // CHECK JS_IR NATIVE: + // Mangled name: ImplicitReceiverValue + // Public signature: /ImplicitReceiverValue|null[0] + /* fake */ override fun spliterator(): @EnhancedNullability Spliterator<@EnhancedNullability ImplicitReceiverValue<*>> + + // CHECK JVM_IR: + // Mangled name: ImplicitReceiverStack#get(kotlin.String?){}ImplicitReceiverValue<*>? + // Public signature: /ImplicitReceiverStack.get|-8207298175036627063[0] + // CHECK JS_IR NATIVE: + // Mangled name: ImplicitReceiverValue{}boundSymbol + // Public signature: /ImplicitReceiverValue.boundSymbol|7940914052046792092[0] + abstract operator fun get(name: String?): ImplicitReceiverValue<*>? + +} + +// CHECK: +// Mangled name: ImplicitReceiverValue +// Public signature: /ImplicitReceiverValue|null[0] +class ImplicitReceiverValue> : ReceiverValue { + // CHECK: + // Mangled name: ImplicitReceiverValue{}boundSymbol + // Public signature: /ImplicitReceiverValue.boundSymbol|7940914052046792092[0] + val boundSymbol: S? + // CHECK JVM_IR: + // Mangled name: ImplicitReceiverValue#(){}1:0? + // Public signature: /ImplicitReceiverValue.boundSymbol.|4571442115658707994[0] + // CHECK JS_IR NATIVE: + // Mangled name: ImplicitReceiverValue#(){} + // Public signature: /ImplicitReceiverValue.type.|5958014174245684635[0] + get + + // CHECK: + // Mangled name: ImplicitReceiverValue{}type + // Public signature: /ImplicitReceiverValue.type|-6051055617123801408[0] + override val type: String + // CHECK JVM_IR: + // Mangled name: ImplicitReceiverValue#(){}kotlin.String + // Public signature: /ImplicitReceiverValue.type.|9160771839252493702[0] + // CHECK JS_IR NATIVE: + // Mangled name: PersistentImplicitReceiverStack + // Public signature: /PersistentImplicitReceiverStack|null[0] + override get + + // CHECK: + // Mangled name: ImplicitReceiverValue#(1:0?;kotlin.String){} + // Public signature: /ImplicitReceiverValue.|-1731726113211136467[0] + constructor(boundSymbol: S?, type: String) /* primary */ + +} + +// CHECK: +// Mangled name: PersistentImplicitReceiverStack +// Public signature: /PersistentImplicitReceiverStack|null[0] +class PersistentImplicitReceiverStack : ImplicitReceiverStack, Iterable> { + // CHECK: + // Mangled name: PersistentImplicitReceiverStack{}stack + // Public signature: /PersistentImplicitReceiverStack.stack|-6859012302810162613[0] + private val stack: List> + // CHECK JVM_IR: + // Mangled name: PersistentImplicitReceiverStack#(){}kotlin.collections.List> + // Public signature: /PersistentImplicitReceiverStack.stack.|2790934809164034447[0] + // CHECK JS_IR NATIVE: + // Mangled name: PersistentImplicitReceiverStack#get(kotlin.String?){} + // Public signature: /PersistentImplicitReceiverStack.get|-2385095576760729731[0] + private get + + // CHECK: + // Mangled name: PersistentImplicitReceiverStack#(kotlin.collections.List>){} + // Public signature: /PersistentImplicitReceiverStack.|-7593555479041026486[0] + constructor(stack: List>) /* primary */ + + // CHECK: + // Mangled name: PersistentImplicitReceiverStack#forEach(java.util.function.Consumer?>?){} + // Public signature: /PersistentImplicitReceiverStack.forEach|-3306751441263527018[0] + /* fake */ override fun forEach(p0: Consumer?>?): Unit + + // CHECK JVM_IR: + // Mangled name: PersistentImplicitReceiverStack#spliterator(){}java.util.Spliterator{EnhancedNullability}>{EnhancedNullability} + // Public signature: /PersistentImplicitReceiverStack.spliterator|-1087522279462133212[0] + // CHECK JS_IR NATIVE: + // Mangled name: ReceiverValue{}type + // Public signature: /ReceiverValue.type|-6051055617123801408[0] + /* fake */ override fun spliterator(): @EnhancedNullability Spliterator<@EnhancedNullability ImplicitReceiverValue<*>> + + // CHECK JVM_IR: + // Mangled name: PersistentImplicitReceiverStack#get(kotlin.String?){}ImplicitReceiverValue<*>? + // Public signature: /PersistentImplicitReceiverStack.get|-8207298175036627063[0] + // CHECK JS_IR NATIVE: + // Mangled name: ReceiverValue#(){} + // Public signature: /ReceiverValue.type.|5958014174245684635[0] + override operator fun get(name: String?): ImplicitReceiverValue<*>? + + // CHECK JVM_IR: + // Mangled name: PersistentImplicitReceiverStack#iterator(){}kotlin.collections.Iterator> + // Public signature: /PersistentImplicitReceiverStack.iterator|-837055222250609728[0] + // CHECK JS_IR NATIVE: + // Mangled name: Symbol + // Public signature: /Symbol|null[0] + override operator fun iterator(): Iterator> + +} + +// CHECK: +// Mangled name: ReceiverValue +// Public signature: /ReceiverValue|null[0] +interface ReceiverValue { + + // CHECK: + // Mangled name: ReceiverValue{}type + // Public signature: /ReceiverValue.type|-6051055617123801408[0] + abstract val type: String + // CHECK JVM_IR: + // Mangled name: ReceiverValue#(){}kotlin.String + // Public signature: /ReceiverValue.type.|9160771839252493702[0] + // CHECK JS_IR NATIVE: + // Mangled name: #box(){} + // Public signature: /box|2173511048851971368[0] + abstract get + +} + +// CHECK: +// Mangled name: Symbol +// Public signature: /Symbol|null[0] +interface Symbol> { + +} + +// CHECK: +// Mangled name: SymbolOwner +// Public signature: /SymbolOwner|null[0] +interface SymbolOwner> { + +} + +// CHECK: +// Mangled name: #bar(kotlin.String){} +// Public signature: /bar|5132770888056479978[0] +fun bar(s: String): Unit + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +fun box(): String + +// CHECK: +// Mangled name: #foo(PersistentImplicitReceiverStack){} +// Public signature: /foo|4910085870541175645[0] +fun foo(stack: PersistentImplicitReceiverStack): Unit + diff --git a/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.sig.kt.txt b/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.sig.kt.txt new file mode 100644 index 00000000000..db9fda4185d --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.sig.kt.txt @@ -0,0 +1,8 @@ +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +// CHECK JS_IR NATIVE: +// Mangled name: #box(){} +// Public signature: /box|2173511048851971368[0] +fun box(): String + diff --git a/compiler/testData/ir/irText/firProblems/LocalSuspendFun.sig.kt.txt b/compiler/testData/ir/irText/firProblems/LocalSuspendFun.sig.kt.txt new file mode 100644 index 00000000000..78d576b7b12 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/LocalSuspendFun.sig.kt.txt @@ -0,0 +1,12 @@ +// CHECK: +// Mangled name: #foo(){} +// Public signature: /foo|-1041209573719867811[0] +fun foo(): Unit + +// CHECK JVM_IR: +// Mangled name: #useMemo(kotlin.Function0<0:0>){0§}0:0 +// Public signature: /useMemo|-5878263003233931724[0] +// CHECK JS_IR NATIVE: +// Mangled name: #useMemo(kotlin.Function0<0:0>){0§} +// Public signature: /useMemo|-3060604648637761528[0] +fun useMemo(callback: Function0): T diff --git a/compiler/testData/ir/irText/firProblems/Modality.sig.kt.txt b/compiler/testData/ir/irText/firProblems/Modality.sig.kt.txt new file mode 100644 index 00000000000..4ee3f611431 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/Modality.sig.kt.txt @@ -0,0 +1,90 @@ +// CHECK: +// Mangled name: Atom +// Public signature: /Atom|null[0] +class Atom { + // CHECK: + // Mangled name: Atom{}candidateDescriptor + // Public signature: /Atom.candidateDescriptor|-3112599931076785471[0] + val candidateDescriptor: CallableDescriptor + // CHECK JVM_IR: + // Mangled name: Atom#(){}CallableDescriptor + // Public signature: /Atom.candidateDescriptor.|4556132200066715385[0] + get + + // CHECK: + // Mangled name: Atom#(CallableDescriptor){} + // Public signature: /Atom.|-1799222929165952555[0] + constructor(candidateDescriptor: CallableDescriptor) /* primary */ + +} + +// CHECK: +// Mangled name: KotlinResolutionCandidate +// Public signature: /KotlinResolutionCandidate|null[0] +class KotlinResolutionCandidate { + // CHECK: + // Mangled name: KotlinResolutionCandidate{}resolvedCall + // Public signature: /KotlinResolutionCandidate.resolvedCall|-2429780263902948392[0] + val resolvedCall: Atom + // CHECK JVM_IR: + // Mangled name: KotlinResolutionCandidate#(){}Atom + // Public signature: /KotlinResolutionCandidate.resolvedCall.|49370572931497711[0] + get + + // CHECK: + // Mangled name: KotlinResolutionCandidate#(Atom){} + // Public signature: /KotlinResolutionCandidate.|-8995219914817488939[0] + constructor(resolvedCall: Atom) /* primary */ + +} + +// CHECK: +// Mangled name: ResolutionPart +// Public signature: /ResolutionPart|null[0] +abstract class ResolutionPart { + // CHECK: + // Mangled name: ResolutionPart#(){} + // Public signature: /ResolutionPart.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: ResolutionPart#process@KotlinResolutionCandidate(){}kotlin.String + // Public signature: /ResolutionPart.process|8201571705428560068[0] + abstract fun KotlinResolutionCandidate.process(): String + +} + +// CHECK: +// Mangled name: Substitutable +// Public signature: /Substitutable|null[0] +interface Substitutable { + +} + +// CHECK: +// Mangled name: Final +// Public signature: /Final|null[0] +object Final : Modality { + // CHECK: + // Mangled name: Final#(){} + // Public signature: /Final.|-5645683436151566731[0] + private constructor() /* primary */ + +} + +// CHECK: +// Mangled name: Owner +// Public signature: /Owner|null[0] +object Owner : ResolutionPart { + // CHECK: + // Mangled name: Owner#(){} + // Public signature: /Owner.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Owner#process@KotlinResolutionCandidate(){}kotlin.String + // Public signature: /Owner.process|8201571705428560068[0] + override fun KotlinResolutionCandidate.process(): String + +} + diff --git a/compiler/testData/ir/irText/firProblems/MultiList.kt b/compiler/testData/ir/irText/firProblems/MultiList.kt index b68d50df1eb..3c525d2d7c7 100644 --- a/compiler/testData/ir/irText/firProblems/MultiList.kt +++ b/compiler/testData/ir/irText/firProblems/MultiList.kt @@ -1,6 +1,9 @@ // TARGET_BACKEND: JVM // FULL_JDK +// SKIP_SIGNATURE_DUMP +// ^ Value parameters in fake overrides generated by K1 and K2 are different + import java.util.ArrayList data class Some(val value: T) diff --git a/compiler/testData/ir/irText/firProblems/OutBox.kt b/compiler/testData/ir/irText/firProblems/OutBox.kt index 83bc29cfc6f..77994ddb632 100644 --- a/compiler/testData/ir/irText/firProblems/OutBox.kt +++ b/compiler/testData/ir/irText/firProblems/OutBox.kt @@ -1,4 +1,8 @@ // TARGET_BACKEND: JVM + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429 + // FILE: Foo.java public class Foo { @@ -22,4 +26,4 @@ class Box(val foo: T) { } return ""; } -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/firProblems/OutBox.sig.kt.txt b/compiler/testData/ir/irText/firProblems/OutBox.sig.kt.txt new file mode 100644 index 00000000000..89b8bbcea0d --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/OutBox.sig.kt.txt @@ -0,0 +1,29 @@ +// CHECK: +// Mangled name: Box +// Public signature: /Box|null[0] +class Box { + // CHECK: + // Mangled name: Box{}foo + // Public signature: /Box.foo|1688079488202778848[0] + val foo: T + // CHECK JVM_IR: + // Mangled name: Box#(){}1:0 + // Public signature: /Box.foo.|3855223738271342790[0] + get + + // CHECK: + // Mangled name: Box#(1:0){} + // Public signature: /Box.|-8731461708390519279[0] + constructor(foo: T) /* primary */ + + // CHECK: + // Mangled name: Box{}str + // Public signature: /Box.str|4033248252607519654[0] + val str: String + // CHECK JVM_IR: + // Mangled name: Box#(){}kotlin.String + // Public signature: /Box.str.|7048381576567484853[0] + get(): String + +} + diff --git a/compiler/testData/ir/irText/firProblems/SafeLetWithReturn.sig.kt.txt b/compiler/testData/ir/irText/firProblems/SafeLetWithReturn.sig.kt.txt new file mode 100644 index 00000000000..cf9a26d4f21 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/SafeLetWithReturn.sig.kt.txt @@ -0,0 +1,28 @@ +// CHECK JVM_IR: +// Mangled name: #bar(kotlin.String?;kotlin.String?){}kotlin.String +// Public signature: /bar|8959405200213373616[0] +// CHECK JS_IR NATIVE: +// Mangled name: #bar(kotlin.String?;kotlin.String?){} +// Public signature: /bar|7464353977761234214[0] +fun bar(s: String?, t: String?): String + +// CHECK JVM_IR: +// Mangled name: #foo(kotlin.String?){}kotlin.String +// Public signature: /foo|-459206804338718434[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo(kotlin.String?){} +// Public signature: /foo|-7402282804178432687[0] +fun foo(s: String?): String + +// CHECK: +// Mangled name: @kotlin.String?{}baz +// Public signature: /baz|7411160368245609818[0] +val String?.baz: String + // CHECK JVM_IR: + // Mangled name: #@kotlin.String?(){}kotlin.String + // Public signature: /baz.|4455067775993214927[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@kotlin.String?(){} + // Public signature: /baz.|2073181676262234013[0] + get(): String + diff --git a/compiler/testData/ir/irText/firProblems/SameJavaFieldReferences.sig.kt.txt b/compiler/testData/ir/irText/firProblems/SameJavaFieldReferences.sig.kt.txt new file mode 100644 index 00000000000..5deb343fa79 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/SameJavaFieldReferences.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #foo(){} +// Public signature: /foo|-1041209573719867811[0] +fun foo(): Unit + diff --git a/compiler/testData/ir/irText/firProblems/SignatureClash.sig.kt.txt b/compiler/testData/ir/irText/firProblems/SignatureClash.sig.kt.txt new file mode 100644 index 00000000000..eadfbc7da86 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/SignatureClash.sig.kt.txt @@ -0,0 +1,128 @@ +// CHECK: +// Mangled name: DataClass +// Public signature: /DataClass|null[0] +data class DataClass : Delegate, Derived { + // CHECK: + // Mangled name: DataClass{}delegate + // Public signature: /DataClass.delegate|-801742451047326070[0] + val delegate: Delegate + // CHECK JVM_IR: + // Mangled name: DataClass#(){}Delegate + // Public signature: /DataClass.delegate.|6133163829830511426[0] + // CHECK JS_IR NATIVE: + // Mangled name: DataClass#(){} + // Public signature: /DataClass.delegate.|448313462178410567[0] + get + + // CHECK: + // Mangled name: DataClass#(Delegate){} + // Public signature: /DataClass.|7426992287025160657[0] + constructor(delegate: Delegate) /* primary */ + // CHECK: + // Mangled name: DataClass#bar(){} + // Public signature: /DataClass.bar|496682602797471549[0] + override fun bar(): Unit + + // CHECK JVM_IR: + // Mangled name: DataClass#component1(){}Delegate + // Public signature: /DataClass.component1|748132671697339477[0] + // CHECK JS_IR NATIVE: + // Mangled name: DataClass#component1(){} + // Public signature: /DataClass.component1|162597135895221648[0] + operator fun component1(): Delegate + + // CHECK JVM_IR: + // Mangled name: DataClass#copy(Delegate){}DataClass + // Public signature: /DataClass.copy|-3599253859920134304[0] + // CHECK JS_IR NATIVE: + // Mangled name: DataClass#copy(Delegate){} + // Public signature: /DataClass.copy|-6641847768161473840[0] + fun copy(delegate: Delegate): DataClass + + // CHECK JVM_IR: + // Mangled name: DataClass#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /DataClass.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: DataClass#equals(kotlin.Any?){} + // Public signature: /DataClass.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: DataClass#hashCode(){}kotlin.Int + // Public signature: /DataClass.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: DataClass#hashCode(){} + // Public signature: /DataClass.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: DataClass#toString(){}kotlin.String + // Public signature: /DataClass.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: DataClass#toString(){} + // Public signature: /DataClass.toString|-1522858123163872138[0] + override fun toString(): String + +} + +// CHECK: +// Mangled name: Base +// Public signature: /Base|null[0] +interface Base { + +} + +// CHECK: +// Mangled name: Delegate +// Public signature: /Delegate|null[0] +interface Delegate : Base { + + // CHECK: + // Mangled name: Delegate#bar(){} + // Public signature: /Delegate.bar|496682602797471549[0] + abstract fun bar(): Unit + +} + +// CHECK: +// Mangled name: Derived +// Public signature: /Derived|null[0] +interface Derived : Delegate { + // CHECK: + // Mangled name: Derived#bar(){} + // Public signature: /Derived.bar|496682602797471549[0] + abstract /* fake */ override fun bar(): Unit + +} + +// CHECK: +// Mangled name: Factory +// Public signature: /Factory|null[0] +object Factory { + // CHECK: + // Mangled name: Factory#(){} + // Public signature: /Factory.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Factory#foo(kotlin.String){}kotlin.String + // Public signature: /Factory.foo|-5534735991146511619[0] + // CHECK JS_IR NATIVE: + // Mangled name: Factory#foo(kotlin.String){} + // Public signature: /Factory.foo|1351044947738582195[0] + fun foo(a: String): String + + // CHECK JVM_IR: + // Mangled name: Factory#foo(kotlin.String;kotlin.Function1){}kotlin.String + // Public signature: /Factory.foo|-1406038686123493927[0] + // CHECK JS_IR NATIVE: + // Mangled name: Factory#foo(kotlin.String;kotlin.Function1){} + // Public signature: /Factory.foo|555399751922815029[0] + fun foo(a: String, f: Function1): String + +} + +// CHECK: +// Mangled name: Some +// Public signature: /Some|null[0] +typealias Some = Function1 diff --git a/compiler/testData/ir/irText/firProblems/SignatureComputationComplexJavaGeneric.kt b/compiler/testData/ir/irText/firProblems/SignatureComputationComplexJavaGeneric.kt index ff1950ba9ed..bb7a889cb3b 100644 --- a/compiler/testData/ir/irText/firProblems/SignatureComputationComplexJavaGeneric.kt +++ b/compiler/testData/ir/irText/firProblems/SignatureComputationComplexJavaGeneric.kt @@ -1,5 +1,8 @@ // TARGET_BACKEND: JVM_IR +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429 + // FILE: J.java import org.jetbrains.annotations.Nullable; diff --git a/compiler/testData/ir/irText/firProblems/SignatureComputationComplexJavaGeneric.sig.kt.txt b/compiler/testData/ir/irText/firProblems/SignatureComputationComplexJavaGeneric.sig.kt.txt new file mode 100644 index 00000000000..726b31447a1 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/SignatureComputationComplexJavaGeneric.sig.kt.txt @@ -0,0 +1,25 @@ +// CHECK: +// Mangled name: Test +// Public signature: /Test|null[0] +class Test : J { + // CHECK: + // Mangled name: Test{}x + // Public signature: /Test.x|-8060530855978347579[0] + val x: T + // CHECK JVM_IR: + // Mangled name: Test#(){}1:0 + // Public signature: /Test.x.|-8893883356128097563[0] + get + + // CHECK: + // Mangled name: Test#(1:0){} + // Public signature: /Test.|-8731461708390519279[0] + constructor(x: T) /* primary */ + + // CHECK: + // Mangled name: Test#test(J.B<1:0>){} + // Public signature: /Test.test|7386642793853999047[0] + fun test(b: B): Unit + +} + diff --git a/compiler/testData/ir/irText/firProblems/SimpleTypeMarker.sig.kt.txt b/compiler/testData/ir/irText/firProblems/SimpleTypeMarker.sig.kt.txt new file mode 100644 index 00000000000..3e97b30ec96 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/SimpleTypeMarker.sig.kt.txt @@ -0,0 +1,60 @@ +// CHECK: +// Mangled name: SimpleType +// Public signature: /SimpleType|null[0] +class SimpleType : SimpleTypeMarker { + // CHECK: + // Mangled name: SimpleType#(){} + // Public signature: /SimpleType.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: SimpleType#foo(){}kotlin.String + // Public signature: /SimpleType.foo|485335955883620819[0] + // CHECK JS_IR NATIVE: + // Mangled name: SimpleType#foo(){} + // Public signature: /SimpleType.foo|-1041209573719867811[0] + fun foo(): String + +} + +// CHECK: +// Mangled name: UserImpl +// Public signature: /UserImpl|null[0] +class UserImpl { + // CHECK: + // Mangled name: UserImpl#(){} + // Public signature: /UserImpl.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: UserImpl#bar@SimpleTypeMarker(){}kotlin.String + // Public signature: /UserImpl.bar|9149645946452319977[0] + // CHECK JS_IR NATIVE: + // Mangled name: UserImpl#bar@SimpleTypeMarker(){} + // Public signature: /UserImpl.bar|1189004268240262319[0] + fun SimpleTypeMarker.bar(): String + +} + +// CHECK: +// Mangled name: SimpleTypeMarker +// Public signature: /SimpleTypeMarker|null[0] +interface SimpleTypeMarker { + +} + +// CHECK: +// Mangled name: User +// Public signature: /User|null[0] +interface User { + + // CHECK JVM_IR: + // Mangled name: User#bar@SimpleTypeMarker(){}kotlin.String + // Public signature: /User.bar|9149645946452319977[0] + // CHECK JS_IR NATIVE: + // Mangled name: User#bar@SimpleTypeMarker(){} + // Public signature: /User.bar|1189004268240262319[0] + fun SimpleTypeMarker.bar(): String + +} + diff --git a/compiler/testData/ir/irText/firProblems/SyntheticSetterType.sig.kt.txt b/compiler/testData/ir/irText/firProblems/SyntheticSetterType.sig.kt.txt new file mode 100644 index 00000000000..1b96dbd7070 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/SyntheticSetterType.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #foo(PropertyDescriptorImpl){} +// Public signature: /foo|699254769171630146[0] +fun foo(descriptor: PropertyDescriptorImpl): Unit + diff --git a/compiler/testData/ir/irText/firProblems/TypeParameterBounds.sig.kt.txt b/compiler/testData/ir/irText/firProblems/TypeParameterBounds.sig.kt.txt new file mode 100644 index 00000000000..b6b977fe3c0 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/TypeParameterBounds.sig.kt.txt @@ -0,0 +1,151 @@ +// CHECK: +// Mangled name: TypeAnn +// Public signature: /TypeAnn|null[0] +@Target(allowedTargets = [AnnotationTarget.TYPE]) +open annotation class TypeAnn : Annotation { + // CHECK: + // Mangled name: TypeAnn{}name + // Public signature: /TypeAnn.name|4231860309499509769[0] + val name: String + // CHECK JVM_IR: + // Mangled name: TypeAnn#(){}kotlin.String + // Public signature: /TypeAnn.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: TypeAnn#(){} + // Public signature: /TypeAnn.name.|5879344792307730109[0] + get + + // CHECK: + // Mangled name: TypeAnn#(kotlin.String){} + // Public signature: /TypeAnn.|1280618353163213788[0] + constructor(name: String) /* primary */ + +} + +// CHECK: +// Mangled name: TypeParameterAnn +// Public signature: /TypeParameterAnn|null[0] +@Target(allowedTargets = [AnnotationTarget.TYPE_PARAMETER]) +open annotation class TypeParameterAnn : Annotation { + // CHECK: + // Mangled name: TypeParameterAnn#(){} + // Public signature: /TypeParameterAnn.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: TypeParameterAnnBinary +// Public signature: /TypeParameterAnnBinary|null[0] +@Target(allowedTargets = [AnnotationTarget.TYPE_PARAMETER]) +@Retention(value = AnnotationRetention.BINARY) +open annotation class TypeParameterAnnBinary : Annotation { + // CHECK: + // Mangled name: TypeParameterAnnBinary#(){} + // Public signature: /TypeParameterAnnBinary.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: ClassBound +// Public signature: /ClassBound|null[0] +class ClassBound<@TypeParameterAnn T : @TypeAnn(name = "Simple") SimpleClass> { + // CHECK: + // Mangled name: ClassBound#(){} + // Public signature: /ClassBound.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: ClassBoundGeneric +// Public signature: /ClassBoundGeneric|null[0] +class ClassBoundGeneric> { + // CHECK: + // Mangled name: ClassBoundGeneric#(){} + // Public signature: /ClassBoundGeneric.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: GenericClass +// Public signature: /GenericClass|null[0] +class GenericClass { + // CHECK: + // Mangled name: GenericClass#(){} + // Public signature: /GenericClass.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: InterfaceBound +// Public signature: /InterfaceBound|null[0] +class InterfaceBound<@TypeParameterAnn T : @TypeAnn(name = "Simple") Simple> { + // CHECK: + // Mangled name: InterfaceBound#(){} + // Public signature: /InterfaceBound.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: InterfaceBoundGeneric +// Public signature: /InterfaceBoundGeneric|null[0] +class InterfaceBoundGeneric> { + // CHECK: + // Mangled name: InterfaceBoundGeneric#(){} + // Public signature: /InterfaceBoundGeneric.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: SimpleClass +// Public signature: /SimpleClass|null[0] +class SimpleClass { + // CHECK: + // Mangled name: SimpleClass#(){} + // Public signature: /SimpleClass.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: SimpleParameter +// Public signature: /SimpleParameter|null[0] +class SimpleParameter<@TypeParameterAnn @TypeParameterAnnBinary T : Any?> { + // CHECK: + // Mangled name: SimpleParameter#(){} + // Public signature: /SimpleParameter.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: TypeParameterAsBound +// Public signature: /TypeParameterAsBound|null[0] +class TypeParameterAsBound { + // CHECK: + // Mangled name: TypeParameterAsBound#(){} + // Public signature: /TypeParameterAsBound.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: Generic +// Public signature: /Generic|null[0] +interface Generic { + +} + +// CHECK: +// Mangled name: Simple +// Public signature: /Simple|null[0] +interface Simple { + +} + diff --git a/compiler/testData/ir/irText/firProblems/TypeParameterInNestedClass.kt b/compiler/testData/ir/irText/firProblems/TypeParameterInNestedClass.kt index aff70e690cc..8ab4ee26990 100644 --- a/compiler/testData/ir/irText/firProblems/TypeParameterInNestedClass.kt +++ b/compiler/testData/ir/irText/firProblems/TypeParameterInNestedClass.kt @@ -1,5 +1,8 @@ // ISSUE: KT-58008 +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR +// ^ KT-57429 + object Retry { class Builder( private val action: suspend () -> B, diff --git a/compiler/testData/ir/irText/firProblems/TypeParameterInNestedClass.sig.kt.txt b/compiler/testData/ir/irText/firProblems/TypeParameterInNestedClass.sig.kt.txt new file mode 100644 index 00000000000..14f5878b608 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/TypeParameterInNestedClass.sig.kt.txt @@ -0,0 +1,41 @@ +// CHECK: +// Mangled name: Retry +// Public signature: /Retry|null[0] +object Retry { + // CHECK: + // Mangled name: Retry.Builder + // Public signature: /Retry.Builder|null[0] + class Builder { + // CHECK: + // Mangled name: Retry.Builder{}action + // Public signature: /Retry.Builder.action|4099104176676099950[0] + private val action: SuspendFunction0 + // CHECK JVM_IR: + // Mangled name: Retry.Builder#(){}kotlin.coroutines.SuspendFunction0<1:0> + // Public signature: /Retry.Builder.action.|964998313822025976[0] + // CHECK JS_IR NATIVE: + // Mangled name: Retry.Builder#(){} + // Public signature: /Retry.Builder.action.|-746708740124539440[0] + private get + + // CHECK: + // Mangled name: Retry.Builder#(kotlin.coroutines.SuspendFunction0<1:0>){} + // Public signature: /Retry.Builder.|-2550942884229678400[0] + constructor(action: SuspendFunction0) /* primary */ + + } + + // CHECK: + // Mangled name: Retry#(){} + // Public signature: /Retry.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Retry#withExponentialBackoff(kotlin.Function0<0:0>){0§}Retry.Builder<0:0> + // Public signature: /Retry.withExponentialBackoff|788887164644835500[0] + // CHECK JS_IR NATIVE: + // Mangled name: Retry#withExponentialBackoff(kotlin.Function0<0:0>){0§} + // Public signature: /Retry.withExponentialBackoff|2683495208928755568[0] + fun withExponentialBackoff(action: Function0): Builder + +} diff --git a/compiler/testData/ir/irText/firProblems/V8ArrayToList.sig.kt.txt b/compiler/testData/ir/irText/firProblems/V8ArrayToList.sig.kt.txt new file mode 100644 index 00000000000..3544cb968a2 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/V8ArrayToList.sig.kt.txt @@ -0,0 +1,16 @@ +// CHECK: +// Mangled name: V8Array +// Public signature: /V8Array|null[0] +class V8Array { + // CHECK: + // Mangled name: V8Array#(){} + // Public signature: /V8Array.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +fun box(): String + diff --git a/compiler/testData/ir/irText/firProblems/VarInInit.sig.kt.txt b/compiler/testData/ir/irText/firProblems/VarInInit.sig.kt.txt new file mode 100644 index 00000000000..5ecf0d4e1c4 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/VarInInit.sig.kt.txt @@ -0,0 +1,27 @@ +// CHECK: +// Mangled name: Some +// Public signature: /Some|null[0] +class Some { + // CHECK: + // Mangled name: Some{}foo + // Public signature: /Some.foo|1688079488202778848[0] + var foo: Int + // CHECK JVM_IR: + // Mangled name: Some#(){}kotlin.Int + // Public signature: /Some.foo.|-5521901919061670077[0] + // CHECK JS_IR NATIVE: + // Mangled name: Some#(){} + // Public signature: /Some.foo.|-2462361841367688099[0] + get + // CHECK: + // Mangled name: Some#(kotlin.Int){} + // Public signature: /Some.foo.|3461873232640801433[0] + set + + // CHECK: + // Mangled name: Some#(kotlin.Int){} + // Public signature: /Some.|-5182794243525578284[0] + constructor(foo: Int) /* primary */ + +} + diff --git a/compiler/testData/ir/irText/firProblems/VarargIntegerLiteral.sig.kt.txt b/compiler/testData/ir/irText/firProblems/VarargIntegerLiteral.sig.kt.txt new file mode 100644 index 00000000000..2a482bdae1f --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/VarargIntegerLiteral.sig.kt.txt @@ -0,0 +1,37 @@ +// CHECK: +// Mangled name: #arrayData(kotlin.Array...;kotlin.Function1,kotlin.Unit>){0§>} +// Public signature: /arrayData|8117169174787452654[0] +fun > arrayData(vararg values: T, toArray: @ExtensionFunctionType Function1, Unit>): Unit + +// CHECK: +// Mangled name: #arrayLongInheritedData(kotlin.Array...;kotlin.Function1,kotlin.Unit>){0§} +// Public signature: /arrayLongInheritedData|7935982938453772037[0] +fun arrayLongInheritedData(vararg values: T, toArray: @ExtensionFunctionType Function1, Unit>): Unit + +// CHECK: +// Mangled name: #arrayOfLongData(kotlin.LongArray...;kotlin.Function1,kotlin.Unit>){} +// Public signature: /arrayOfLongData|-2929474358277942763[0] +fun arrayOfLongData(vararg values: Long, toArray: @ExtensionFunctionType Function1, Unit>): Unit + +// CHECK: +// Mangled name: #arrayOfShortData(kotlin.ShortArray...;kotlin.Function1,kotlin.Unit>){} +// Public signature: /arrayOfShortData|-7325619972814797178[0] +fun arrayOfShortData(vararg values: Short, toArray: @ExtensionFunctionType Function1, Unit>): Unit + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +// CHECK JS_IR NATIVE: +// Mangled name: #box(){} +// Public signature: /box|2173511048851971368[0] +fun box(): String + +// CHECK: +// Mangled name: #longArrayData(kotlin.LongArray...;kotlin.Function1){} +// Public signature: /longArrayData|6251465179130826600[0] +fun longArrayData(vararg values: Long, toArray: @ExtensionFunctionType Function1): Unit + +// CHECK: +// Mangled name: #shortArrayData(kotlin.ShortArray...;kotlin.Function1){} +// Public signature: /shortArrayData|4891730698858661609[0] +fun shortArrayData(vararg values: Short, toArray: @ExtensionFunctionType Function1): Unit diff --git a/compiler/testData/ir/irText/firProblems/candidateSymbol.sig.kt.txt b/compiler/testData/ir/irText/firProblems/candidateSymbol.sig.kt.txt new file mode 100644 index 00000000000..430f31fc762 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/candidateSymbol.sig.kt.txt @@ -0,0 +1,100 @@ +// CHECK: +// Mangled name: AbstractFirBasedSymbol +// Public signature: /AbstractFirBasedSymbol|null[0] +abstract class AbstractFirBasedSymbol where E : FirDeclaration, E : FirSymbolOwner { + // CHECK: + // Mangled name: AbstractFirBasedSymbol{}fir + // Public signature: /AbstractFirBasedSymbol.fir|1746130073614419861[0] + lateinit var fir: E + // CHECK JVM_IR: + // Mangled name: AbstractFirBasedSymbol#(){}1:0 + // Public signature: /AbstractFirBasedSymbol.fir.|-6624502324313406460[0] + // CHECK JS_IR NATIVE: + // Mangled name: AbstractFirBasedSymbol#(){} + // Public signature: /AbstractFirBasedSymbol.fir.|1707733779722107125[0] + get + // CHECK: + // Mangled name: AbstractFirBasedSymbol#(1:0){} + // Public signature: /AbstractFirBasedSymbol.fir.|3965135793336265915[0] + set + + // CHECK: + // Mangled name: AbstractFirBasedSymbol#(){} + // Public signature: /AbstractFirBasedSymbol.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: Candidate +// Public signature: /Candidate|null[0] +class Candidate { + // CHECK: + // Mangled name: Candidate{}symbol + // Public signature: /Candidate.symbol|-2022127689160258603[0] + val symbol: AbstractFirBasedSymbol<*> + // CHECK JVM_IR: + // Mangled name: Candidate#(){}AbstractFirBasedSymbol<*> + // Public signature: /Candidate.symbol.|-1417251974778824167[0] + // CHECK JS_IR NATIVE: + // Mangled name: Candidate#(){} + // Public signature: /Candidate.symbol.|-1453516714111318019[0] + get + + // CHECK: + // Mangled name: Candidate#(AbstractFirBasedSymbol<*>){} + // Public signature: /Candidate.|8793240427329821773[0] + constructor(symbol: AbstractFirBasedSymbol<*>) /* primary */ + +} + +// CHECK: +// Mangled name: FirCallableMemberDeclaration +// Public signature: /FirCallableMemberDeclaration|null[0] +interface FirCallableMemberDeclaration> : FirDeclaration, FirSymbolOwner { + + // CHECK: + // Mangled name: FirCallableMemberDeclaration{}symbol + // Public signature: /FirCallableMemberDeclaration.symbol|-2022127689160258603[0] + abstract override val symbol: AbstractFirBasedSymbol + // CHECK JVM_IR: + // Mangled name: FirCallableMemberDeclaration#(){}AbstractFirBasedSymbol<1:0> + // Public signature: /FirCallableMemberDeclaration.symbol.|-2189475889945454446[0] + // CHECK JS_IR NATIVE: + // Mangled name: FirCallableMemberDeclaration#(){} + // Public signature: /FirCallableMemberDeclaration.symbol.|-1453516714111318019[0] + abstract override get + +} + +// CHECK: +// Mangled name: FirDeclaration +// Public signature: /FirDeclaration|null[0] +interface FirDeclaration { + +} + +// CHECK: +// Mangled name: FirSymbolOwner +// Public signature: /FirSymbolOwner|null[0] +interface FirSymbolOwner where E : FirDeclaration, E : FirSymbolOwner { + + // CHECK: + // Mangled name: FirSymbolOwner{}symbol + // Public signature: /FirSymbolOwner.symbol|-2022127689160258603[0] + abstract val symbol: AbstractFirBasedSymbol + // CHECK JVM_IR: + // Mangled name: FirSymbolOwner#(){}AbstractFirBasedSymbol<1:0> + // Public signature: /FirSymbolOwner.symbol.|-2189475889945454446[0] + // CHECK JS_IR NATIVE: + // Mangled name: FirSymbolOwner#(){} + // Public signature: /FirSymbolOwner.symbol.|-1453516714111318019[0] + abstract get + +} + +// CHECK: +// Mangled name: #foo(Candidate){} +// Public signature: /foo|1785536575582425549[0] +fun foo(candidate: Candidate): Unit + diff --git a/compiler/testData/ir/irText/firProblems/cannotCastToFunction.sig.kt.txt b/compiler/testData/ir/irText/firProblems/cannotCastToFunction.sig.kt.txt new file mode 100644 index 00000000000..a35166fad48 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/cannotCastToFunction.sig.kt.txt @@ -0,0 +1,35 @@ +// CHECK: +// Mangled name: IrElement +// Public signature: /IrElement|null[0] +open class IrElement { + // CHECK: + // Mangled name: IrElement#(){} + // Public signature: /IrElement.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #dump@IrElement(kotlin.Boolean;kotlin.Boolean){}kotlin.String +// Public signature: /dump|-3225440066498389487[0] +// CHECK JS_IR NATIVE: +// Mangled name: #dump@IrElement(kotlin.Boolean;kotlin.Boolean){} +// Public signature: /dump|773530586679184317[0] +fun IrElement.dump(normalizeNames: Boolean, stableOrder: Boolean): String + +// CHECK JVM_IR: +// Mangled name: #dump(IrElement;kotlin.String){}kotlin.String +// Public signature: /dump|2660497428954829765[0] +// CHECK JS_IR NATIVE: +// Mangled name: #dump(IrElement;kotlin.String){} +// Public signature: /dump|4886700334642684742[0] +fun dump(data: IrElement, dumpStrategy: String): String + +// CHECK JVM_IR: +// Mangled name: #dumpKotlinLike@IrElement(kotlin.String){}kotlin.String +// Public signature: /dumpKotlinLike|4178458168806795646[0] +// CHECK JS_IR NATIVE: +// Mangled name: #dumpKotlinLike@IrElement(kotlin.String){} +// Public signature: /dumpKotlinLike|-2371556323569177260[0] +fun IrElement.dumpKotlinLike(options: String): String + diff --git a/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.kt b/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.kt index 73c3cb3f204..cb9bb3a8926 100644 --- a/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.kt +++ b/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.kt @@ -1,6 +1,10 @@ // TARGET_BACKEND: JVM // WITH_STDLIB // FULL_JDK + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57778 + import java.io.Reader import java.io.StringReader diff --git a/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.sig.kt.txt b/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.sig.kt.txt new file mode 100644 index 00000000000..d1659b3792f --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.sig.kt.txt @@ -0,0 +1,19 @@ +// CHECK: +// Mangled name: #consumeRestOfQuotedSequence@java.io.Reader(java.lang.StringBuilder;kotlin.Char){} +// Public signature: /consumeRestOfQuotedSequence|-9181202314719024538[0] +fun Reader.consumeRestOfQuotedSequence(sb: StringBuilder, quote: Char): Unit + +// CHECK JVM_IR: +// Mangled name: #nextChar@java.io.Reader(){}kotlin.Char? +// Public signature: [ File 'coercionToUnitForNestedWhen.kt' <- /nextChar|8697099457416866690[0] ] +private fun Reader.nextChar(): Char? + +// CHECK: +// Mangled name: {}BACKSLASH +// Public signature: [ File 'coercionToUnitForNestedWhen.kt' <- /BACKSLASH|9213821134505379379[0] ] +private const val BACKSLASH: Char + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Char + // Public signature: [ File 'coercionToUnitForNestedWhen.kt' <- /BACKSLASH.|7174062972088453102[0] ] + private get + diff --git a/compiler/testData/ir/irText/firProblems/dataObject.sig.kt.txt b/compiler/testData/ir/irText/firProblems/dataObject.sig.kt.txt new file mode 100644 index 00000000000..205834f3146 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/dataObject.sig.kt.txt @@ -0,0 +1,33 @@ +// CHECK: +// Mangled name: DataObject +// Public signature: /DataObject|null[0] +data object DataObject { + // CHECK: + // Mangled name: DataObject#(){} + // Public signature: /DataObject.|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK JVM_IR: + // Mangled name: DataObject#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /DataObject.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: DataObject#equals(kotlin.Any?){} + // Public signature: /DataObject.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: DataObject#hashCode(){}kotlin.Int + // Public signature: /DataObject.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: DataObject#hashCode(){} + // Public signature: /DataObject.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: DataObject#toString(){}kotlin.String + // Public signature: /DataObject.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: DataObject#toString(){} + // Public signature: /DataObject.toString|-1522858123163872138[0] + override fun toString(): String + +} diff --git a/compiler/testData/ir/irText/firProblems/deprecated.sig.kt.txt b/compiler/testData/ir/irText/firProblems/deprecated.sig.kt.txt new file mode 100644 index 00000000000..10038714b84 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/deprecated.sig.kt.txt @@ -0,0 +1,24 @@ +// CHECK JVM_IR: +// Mangled name: #create(){}kotlin.String +// Public signature: /create|-1557561735696060682[0] +// CHECK JS_IR NATIVE: +// Mangled name: #create(){} +// Public signature: /create|9033430362705119523[0] +fun create(): String + +// CHECK JVM_IR: +// Mangled name: #create(kotlin.Boolean){}kotlin.String +// Public signature: /create|-3400482347981983007[0] +// CHECK JS_IR NATIVE: +// Mangled name: #create(kotlin.Boolean){} +// Public signature: /create|-2263398152642299020[0] +fun create(b: Boolean): String + +// CHECK JVM_IR: +// Mangled name: #create(kotlin.String){}kotlin.String +// Public signature: /create|-6120250208000719461[0] +// CHECK JS_IR NATIVE: +// Mangled name: #create(kotlin.String){} +// Public signature: /create|-5890518877103900297[0] +fun create(s: String): String + diff --git a/compiler/testData/ir/irText/firProblems/emptyWhen.sig.kt.txt b/compiler/testData/ir/irText/firProblems/emptyWhen.sig.kt.txt new file mode 100644 index 00000000000..5deb343fa79 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/emptyWhen.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #foo(){} +// Public signature: /foo|-1041209573719867811[0] +fun foo(): Unit + diff --git a/compiler/testData/ir/irText/firProblems/functionLiteralGenericSignature.sig.kt.txt b/compiler/testData/ir/irText/firProblems/functionLiteralGenericSignature.sig.kt.txt new file mode 100644 index 00000000000..7fbff04fb49 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/functionLiteralGenericSignature.sig.kt.txt @@ -0,0 +1,72 @@ +// CHECK: +// Mangled name: {}unitFun +// Public signature: /unitFun|1803856459034755718[0] +val unitFun: Function0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function0 + // Public signature: /unitFun.|4532865110110179705[0] + get + +// CHECK: +// Mangled name: {}intFun +// Public signature: /intFun|-4231876274735497813[0] +val intFun: Function0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function0 + // Public signature: /intFun.|4773158348447143883[0] + get + +// CHECK: +// Mangled name: {}stringParamFun +// Public signature: /stringParamFun|-5263284220838449603[0] +val stringParamFun: Function1 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function1 + // Public signature: /stringParamFun.|-8573380628772791229[0] + get + +// CHECK: +// Mangled name: {}listFun +// Public signature: /listFun|-6618675779589745857[0] +val listFun: Function1, List> + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function1,kotlin.collections.List> + // Public signature: /listFun.|7260954818086257860[0] + get + +// CHECK: +// Mangled name: {}mutableListFun +// Public signature: /mutableListFun|-8439106206370668738[0] +val mutableListFun: Function1, MutableList> + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function1,kotlin.collections.MutableList> + // Public signature: /mutableListFun.|9091514786956715938[0] + get + +// CHECK: +// Mangled name: {}funWithIn +// Public signature: /funWithIn|4959168396602064196[0] +val funWithIn: Function1, Unit> + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function1,kotlin.Unit> + // Public signature: /funWithIn.|4348549724742549414[0] + get + +// CHECK: +// Mangled name: {}extensionFun +// Public signature: /extensionFun|-1816227375732956320[0] +val extensionFun: @ExtensionFunctionType Function1 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function1 + // Public signature: /extensionFun.|791135109431325135[0] + get + +// CHECK: +// Mangled name: {}extensionWithArgFun +// Public signature: /extensionWithArgFun|2301069184471380148[0] +val extensionWithArgFun: @ExtensionFunctionType Function2 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function2 + // Public signature: /extensionWithArgFun.|-6412543642125871211[0] + get + diff --git a/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.sig.kt.txt b/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.sig.kt.txt new file mode 100644 index 00000000000..f7a84936039 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.sig.kt.txt @@ -0,0 +1,43 @@ +// CHECK: +// Mangled name: Flaf +// Public signature: /Flaf|null[0] +class Flaf { + // CHECK: + // Mangled name: Flaf{}javaName + // Public signature: /Flaf.javaName|-8684515170534215532[0] + val javaName: String + // CHECK JVM_IR: + // Mangled name: Flaf#(){}kotlin.String + // Public signature: /Flaf.javaName.|-917464454700477406[0] + // CHECK JS_IR NATIVE: + // Mangled name: Flaf#(){} + // Public signature: /Flaf.javaName.|1070493169031219158[0] + get + + // CHECK: + // Mangled name: Flaf{}INSTANCES + // Public signature: /Flaf.INSTANCES|1897835723956041094[0] + private val INSTANCES: MutableMap + // CHECK JVM_IR: + // Mangled name: Flaf#(){}kotlin.collections.MutableMap + // Public signature: /Flaf.INSTANCES.|-852664816279800923[0] + // CHECK JS_IR NATIVE: + // Mangled name: Flaf#(){} + // Public signature: /Flaf.INSTANCES.|7621104418939940009[0] + private get + + // CHECK: + // Mangled name: Flaf#(kotlin.String){} + // Public signature: /Flaf.|1280618353163213788[0] + constructor(javaName: String) /* primary */ + + // CHECK JVM_IR: + // Mangled name: Flaf#forJavaName(kotlin.String){}Flaf + // Public signature: /Flaf.forJavaName|5746555906334011497[0] + // CHECK JS_IR NATIVE: + // Mangled name: Flaf#forJavaName(kotlin.String){} + // Public signature: /Flaf.forJavaName|-6191380422625646968[0] + fun forJavaName(javaName: String): Flaf + +} + diff --git a/compiler/testData/ir/irText/firProblems/integerLiteralWithExpectedTypealiasType.sig.kt.txt b/compiler/testData/ir/irText/firProblems/integerLiteralWithExpectedTypealiasType.sig.kt.txt new file mode 100644 index 00000000000..7ba8b8a8392 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/integerLiteralWithExpectedTypealiasType.sig.kt.txt @@ -0,0 +1,20 @@ +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +// CHECK JS_IR NATIVE: +// Mangled name: #box(){} +// Public signature: /box|2173511048851971368[0] +fun box(): String + +// CHECK JVM_IR: +// Mangled name: #foo(kotlin.Long){}kotlin.String +// Public signature: /foo|2242291574308227467[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo(kotlin.Long){} +// Public signature: /foo|1078915626370986218[0] +fun foo(l: Long): String + +// CHECK: +// Mangled name: MyLong +// Public signature: /MyLong|null[0] +typealias MyLong = Long diff --git a/compiler/testData/ir/irText/firProblems/internalPotentialFakeOverride.sig.kt.txt b/compiler/testData/ir/irText/firProblems/internalPotentialFakeOverride.sig.kt.txt new file mode 100644 index 00000000000..a6bb76de92e --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/internalPotentialFakeOverride.sig.kt.txt @@ -0,0 +1,42 @@ +// MODULE: m1 +// FILE: A.kt + +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +open class A { + // CHECK: + // Mangled name: A{}bar + // Public signature: /A.bar|-7864284097863469857[0] + internal open val bar: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.bar.|-7403724005139201014[0] + internal open get + + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: A#foo(){}kotlin.Int + // Public signature: /A.foo|-1256155405684507276[0] + internal open fun foo(): Int + +} + +// MODULE: m2 +// FILE: B.kt + +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +class B : A { + // CHECK: + // Mangled name: B#(){} + // Public signature: /B.|-5645683436151566731[0] + constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/firProblems/internalPotentialOverride.sig.kt.txt b/compiler/testData/ir/irText/firProblems/internalPotentialOverride.sig.kt.txt new file mode 100644 index 00000000000..4627aa31ffc --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/internalPotentialOverride.sig.kt.txt @@ -0,0 +1,56 @@ +// MODULE: m1 +// FILE: A.kt + +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +open class A { + // CHECK: + // Mangled name: A{}bar + // Public signature: /A.bar|-7864284097863469857[0] + internal open val bar: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.bar.|-7403724005139201014[0] + internal open get + + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: A#foo(){}kotlin.Int + // Public signature: /A.foo|-1256155405684507276[0] + internal open fun foo(): Int + +} + +// MODULE: m2 +// FILE: B.kt + +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +class B : A { + // CHECK: + // Mangled name: B{}bar + // Public signature: /B.bar|-7864284097863469857[0] + val bar: Int + // CHECK JVM_IR: + // Mangled name: B#(){}kotlin.Int + // Public signature: /B.bar.|-7403724005139201014[0] + get + + // CHECK: + // Mangled name: B#(){} + // Public signature: /B.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: B#foo(){}kotlin.String + // Public signature: /B.foo|485335955883620819[0] + fun foo(): String + +} + diff --git a/compiler/testData/ir/irText/firProblems/kt19251.sig.kt.txt b/compiler/testData/ir/irText/firProblems/kt19251.sig.kt.txt new file mode 100644 index 00000000000..1646a91a536 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/kt19251.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +fun box(): String + diff --git a/compiler/testData/ir/irText/firProblems/kt43342.kt b/compiler/testData/ir/irText/firProblems/kt43342.kt index 2ddee9d703e..cd7eb2426a2 100644 --- a/compiler/testData/ir/irText/firProblems/kt43342.kt +++ b/compiler/testData/ir/irText/firProblems/kt43342.kt @@ -2,6 +2,9 @@ // IGNORE_BACKEND_K2: JS_IR // IGNORE_BACKEND_K2: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429 + open class ControlFlowInfo(val map: Map): Map by map class StringFlowInfo(map: Map): ControlFlowInfo(map) { diff --git a/compiler/testData/ir/irText/firProblems/kt43342.sig.kt.txt b/compiler/testData/ir/irText/firProblems/kt43342.sig.kt.txt new file mode 100644 index 00000000000..1be62895b40 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/kt43342.sig.kt.txt @@ -0,0 +1,209 @@ +// CHECK: +// Mangled name: ControlFlowInfo +// Public signature: /ControlFlowInfo|null[0] +open class ControlFlowInfo : Map { + // CHECK: + // Mangled name: ControlFlowInfo{}map + // Public signature: /ControlFlowInfo.map|7076745113644856434[0] + val map: Map + // CHECK JVM_IR: + // Mangled name: ControlFlowInfo#(){}kotlin.collections.Map<1:0,1:1> + // Public signature: /ControlFlowInfo.map.|2022038978683679846[0] + // CHECK JS_IR NATIVE: + // Mangled name: ControlFlowInfo#(){} + // Public signature: /ControlFlowInfo.map.|4042543427940588392[0] + get + + // CHECK: + // Mangled name: ControlFlowInfo#(kotlin.collections.Map<1:0,1:1>){} + // Public signature: /ControlFlowInfo.|2293537713863886898[0] + constructor(map: Map) /* primary */ + // CHECK JVM_IR: + // Mangled name: ControlFlowInfo#containsKey(1:0){}kotlin.Boolean + // Public signature: /ControlFlowInfo.containsKey|-2697616884574929105[0] + // CHECK JS_IR NATIVE: + // Mangled name: ControlFlowInfo#containsKey(1:0){} + // Public signature: /ControlFlowInfo.containsKey|4378783437577239715[0] + override fun containsKey(key: K): Boolean + + // CHECK JVM_IR: + // Mangled name: ControlFlowInfo#containsValue(1:1){}kotlin.Boolean + // Public signature: /ControlFlowInfo.containsValue|4814293423579408279[0] + // CHECK JS_IR NATIVE: + // Mangled name: ControlFlowInfo#containsValue(1:1){} + // Public signature: /ControlFlowInfo.containsValue|4662958731902362185[0] + override fun containsValue(value: V): Boolean + + // CHECK JVM_IR: + // Mangled name: ControlFlowInfo#get(1:0){}1:1? + // Public signature: /ControlFlowInfo.get|-2177239518810968262[0] + // CHECK JS_IR NATIVE: + // Mangled name: ControlFlowInfo#get(1:0){} + // Public signature: /ControlFlowInfo.get|3042887604952512631[0] + override operator fun get(key: K): V? + + // CHECK JVM_IR: + // Mangled name: ControlFlowInfo#isEmpty(){}kotlin.Boolean + // Public signature: /ControlFlowInfo.isEmpty|-626562167393617703[0] + // CHECK JS_IR NATIVE: + // Mangled name: ControlFlowInfo#isEmpty(){} + // Public signature: /ControlFlowInfo.isEmpty|-412363028532554867[0] + override fun isEmpty(): Boolean + + // CHECK: + // Mangled name: ControlFlowInfo{}entries + // Public signature: /ControlFlowInfo.entries|-586096469347622282[0] + override val entries: Set> + // CHECK JVM_IR: + // Mangled name: ControlFlowInfo#(){}kotlin.collections.Set> + // Public signature: /ControlFlowInfo.entries.|-1963460919948819548[0] + // CHECK JS_IR NATIVE: + // Mangled name: ControlFlowInfo#(){} + // Public signature: /ControlFlowInfo.entries.|-3918723658541822269[0] + override get(): Set> + + // CHECK: + // Mangled name: ControlFlowInfo{}keys + // Public signature: /ControlFlowInfo.keys|-1539062068328255324[0] + override val keys: Set + // CHECK JVM_IR: + // Mangled name: ControlFlowInfo#(){}kotlin.collections.Set<1:0> + // Public signature: /ControlFlowInfo.keys.|4915091794204623606[0] + // CHECK JS_IR NATIVE: + // Mangled name: ControlFlowInfo#(){} + // Public signature: /ControlFlowInfo.keys.|-8185182219094674588[0] + override get(): Set + + // CHECK: + // Mangled name: ControlFlowInfo{}size + // Public signature: /ControlFlowInfo.size|-6253659984320132064[0] + override val size: Int + // CHECK JVM_IR: + // Mangled name: ControlFlowInfo#(){}kotlin.Int + // Public signature: /ControlFlowInfo.size.|-3941649985161900780[0] + // CHECK JS_IR NATIVE: + // Mangled name: ControlFlowInfo#(){} + // Public signature: /ControlFlowInfo.size.|-8255337774232345969[0] + override get(): Int + + // CHECK: + // Mangled name: ControlFlowInfo{}values + // Public signature: /ControlFlowInfo.values|-764749005844117249[0] + override val values: Collection + // CHECK JVM_IR: + // Mangled name: ControlFlowInfo#(){}kotlin.collections.Collection<1:1> + // Public signature: /ControlFlowInfo.values.|-8281927905891735092[0] + // CHECK JS_IR NATIVE: + // Mangled name: ControlFlowInfo#(){} + // Public signature: /ControlFlowInfo.values.|2932041455850412365[0] + override get(): Collection + +} + +// CHECK: +// Mangled name: StringFlowInfo +// Public signature: /StringFlowInfo|null[0] +class StringFlowInfo : ControlFlowInfo { + // CHECK: + // Mangled name: StringFlowInfo#(kotlin.collections.Map){} + // Public signature: /StringFlowInfo.|4094084879849523083[0] + constructor(map: Map) /* primary */ + // CHECK JVM_IR: + // Mangled name: StringFlowInfo#containsKey(kotlin.String){}kotlin.Boolean + // Public signature: /StringFlowInfo.containsKey|8275396622473115435[0] + // CHECK JS_IR NATIVE: + // Mangled name: StringFlowInfo#containsKey(kotlin.String){} + // Public signature: /StringFlowInfo.containsKey|3677836291003130742[0] + /* fake */ override fun containsKey(key: String): Boolean + + // CHECK JVM_IR: + // Mangled name: StringFlowInfo#containsValue(kotlin.String){}kotlin.Boolean + // Public signature: /StringFlowInfo.containsValue|-5705743499860588066[0] + // CHECK JS_IR NATIVE: + // Mangled name: StringFlowInfo#containsValue(kotlin.String){} + // Public signature: /StringFlowInfo.containsValue|-5079298258943426686[0] + /* fake */ override fun containsValue(value: String): Boolean + + // CHECK JVM_IR: + // Mangled name: StringFlowInfo#get(kotlin.String){}kotlin.String? + // Public signature: /StringFlowInfo.get|3520886730483549601[0] + // CHECK JS_IR NATIVE: + // Mangled name: StringFlowInfo#get(kotlin.String){} + // Public signature: /StringFlowInfo.get|-2844435113185872994[0] + /* fake */ override operator fun get(key: String): String? + + // CHECK JVM_IR: + // Mangled name: StringFlowInfo#isEmpty(){}kotlin.Boolean + // Public signature: /StringFlowInfo.isEmpty|-626562167393617703[0] + // CHECK JS_IR NATIVE: + // Mangled name: StringFlowInfo#isEmpty(){} + // Public signature: /StringFlowInfo.isEmpty|-412363028532554867[0] + /* fake */ override fun isEmpty(): Boolean + + // CHECK: + // Mangled name: StringFlowInfo#foo(StringFlowInfo){} + // Public signature: /StringFlowInfo.foo|-2258477714905003543[0] + fun foo(info: StringFlowInfo): Unit + + // CHECK: + // Mangled name: StringFlowInfo{}entries + // Public signature: /StringFlowInfo.entries|-586096469347622282[0] + /* fake */ override val entries: Set> + // CHECK JVM_IR: + // Mangled name: StringFlowInfo#(){}kotlin.collections.Set> + // Public signature: /StringFlowInfo.entries.|2415846673528417847[0] + // CHECK JS_IR NATIVE: + // Mangled name: StringFlowInfo#(){} + // Public signature: /StringFlowInfo.entries.|-3918723658541822269[0] + /* fake */ override get(): Set> + + // CHECK: + // Mangled name: StringFlowInfo{}keys + // Public signature: /StringFlowInfo.keys|-1539062068328255324[0] + /* fake */ override val keys: Set + // CHECK JVM_IR: + // Mangled name: StringFlowInfo#(){}kotlin.collections.Set + // Public signature: /StringFlowInfo.keys.|5348512610294911590[0] + // CHECK JS_IR NATIVE: + // Mangled name: StringFlowInfo#(){} + // Public signature: /StringFlowInfo.keys.|-8185182219094674588[0] + /* fake */ override get(): Set + + // CHECK: + // Mangled name: StringFlowInfo{}map + // Public signature: /StringFlowInfo.map|7076745113644856434[0] + /* fake */ override val map: Map + // CHECK JVM_IR: + // Mangled name: StringFlowInfo#(){}kotlin.collections.Map + // Public signature: /StringFlowInfo.map.|-5304991006392731398[0] + // CHECK JS_IR NATIVE: + // Mangled name: StringFlowInfo#(){} + // Public signature: /StringFlowInfo.map.|4042543427940588392[0] + /* fake */ override get(): Map + + // CHECK: + // Mangled name: StringFlowInfo{}size + // Public signature: /StringFlowInfo.size|-6253659984320132064[0] + /* fake */ override val size: Int + // CHECK JVM_IR: + // Mangled name: StringFlowInfo#(){}kotlin.Int + // Public signature: /StringFlowInfo.size.|-3941649985161900780[0] + // CHECK JS_IR NATIVE: + // Mangled name: StringFlowInfo#(){} + // Public signature: /StringFlowInfo.size.|-8255337774232345969[0] + /* fake */ override get(): Int + + // CHECK: + // Mangled name: StringFlowInfo{}values + // Public signature: /StringFlowInfo.values|-764749005844117249[0] + /* fake */ override val values: Collection + // CHECK JVM_IR: + // Mangled name: StringFlowInfo#(){}kotlin.collections.Collection + // Public signature: /StringFlowInfo.values.|-4605576396649500879[0] + // CHECK JS_IR NATIVE: + // Mangled name: StringFlowInfo#(){} + // Public signature: /StringFlowInfo.values.|2932041455850412365[0] + /* fake */ override get(): Collection + +} + diff --git a/compiler/testData/ir/irText/firProblems/kt55458.kt b/compiler/testData/ir/irText/firProblems/kt55458.kt index 2e91429396a..0648094e097 100644 --- a/compiler/testData/ir/irText/firProblems/kt55458.kt +++ b/compiler/testData/ir/irText/firProblems/kt55458.kt @@ -2,6 +2,9 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57755 + fun main() { val (a: Any, _) = 1 to 2 println(a) diff --git a/compiler/testData/ir/irText/firProblems/kt55458.sig.kt.txt b/compiler/testData/ir/irText/firProblems/kt55458.sig.kt.txt new file mode 100644 index 00000000000..8e517c07941 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/kt55458.sig.kt.txt @@ -0,0 +1,9 @@ +// CHECK JVM_IR: +// Mangled name computed from Ir: #main(){} +// Mangled name computed from Descriptor: #main(){}%kt55458.kt +// Public signature: /main|-1793468409000137506[0] +// CHECK JS_IR NATIVE: +// Mangled name: #main(){} +// Public signature: /main|-4284757841571462650[0] +fun main(): Unit + diff --git a/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.kt b/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.kt index 00d134cb5e8..aadac089a9b 100644 --- a/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.kt +++ b/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.kt @@ -1,7 +1,12 @@ // WITH_STDLIB +// DUMP_LOCAL_DECLARATION_SIGNATURES // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 // KT-50774 + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57427, KT-57754 + class Wrapper(var baseUrl: String) enum class ConfigurationParameter { diff --git a/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.sig.kt.txt b/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.sig.kt.txt new file mode 100644 index 00000000000..c35f48c3ab8 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.sig.kt.txt @@ -0,0 +1,136 @@ +// CHECK: +// Mangled name: Wrapper +// Public signature: /Wrapper|null[0] +class Wrapper { + // CHECK: + // Mangled name: Wrapper{}baseUrl + // Public signature: /Wrapper.baseUrl|8725729733335673706[0] + var baseUrl: String + field + // CHECK JVM_IR: + // Mangled name: Wrapper#(){}kotlin.String + // Public signature: /Wrapper.baseUrl.|-3814925406424189958[0] + // CHECK JS_IR NATIVE: + // Mangled name: Wrapper#(){} + // Public signature: /Wrapper.baseUrl.|-5017063075718914624[0] + get + // CHECK: + // Mangled name: Wrapper#(kotlin.String){} + // Public signature: /Wrapper.baseUrl.|-3147657826477490604[0] + set + + // CHECK: + // Mangled name: Wrapper#(kotlin.String){} + // Public signature: /Wrapper.|1280618353163213788[0] + constructor(baseUrl: String) /* primary */ + +} + +// CHECK: +// Mangled name: ConfigurationParameter +// Public signature: /ConfigurationParameter|null[0] +enum class ConfigurationParameter : Enum { + // CHECK: + // Mangled name: ConfigurationParameter#(kotlin.Function2){} + // Public signature: /ConfigurationParameter.|-5590500836156829531[0] + private constructor(apply: Function2) + // CHECK: + // Mangled name: ConfigurationParameter.BASE_URL + // Public signature: /ConfigurationParameter.BASE_URL|null[0] + BASE_URL + // CHECK: + // Mangled name computed from Ir: ConfigurationParameter##static(kotlin.String;Wrapper){} + // Mangled name computed from Descriptor: ConfigurationParameter.BASE_URL#(){}##static(kotlin.String;Wrapper){} + local fun (value: String, nc: Wrapper): Unit + + // CHECK JVM_IR: + // Mangled name: ConfigurationParameter#valueOf#static(kotlin.String){}ConfigurationParameter + // Public signature: /ConfigurationParameter.valueOf|4681288256259957260[0] + // CHECK JS_IR NATIVE: + // Mangled name: ConfigurationParameter#valueOf#static(kotlin.String){} + // Public signature: /ConfigurationParameter.valueOf|-4683474617854611729[0] + fun valueOf(value: String): ConfigurationParameter + + // CHECK JVM_IR: + // Mangled name: ConfigurationParameter#values#static(){}kotlin.Array + // Public signature: /ConfigurationParameter.values|-8145439714348067759[0] + // CHECK JS_IR NATIVE: + // Mangled name: ConfigurationParameter#values#static(){} + // Public signature: /ConfigurationParameter.values|-8715569000920726747[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: ConfigurationParameter#clone(){}kotlin.Any + // Public signature: /ConfigurationParameter.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: ConfigurationParameter#compareTo(ConfigurationParameter){} + // Public signature: /ConfigurationParameter.compareTo|1827634897792549080[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: ConfigurationParameter#compareTo(ConfigurationParameter){}kotlin.Int + // Public signature: /ConfigurationParameter.compareTo|-5479522582886187389[0] + // CHECK JS_IR NATIVE: + // Mangled name: ConfigurationParameter#equals(kotlin.Any?){} + // Public signature: /ConfigurationParameter.equals|4638265728071529943[0] + /* fake */ override operator fun compareTo(other: ConfigurationParameter): Int + + // CHECK JVM_IR: + // Mangled name: ConfigurationParameter#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /ConfigurationParameter.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: ConfigurationParameter#hashCode(){} + // Public signature: /ConfigurationParameter.hashCode|3409210261493131192[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: ConfigurationParameter#hashCode(){}kotlin.Int + // Public signature: /ConfigurationParameter.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: ConfigurationParameter#toString(){} + // Public signature: /ConfigurationParameter.toString|-1522858123163872138[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: ConfigurationParameter#toString(){}kotlin.String + // Public signature: /ConfigurationParameter.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: ConfigurationParameter#static{}entries + // Public signature: /ConfigurationParameter.entries|-5134227801081826149[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: ConfigurationParameter#static{}entries + // Public signature: /ConfigurationParameter.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: ConfigurationParameter##static(){}kotlin.enums.EnumEntries + // Public signature: /ConfigurationParameter.entries.|-1947990751381640787[0] + // CHECK JS_IR NATIVE: + // Mangled name: ConfigurationParameter{}name + // Public signature: /ConfigurationParameter.name|4231860309499509769[0] + get(): EnumEntries + + // CHECK: + // Mangled name: ConfigurationParameter{}name + // Public signature: /ConfigurationParameter.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: ConfigurationParameter#(){}kotlin.String + // Public signature: /ConfigurationParameter.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: ConfigurationParameter{}ordinal + // Public signature: /ConfigurationParameter.ordinal|1912745122988592376[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: ConfigurationParameter{}ordinal + // Public signature: /ConfigurationParameter.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: ConfigurationParameter#(){}kotlin.Int + // Public signature: /ConfigurationParameter.ordinal.|-6902664390061762634[0] + /* fake */ override get(): Int + +} + diff --git a/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.kt b/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.kt index 1576ddc5e54..555d8ff1179 100644 --- a/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.kt +++ b/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.kt @@ -1,4 +1,9 @@ // FIR_IDENTICAL +// DUMP_LOCAL_DECLARATION_SIGNATURES + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57430 + fun box(): String { return object { val a = A("OK") diff --git a/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.sig.kt.txt b/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.sig.kt.txt new file mode 100644 index 00000000000..198e7b071cf --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.sig.kt.txt @@ -0,0 +1,57 @@ +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +// CHECK JS_IR NATIVE: +// Mangled name: #box(){} +// Public signature: /box|2173511048851971368[0] +fun box(): String + // CHECK JVM_IR: + // Mangled name: #box(){}kotlin.String. + // CHECK JS_IR NATIVE: + // Mangled name: #box(){}. + local class { + // CHECK JVM_IR: + // Mangled name: #box(){}kotlin.String.{}a + // CHECK JS_IR NATIVE: + // Mangled name: #box(){}.{}a + val a: A + field + // CHECK JVM_IR: + // Mangled name: #box(){}kotlin.String.#(){}#box..A + // CHECK JS_IR NATIVE: + // Mangled name: #box(){}.#(){} + get + + // CHECK JVM_IR: + // Mangled name: #box(){}kotlin.String..A + // CHECK JS_IR NATIVE: + // Mangled name: #box(){}..A + local inner class A { + // CHECK JVM_IR: + // Mangled name: #box(){}kotlin.String..A{}ok + // CHECK JS_IR NATIVE: + // Mangled name: #box(){}..A{}ok + val ok: String + field + // CHECK JVM_IR: + // Mangled name: #box(){}kotlin.String..A#(){}kotlin.String + // CHECK JS_IR NATIVE: + // Mangled name: #box(){}..A#(){} + get + + // CHECK JVM_IR: + // Mangled name: #box(){}kotlin.String..A#(kotlin.String){} + // CHECK JS_IR NATIVE: + // Mangled name: #box(){}..A#(kotlin.String){} + constructor(ok: String) /* primary */ + + } + + // CHECK JVM_IR: + // Mangled name: #box(){}kotlin.String.#(){} + // CHECK JS_IR NATIVE: + // Mangled name: #box(){}.#(){} + constructor() /* primary */ + + } + diff --git a/compiler/testData/ir/irText/firProblems/localCompanion.kt b/compiler/testData/ir/irText/firProblems/localCompanion.kt index 9852a6cb296..f39107e0dad 100644 --- a/compiler/testData/ir/irText/firProblems/localCompanion.kt +++ b/compiler/testData/ir/irText/firProblems/localCompanion.kt @@ -1,4 +1,9 @@ // FIR_IDENTICAL +// DUMP_LOCAL_DECLARATION_SIGNATURES + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57755, KT-57430 + fun main() { class Foo { @Suppress("WRONG_MODIFIER_CONTAINING_DECLARATION") diff --git a/compiler/testData/ir/irText/firProblems/localCompanion.sig.kt.txt b/compiler/testData/ir/irText/firProblems/localCompanion.sig.kt.txt new file mode 100644 index 00000000000..eadf3a01927 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/localCompanion.sig.kt.txt @@ -0,0 +1,45 @@ +// CHECK JVM_IR: +// Mangled name computed from Ir: #main(){} +// Mangled name computed from Descriptor: #main(){}%localCompanion.kt +// Public signature: /main|1798078925369608927[0] +// CHECK JS_IR NATIVE: +// Mangled name: #main(){} +// Public signature: /main|-4284757841571462650[0] +fun main(): Unit + // CHECK JVM_IR: + // Mangled name computed from Ir: #main(){}.Foo + // Mangled name computed from Descriptor: #main(){}%localCompanion.kt.Foo + // CHECK JS_IR NATIVE: + // Mangled name: #main(){}.Foo + local class Foo { + // CHECK JVM_IR: + // Mangled name computed from Ir: #main(){}.Foo.Companion + // Mangled name computed from Descriptor: #main(){}%localCompanion.kt.Foo.Companion + // CHECK JS_IR NATIVE: + // Mangled name: #main(){}.Foo.Companion + local companion object Companion { + // CHECK JVM_IR: + // Mangled name computed from Ir: #main(){}.Foo.Companion#(){} + // Mangled name computed from Descriptor: #main(){}%localCompanion.kt.Foo.Companion#(){} + // CHECK JS_IR NATIVE: + // Mangled name: #main(){}.Foo.Companion#(){} + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name computed from Ir: #main(){}.Foo.Companion#bar(){} + // Mangled name computed from Descriptor: #main(){}%localCompanion.kt.Foo.Companion#bar(){} + // CHECK JS_IR NATIVE: + // Mangled name: #main(){}.Foo.Companion#bar(){} + fun bar(): Unit + + } + + // CHECK JVM_IR: + // Mangled name computed from Ir: #main(){}.Foo#(){} + // Mangled name computed from Descriptor: #main(){}%localCompanion.kt.Foo#(){} + // CHECK JS_IR NATIVE: + // Mangled name: #main(){}.Foo#(){} + constructor() /* primary */ + + } + diff --git a/compiler/testData/ir/irText/firProblems/putIfAbsent.sig.kt.txt b/compiler/testData/ir/irText/firProblems/putIfAbsent.sig.kt.txt new file mode 100644 index 00000000000..3a43af8cd65 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/putIfAbsent.sig.kt.txt @@ -0,0 +1,16 @@ +// CHECK: +// Mangled name: Owner +// Public signature: /Owner|null[0] +class Owner { + // CHECK: + // Mangled name: Owner#(){} + // Public signature: /Owner.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Owner#foo(0:0;0:0){0§} + // Public signature: /Owner.foo|6541897014956795195[0] + fun foo(x: T, y: T): Unit + +} + diff --git a/compiler/testData/ir/irText/firProblems/readWriteProperty.kt b/compiler/testData/ir/irText/firProblems/readWriteProperty.kt index 8c276a7e4a3..70fddc515b7 100644 --- a/compiler/testData/ir/irText/firProblems/readWriteProperty.kt +++ b/compiler/testData/ir/irText/firProblems/readWriteProperty.kt @@ -1,5 +1,9 @@ // WITH_STDLIB // WITH_REFLECT +// DUMP_LOCAL_DECLARATION_SIGNATURES + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429, KT-57430 import kotlin.properties.ReadWriteProperty import kotlin.reflect.KClass diff --git a/compiler/testData/ir/irText/firProblems/readWriteProperty.sig.kt.txt b/compiler/testData/ir/irText/firProblems/readWriteProperty.sig.kt.txt new file mode 100644 index 00000000000..89a7b4ea25d --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/readWriteProperty.sig.kt.txt @@ -0,0 +1,129 @@ +// CHECK: +// Mangled name: IdeWizard +// Public signature: /IdeWizard|null[0] +class IdeWizard { + // CHECK: + // Mangled name: IdeWizard{}projectTemplate + // Public signature: /IdeWizard.projectTemplate|1011078309052725595[0] + var projectTemplate: Int? /* by */ + field + // CHECK JVM_IR: + // Mangled name: IdeWizard#(){}kotlin.Int? + // Public signature: /IdeWizard.projectTemplate.|-8817473698570649998[0] + // CHECK JS_IR NATIVE: + // Mangled name: IdeWizard#(){} + // Public signature: /IdeWizard.projectTemplate.|-3125600217184137732[0] + get(): Int? + // CHECK: + // Mangled name: IdeWizard#(kotlin.Int?){} + // Public signature: /IdeWizard.projectTemplate.|7033237300104161042[0] + set(: Int?): Unit + + // CHECK: + // Mangled name: IdeWizard#(){} + // Public signature: /IdeWizard.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: IdeWizard#setting(SettingReference<0:0,0:1>){0§;1§>}IdeWizard#setting.<0:0,0:1> + // Public signature: /IdeWizard.setting|-3504445808823548764[0] + // CHECK JS_IR NATIVE: + // Mangled name: IdeWizard#setting(SettingReference<0:0,0:1>){0§;1§>} + // Public signature: /IdeWizard.setting|2630265268614068431[0] + private fun > setting(reference: SettingReference): + // CHECK JVM_IR: + // Mangled name: IdeWizard#setting(SettingReference<1:0,1:1>){0§;1§>}IdeWizard#setting.<1:0,1:1>. + // CHECK JS_IR NATIVE: + // Mangled name: IdeWizard#setting(SettingReference<1:0,1:1>){0§;1§>}. + local class : ReadWriteProperty { + // CHECK JVM_IR: + // Mangled name: IdeWizard#setting(SettingReference<2:0,2:1>){0§;1§>}IdeWizard#setting.<2:0,2:1>.#(){} + // CHECK JS_IR NATIVE: + // Mangled name: IdeWizard#setting(SettingReference<2:0,2:1>){0§;1§>}.#(){} + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: IdeWizard#setting(SettingReference<2:0,2:1>){0§;1§>}IdeWizard#setting.<2:0,2:1>.#getValue(kotlin.Any?;kotlin.reflect.KProperty<*>){}2:0? + // CHECK JS_IR NATIVE: + // Mangled name: IdeWizard#setting(SettingReference<2:0,2:1>){0§;1§>}.#getValue(kotlin.Any?;kotlin.reflect.KProperty<*>){} + override operator fun getValue(thisRef: Any?, property: KProperty<*>): V? + + // CHECK JVM_IR: + // Mangled name: IdeWizard#setting(SettingReference<2:0,2:1>){0§;1§>}IdeWizard#setting.<2:0,2:1>.#setValue(kotlin.Any?;kotlin.reflect.KProperty<*>;2:0?){} + // CHECK JS_IR NATIVE: + // Mangled name: IdeWizard#setting(SettingReference<2:0,2:1>){0§;1§>}.#setValue(kotlin.Any?;kotlin.reflect.KProperty<*>;2:0?){} + override operator fun setValue(thisRef: Any?, property: KProperty<*>, value: V?): Unit + + } + +} + +// CHECK: +// Mangled name: SettingReference +// Public signature: /SettingReference|null[0] +class SettingReference> { + // CHECK: + // Mangled name: SettingReference{}t + // Public signature: /SettingReference.t|-8767999791664836944[0] + var t: T + field + // CHECK JVM_IR: + // Mangled name: SettingReference#(){}1:1 + // Public signature: /SettingReference.t.|3876475218778608787[0] + // CHECK JS_IR NATIVE: + // Mangled name: SettingReference#(){} + // Public signature: /SettingReference.t.|7061140872129253552[0] + get + // CHECK: + // Mangled name: SettingReference#(1:1){} + // Public signature: /SettingReference.t.|-1029452311345649469[0] + set + + // CHECK: + // Mangled name: SettingReference{}v + // Public signature: /SettingReference.v|138869847852828796[0] + var v: V + field + // CHECK JVM_IR: + // Mangled name: SettingReference#(){}1:0 + // Public signature: /SettingReference.v.|-6358452650346304910[0] + // CHECK JS_IR NATIVE: + // Mangled name: SettingReference#(){} + // Public signature: /SettingReference.v.|4964732996156868941[0] + get + // CHECK: + // Mangled name: SettingReference#(1:0){} + // Public signature: /SettingReference.v.|-106720973864593013[0] + set + + // CHECK: + // Mangled name: SettingReference#(1:1;1:0){} + // Public signature: /SettingReference.|6008610667973001214[0] + constructor(t: T, v: V) /* primary */ + +} + +// CHECK: +// Mangled name: SettingType +// Public signature: /SettingType|null[0] +class SettingType { + // CHECK: + // Mangled name: SettingType{}type + // Public signature: /SettingType.type|-6051055617123801408[0] + val type: KClass + field + // CHECK JVM_IR: + // Mangled name: SettingType#(){}kotlin.reflect.KClass + // Public signature: /SettingType.type.|-782685829818054763[0] + // CHECK JS_IR NATIVE: + // Mangled name: SettingType#(){} + // Public signature: /SettingType.type.|5958014174245684635[0] + get + + // CHECK: + // Mangled name: SettingType#(kotlin.reflect.KClass){} + // Public signature: /SettingType.|-6177444285779890382[0] + constructor(type: KClass) /* primary */ + +} + diff --git a/compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.sig.kt.txt b/compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.sig.kt.txt new file mode 100644 index 00000000000..0e2d7a24b11 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/recursiveCapturedTypeInPropertyReference.sig.kt.txt @@ -0,0 +1,42 @@ +// CHECK: +// Mangled name: AbstractSymbol +// Public signature: /AbstractSymbol|null[0] +abstract class AbstractSymbol where E : Recursive, E : Something { + // CHECK: + // Mangled name: AbstractSymbol#(){} + // Public signature: /AbstractSymbol.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: AbstractSymbol#foo(kotlin.collections.List){} + // Public signature: /AbstractSymbol.foo|-4032272801520658510[0] + fun foo(list: List): Unit + +} + +// CHECK: +// Mangled name: Recursive +// Public signature: /Recursive|null[0] +interface Recursive where R : Recursive, R : Something { + + // CHECK: + // Mangled name: Recursive{}symbol + // Public signature: /Recursive.symbol|-2022127689160258603[0] + abstract val symbol: AbstractSymbol + // CHECK JVM_IR: + // Mangled name: Recursive#(){}AbstractSymbol<1:0> + // Public signature: /Recursive.symbol.|6872691415411276539[0] + // CHECK JS_IR NATIVE: + // Mangled name: Recursive#(){} + // Public signature: /Recursive.symbol.|-1453516714111318019[0] + abstract get + +} + +// CHECK: +// Mangled name: Something +// Public signature: /Something|null[0] +interface Something { + +} + diff --git a/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.sig.kt.txt b/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.sig.kt.txt new file mode 100644 index 00000000000..63b150fa2c8 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.sig.kt.txt @@ -0,0 +1,28 @@ +// CHECK: +// Mangled name: Ann +// Public signature: /Ann|null[0] +open annotation class Ann : Annotation { + // CHECK: + // Mangled name: Ann#(){} + // Public signature: /Ann.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: I +// Public signature: /I|null[0] +interface I { + + // CHECK: + // Mangled name: I#m(kotlin.String){} + // Public signature: /I.m|934693771674457301[0] + fun m(@Ann s: String): Unit + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +fun box(): String + diff --git a/compiler/testData/ir/irText/firProblems/reflectGetOnNullableTypeAlias.kt b/compiler/testData/ir/irText/firProblems/reflectGetOnNullableTypeAlias.kt index 99492b7cc2f..302b9de77bb 100644 --- a/compiler/testData/ir/irText/firProblems/reflectGetOnNullableTypeAlias.kt +++ b/compiler/testData/ir/irText/firProblems/reflectGetOnNullableTypeAlias.kt @@ -1,6 +1,9 @@ // SKIP_KLIB_TEST // WITH_REFLECT +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57778 + import kotlin.reflect.KProperty1 private typealias PropAlias = KProperty1? diff --git a/compiler/testData/ir/irText/firProblems/reflectGetOnNullableTypeAlias.sig.kt.txt b/compiler/testData/ir/irText/firProblems/reflectGetOnNullableTypeAlias.sig.kt.txt new file mode 100644 index 00000000000..355df04a9f0 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/reflectGetOnNullableTypeAlias.sig.kt.txt @@ -0,0 +1,37 @@ +// CHECK: +// Mangled name: Foo +// Public signature: /Foo|null[0] +class Foo { + // CHECK: + // Mangled name: Foo{}bar + // Public signature: /Foo.bar|-7864284097863469857[0] + val bar: String + // CHECK JVM_IR: + // Mangled name: Foo#(){}kotlin.String + // Public signature: /Foo.bar.|3423724227669014303[0] + // CHECK JS_IR NATIVE: + // Mangled name: Foo#(){} + // Public signature: /Foo.bar.|6880642144337645699[0] + get + + // CHECK: + // Mangled name: Foo#(){} + // Public signature: /Foo.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +// CHECK JS_IR NATIVE: +// Mangled name: #box(){} +// Public signature: /box|2173511048851971368[0] +fun box(): String + +// CHECK JVM_IR: +// Mangled name: PropAlias +// Public signature: [ File 'reflectGetOnNullableTypeAlias.kt' <- /PropAlias|null[0] ] +// CHECK JS_IR NATIVE: +// Mangled name: PropAlias +private typealias PropAlias = KProperty1? diff --git a/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.kt b/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.kt index 79113da3eb3..9380675cedc 100644 --- a/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.kt +++ b/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.kt @@ -2,6 +2,9 @@ // 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/firProblems/thisInEnumConstructor.sig.kt.txt b/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.sig.kt.txt new file mode 100644 index 00000000000..c5873157326 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/thisInEnumConstructor.sig.kt.txt @@ -0,0 +1,116 @@ +// CHECK: +// Mangled name: EE +// Public signature: /EE|null[0] +enum class EE : Enum { + // CHECK: + // Mangled name: EE{}myName + // Public signature: /EE.myName|-5293055785275588554[0] + val myName: String + // CHECK JVM_IR: + // Mangled name: EE#(){}kotlin.String + // Public signature: /EE.myName.|1458892150822279856[0] + // CHECK JS_IR NATIVE: + // Mangled name: EE#(){} + // Public signature: /EE.myName.|2030892647136934176[0] + get + + // CHECK: + // Mangled name: EE#(kotlin.String){} + // Public signature: /EE.|1280618353163213788[0] + private constructor(myName: String) /* primary */ + // CHECK: + // Mangled name: EE.ENTRY + // Public signature: /EE.ENTRY|null[0] + ENTRY + + // CHECK JVM_IR: + // Mangled name: EE#valueOf#static(kotlin.String){}EE + // Public signature: /EE.valueOf|-4534210679953674102[0] + // CHECK JS_IR NATIVE: + // Mangled name: EE#valueOf#static(kotlin.String){} + // Public signature: /EE.valueOf|-4683474617854611729[0] + fun valueOf(value: String): EE + + // CHECK JVM_IR: + // Mangled name: EE#values#static(){}kotlin.Array + // Public signature: /EE.values|-3264888678706577457[0] + // CHECK JS_IR NATIVE: + // Mangled name: EE#values#static(){} + // Public signature: /EE.values|-8715569000920726747[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: EE#clone(){}kotlin.Any + // Public signature: /EE.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: EE#compareTo(EE){} + // Public signature: /EE.compareTo|599571267222383379[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: EE#compareTo(EE){}kotlin.Int + // Public signature: /EE.compareTo|2516455132911655234[0] + // CHECK JS_IR NATIVE: + // Mangled name: EE#equals(kotlin.Any?){} + // Public signature: /EE.equals|4638265728071529943[0] + /* fake */ override operator fun compareTo(other: EE): Int + + // CHECK JVM_IR: + // Mangled name: EE#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /EE.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: EE#hashCode(){} + // Public signature: /EE.hashCode|3409210261493131192[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: EE#hashCode(){}kotlin.Int + // Public signature: /EE.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: EE#toString(){} + // Public signature: /EE.toString|-1522858123163872138[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: EE#toString(){}kotlin.String + // Public signature: /EE.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: EE#static{}entries + // Public signature: /EE.entries|-5134227801081826149[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: EE#static{}entries + // Public signature: /EE.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: EE##static(){}kotlin.enums.EnumEntries + // Public signature: /EE.entries.|280536622699226117[0] + // CHECK JS_IR NATIVE: + // Mangled name: EE{}name + // Public signature: /EE.name|4231860309499509769[0] + get(): EnumEntries + + // CHECK: + // Mangled name: EE{}name + // Public signature: /EE.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: EE#(){}kotlin.String + // Public signature: /EE.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: EE{}ordinal + // Public signature: /EE.ordinal|1912745122988592376[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: EE{}ordinal + // Public signature: /EE.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: EE#(){}kotlin.Int + // Public signature: /EE.ordinal.|-6902664390061762634[0] + /* fake */ override get(): Int + +} + diff --git a/compiler/testData/ir/irText/firProblems/throwableStackTrace.sig.kt.txt b/compiler/testData/ir/irText/firProblems/throwableStackTrace.sig.kt.txt new file mode 100644 index 00000000000..89a54411084 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/throwableStackTrace.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #foo(kotlin.Throwable){} +// Public signature: /foo|6953541718424396763[0] +fun foo(t: Throwable): Unit + diff --git a/compiler/testData/ir/irText/firProblems/timesInBuilder.kt b/compiler/testData/ir/irText/firProblems/timesInBuilder.kt index dbaa748b275..627862fb3b3 100644 --- a/compiler/testData/ir/irText/firProblems/timesInBuilder.kt +++ b/compiler/testData/ir/irText/firProblems/timesInBuilder.kt @@ -1,6 +1,9 @@ // WITH_STDLIB // IGNORE_BACKEND: JS_IR +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR +// ^ KT-57778 + private fun test(x: Long) = countIssues { +(spentTime lessEq 2 * 60) diff --git a/compiler/testData/ir/irText/firProblems/timesInBuilder.sig.kt.txt b/compiler/testData/ir/irText/firProblems/timesInBuilder.sig.kt.txt new file mode 100644 index 00000000000..662ed19982a --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/timesInBuilder.sig.kt.txt @@ -0,0 +1,85 @@ +// CHECK: +// Mangled name: {}spentTime +// Public signature: /spentTime|1981050075795716305[0] +val spentTime: Column + // CHECK JVM_IR: + // Mangled name: #(){}Column + // Public signature: /spentTime.|3550920958732313011[0] + get + +// CHECK: +// Mangled name: ArgumentsBuilder +// Public signature: /ArgumentsBuilder|null[0] +class ArgumentsBuilder { + // CHECK: + // Mangled name: ArgumentsBuilder{}arguments + // Public signature: /ArgumentsBuilder.arguments|-8426540515456712294[0] + val arguments: MutableList + // CHECK JVM_IR: + // Mangled name: ArgumentsBuilder#(){}kotlin.collections.MutableList + // Public signature: /ArgumentsBuilder.arguments.|7867094825942376438[0] + get + + // CHECK: + // Mangled name: ArgumentsBuilder#(){} + // Public signature: /ArgumentsBuilder.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: ArgumentsBuilder#unaryPlus@Expression(){} + // Public signature: /ArgumentsBuilder.unaryPlus|-2215785624257595840[0] + operator fun Expression.unaryPlus(): Unit + +} + +// CHECK: +// Mangled name: Column +// Public signature: /Column|null[0] +class Column { + // CHECK: + // Mangled name: Column#(){} + // Public signature: /Column.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: Expression +// Public signature: /Expression|null[0] +class Expression { + // CHECK: + // Mangled name: Expression#(){} + // Public signature: /Expression.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: #countIssues(kotlin.Function1){} +// Public signature: [ File 'timesInBuilder.kt' <- /countIssues|-3006686104129982000[0] ] +private fun countIssues(restrictionsBuilder: @ExtensionFunctionType Function1): Unit + +// CHECK JVM_IR: +// Mangled name: #id(0:0){0§}0:0 +// Public signature: /id|-6791396263062521506[0] +fun id(arg: I): I + +// CHECK JVM_IR: +// Mangled name: #integer(kotlin.String){}Column +// Public signature: /integer|-7515290819735707124[0] +fun integer(name: String): Column + +// CHECK JVM_IR: +// Mangled name: #lessEq@Column(0:0){0§>}Expression +// Public signature: /lessEq|144930027420774562[0] +infix fun > Column.lessEq(t: T): Expression + +// CHECK JVM_IR: +// Mangled name: #select@Column(0:0;0:0){0§>}Expression +// Public signature: /select|-7119975056707584867[0] +fun > Column.select(t: T, r: T): Expression + +// CHECK: +// Mangled name: #test(kotlin.Long){} +// Public signature: [ File 'timesInBuilder.kt' <- /test|-2956403500052581138[0] ] +private fun test(x: Long): Unit diff --git a/compiler/testData/ir/irText/firProblems/typeParameterFromJavaClass.sig.kt.txt b/compiler/testData/ir/irText/firProblems/typeParameterFromJavaClass.sig.kt.txt new file mode 100644 index 00000000000..9bf2ef3fd2a --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/typeParameterFromJavaClass.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #foo(kotlin.collections.MutableList>){} +// Public signature: /foo|-235147134910002974[0] +fun foo(movedPaths: MutableList>): Unit + diff --git a/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.sig.kt.txt b/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.sig.kt.txt new file mode 100644 index 00000000000..a7d60d22918 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.sig.kt.txt @@ -0,0 +1,693 @@ +// CHECK: +// Mangled name: Visibility +// Public signature: /Visibility|null[0] +abstract class Visibility { + // CHECK: + // Mangled name: Visibility{}name + // Public signature: /Visibility.name|4231860309499509769[0] + val name: String + // CHECK JVM_IR: + // Mangled name: Visibility#(){}kotlin.String + // Public signature: /Visibility.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibility#(){} + // Public signature: /Visibility.name.|5879344792307730109[0] + get + + // CHECK: + // Mangled name: Visibility{}isPublicAPI + // Public signature: /Visibility.isPublicAPI|-3614707293274580028[0] + val isPublicAPI: Boolean + // CHECK JVM_IR: + // Mangled name: Visibility#(){}kotlin.Boolean + // Public signature: /Visibility.isPublicAPI.|3495554365118712322[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibility#(){} + // Public signature: /Visibility.isPublicAPI.|2012942461922668419[0] + get + + // CHECK: + // Mangled name: Visibility#(kotlin.String;kotlin.Boolean){} + // Public signature: /Visibility.|7478968091293048907[0] + constructor(name: String, isPublicAPI: Boolean) /* primary */ + + // CHECK JVM_IR: + // Mangled name: Visibility#mustCheckInImports(){}kotlin.Boolean + // Public signature: /Visibility.mustCheckInImports|671123431860416266[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibility#mustCheckInImports(){} + // Public signature: /Visibility.mustCheckInImports|3470930282249351522[0] + abstract fun mustCheckInImports(): Boolean + + // CHECK: + // Mangled name: Visibility{}externalDisplayName + // Public signature: /Visibility.externalDisplayName|391049038221671391[0] + open val externalDisplayName: String + // CHECK JVM_IR: + // Mangled name: Visibility#(){}kotlin.String + // Public signature: /Visibility.externalDisplayName.|-6122052316113926396[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibility#(){} + // Public signature: /Visibility.externalDisplayName.|8023638203265342574[0] + open get(): String + + // CHECK: + // Mangled name: Visibility{}internalDisplayName + // Public signature: /Visibility.internalDisplayName|363288575296777097[0] + open val internalDisplayName: String + // CHECK JVM_IR: + // Mangled name: Visibility#(){}kotlin.String + // Public signature: /Visibility.internalDisplayName.|2525145903245032039[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibility#(){} + // Public signature: /Visibility.internalDisplayName.|4803840120715855849[0] + open get(): String + +} + +// CHECK: +// Mangled name: Visibilities +// Public signature: /Visibilities|null[0] +object Visibilities { + // CHECK: + // Mangled name: Visibilities{}ORDERED_VISIBILITIES + // Public signature: /Visibilities.ORDERED_VISIBILITIES|6079781139816677865[0] + private val ORDERED_VISIBILITIES: Map + // CHECK JVM_IR: + // Mangled name: Visibilities#(){}kotlin.collections.Map + // Public signature: /Visibilities.ORDERED_VISIBILITIES.|-1863707493423525823[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities#(){} + // Public signature: /Visibilities.ORDERED_VISIBILITIES.|3267673602320535108[0] + private get + + // CHECK: + // Mangled name: Visibilities.Inherited + // Public signature: /Visibilities.Inherited|null[0] + object Inherited : Visibility { + // CHECK: + // Mangled name: Visibilities.Inherited#(){} + // Public signature: /Visibilities.Inherited.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Visibilities.Inherited#mustCheckInImports(){}kotlin.Boolean + // Public signature: /Visibilities.Inherited.mustCheckInImports|671123431860416266[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Inherited#mustCheckInImports(){} + // Public signature: /Visibilities.Inherited.mustCheckInImports|3470930282249351522[0] + override fun mustCheckInImports(): Boolean + + // CHECK: + // Mangled name: Visibilities.Inherited{}externalDisplayName + // Public signature: /Visibilities.Inherited.externalDisplayName|391049038221671391[0] + /* fake */ override val externalDisplayName: String + // CHECK JVM_IR: + // Mangled name: Visibilities.Inherited#(){}kotlin.String + // Public signature: /Visibilities.Inherited.externalDisplayName.|-6122052316113926396[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Inherited#(){} + // Public signature: /Visibilities.Inherited.externalDisplayName.|8023638203265342574[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Visibilities.Inherited{}internalDisplayName + // Public signature: /Visibilities.Inherited.internalDisplayName|363288575296777097[0] + /* fake */ override val internalDisplayName: String + // CHECK JVM_IR: + // Mangled name: Visibilities.Inherited#(){}kotlin.String + // Public signature: /Visibilities.Inherited.internalDisplayName.|2525145903245032039[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Inherited#(){} + // Public signature: /Visibilities.Inherited.internalDisplayName.|4803840120715855849[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Visibilities.Inherited{}isPublicAPI + // Public signature: /Visibilities.Inherited.isPublicAPI|-3614707293274580028[0] + /* fake */ override val isPublicAPI: Boolean + // CHECK JVM_IR: + // Mangled name: Visibilities.Inherited#(){}kotlin.Boolean + // Public signature: /Visibilities.Inherited.isPublicAPI.|3495554365118712322[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Inherited#(){} + // Public signature: /Visibilities.Inherited.isPublicAPI.|2012942461922668419[0] + /* fake */ override get(): Boolean + + // CHECK: + // Mangled name: Visibilities.Inherited{}name + // Public signature: /Visibilities.Inherited.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: Visibilities.Inherited#(){}kotlin.String + // Public signature: /Visibilities.Inherited.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Inherited#(){} + // Public signature: /Visibilities.Inherited.name.|5879344792307730109[0] + /* fake */ override get(): String + + } + + // CHECK: + // Mangled name: Visibilities.Internal + // Public signature: /Visibilities.Internal|null[0] + object Internal : Visibility { + // CHECK: + // Mangled name: Visibilities.Internal#(){} + // Public signature: /Visibilities.Internal.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Visibilities.Internal#mustCheckInImports(){}kotlin.Boolean + // Public signature: /Visibilities.Internal.mustCheckInImports|671123431860416266[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Internal#mustCheckInImports(){} + // Public signature: /Visibilities.Internal.mustCheckInImports|3470930282249351522[0] + override fun mustCheckInImports(): Boolean + + // CHECK: + // Mangled name: Visibilities.Internal{}externalDisplayName + // Public signature: /Visibilities.Internal.externalDisplayName|391049038221671391[0] + /* fake */ override val externalDisplayName: String + // CHECK JVM_IR: + // Mangled name: Visibilities.Internal#(){}kotlin.String + // Public signature: /Visibilities.Internal.externalDisplayName.|-6122052316113926396[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Internal#(){} + // Public signature: /Visibilities.Internal.externalDisplayName.|8023638203265342574[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Visibilities.Internal{}internalDisplayName + // Public signature: /Visibilities.Internal.internalDisplayName|363288575296777097[0] + /* fake */ override val internalDisplayName: String + // CHECK JVM_IR: + // Mangled name: Visibilities.Internal#(){}kotlin.String + // Public signature: /Visibilities.Internal.internalDisplayName.|2525145903245032039[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Internal#(){} + // Public signature: /Visibilities.Internal.internalDisplayName.|4803840120715855849[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Visibilities.Internal{}isPublicAPI + // Public signature: /Visibilities.Internal.isPublicAPI|-3614707293274580028[0] + /* fake */ override val isPublicAPI: Boolean + // CHECK JVM_IR: + // Mangled name: Visibilities.Internal#(){}kotlin.Boolean + // Public signature: /Visibilities.Internal.isPublicAPI.|3495554365118712322[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Internal#(){} + // Public signature: /Visibilities.Internal.isPublicAPI.|2012942461922668419[0] + /* fake */ override get(): Boolean + + // CHECK: + // Mangled name: Visibilities.Internal{}name + // Public signature: /Visibilities.Internal.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: Visibilities.Internal#(){}kotlin.String + // Public signature: /Visibilities.Internal.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Internal#(){} + // Public signature: /Visibilities.Internal.name.|5879344792307730109[0] + /* fake */ override get(): String + + } + + // CHECK: + // Mangled name: Visibilities.InvisibleFake + // Public signature: /Visibilities.InvisibleFake|null[0] + object InvisibleFake : Visibility { + // CHECK: + // Mangled name: Visibilities.InvisibleFake#(){} + // Public signature: /Visibilities.InvisibleFake.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Visibilities.InvisibleFake#mustCheckInImports(){}kotlin.Boolean + // Public signature: /Visibilities.InvisibleFake.mustCheckInImports|671123431860416266[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.InvisibleFake#mustCheckInImports(){} + // Public signature: /Visibilities.InvisibleFake.mustCheckInImports|3470930282249351522[0] + override fun mustCheckInImports(): Boolean + + // CHECK: + // Mangled name: Visibilities.InvisibleFake{}internalDisplayName + // Public signature: /Visibilities.InvisibleFake.internalDisplayName|363288575296777097[0] + /* fake */ override val internalDisplayName: String + // CHECK JVM_IR: + // Mangled name: Visibilities.InvisibleFake#(){}kotlin.String + // Public signature: /Visibilities.InvisibleFake.internalDisplayName.|2525145903245032039[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.InvisibleFake#(){} + // Public signature: /Visibilities.InvisibleFake.internalDisplayName.|4803840120715855849[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Visibilities.InvisibleFake{}isPublicAPI + // Public signature: /Visibilities.InvisibleFake.isPublicAPI|-3614707293274580028[0] + /* fake */ override val isPublicAPI: Boolean + // CHECK JVM_IR: + // Mangled name: Visibilities.InvisibleFake#(){}kotlin.Boolean + // Public signature: /Visibilities.InvisibleFake.isPublicAPI.|3495554365118712322[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.InvisibleFake#(){} + // Public signature: /Visibilities.InvisibleFake.isPublicAPI.|2012942461922668419[0] + /* fake */ override get(): Boolean + + // CHECK: + // Mangled name: Visibilities.InvisibleFake{}name + // Public signature: /Visibilities.InvisibleFake.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: Visibilities.InvisibleFake#(){}kotlin.String + // Public signature: /Visibilities.InvisibleFake.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.InvisibleFake#(){} + // Public signature: /Visibilities.InvisibleFake.name.|5879344792307730109[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Visibilities.InvisibleFake{}externalDisplayName + // Public signature: /Visibilities.InvisibleFake.externalDisplayName|391049038221671391[0] + override val externalDisplayName: String + // CHECK JVM_IR: + // Mangled name: Visibilities.InvisibleFake#(){}kotlin.String + // Public signature: /Visibilities.InvisibleFake.externalDisplayName.|-6122052316113926396[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.InvisibleFake#(){} + // Public signature: /Visibilities.InvisibleFake.externalDisplayName.|8023638203265342574[0] + override get(): String + + } + + // CHECK: + // Mangled name: Visibilities.Local + // Public signature: /Visibilities.Local|null[0] + object Local : Visibility { + // CHECK: + // Mangled name: Visibilities.Local#(){} + // Public signature: /Visibilities.Local.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Visibilities.Local#mustCheckInImports(){}kotlin.Boolean + // Public signature: /Visibilities.Local.mustCheckInImports|671123431860416266[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Local#mustCheckInImports(){} + // Public signature: /Visibilities.Local.mustCheckInImports|3470930282249351522[0] + override fun mustCheckInImports(): Boolean + + // CHECK: + // Mangled name: Visibilities.Local{}externalDisplayName + // Public signature: /Visibilities.Local.externalDisplayName|391049038221671391[0] + /* fake */ override val externalDisplayName: String + // CHECK JVM_IR: + // Mangled name: Visibilities.Local#(){}kotlin.String + // Public signature: /Visibilities.Local.externalDisplayName.|-6122052316113926396[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Local#(){} + // Public signature: /Visibilities.Local.externalDisplayName.|8023638203265342574[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Visibilities.Local{}internalDisplayName + // Public signature: /Visibilities.Local.internalDisplayName|363288575296777097[0] + /* fake */ override val internalDisplayName: String + // CHECK JVM_IR: + // Mangled name: Visibilities.Local#(){}kotlin.String + // Public signature: /Visibilities.Local.internalDisplayName.|2525145903245032039[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Local#(){} + // Public signature: /Visibilities.Local.internalDisplayName.|4803840120715855849[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Visibilities.Local{}isPublicAPI + // Public signature: /Visibilities.Local.isPublicAPI|-3614707293274580028[0] + /* fake */ override val isPublicAPI: Boolean + // CHECK JVM_IR: + // Mangled name: Visibilities.Local#(){}kotlin.Boolean + // Public signature: /Visibilities.Local.isPublicAPI.|3495554365118712322[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Local#(){} + // Public signature: /Visibilities.Local.isPublicAPI.|2012942461922668419[0] + /* fake */ override get(): Boolean + + // CHECK: + // Mangled name: Visibilities.Local{}name + // Public signature: /Visibilities.Local.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: Visibilities.Local#(){}kotlin.String + // Public signature: /Visibilities.Local.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Local#(){} + // Public signature: /Visibilities.Local.name.|5879344792307730109[0] + /* fake */ override get(): String + + } + + // CHECK: + // Mangled name: Visibilities.Private + // Public signature: /Visibilities.Private|null[0] + object Private : Visibility { + // CHECK: + // Mangled name: Visibilities.Private#(){} + // Public signature: /Visibilities.Private.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Visibilities.Private#mustCheckInImports(){}kotlin.Boolean + // Public signature: /Visibilities.Private.mustCheckInImports|671123431860416266[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Private#mustCheckInImports(){} + // Public signature: /Visibilities.Private.mustCheckInImports|3470930282249351522[0] + override fun mustCheckInImports(): Boolean + + // CHECK: + // Mangled name: Visibilities.Private{}externalDisplayName + // Public signature: /Visibilities.Private.externalDisplayName|391049038221671391[0] + /* fake */ override val externalDisplayName: String + // CHECK JVM_IR: + // Mangled name: Visibilities.Private#(){}kotlin.String + // Public signature: /Visibilities.Private.externalDisplayName.|-6122052316113926396[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Private#(){} + // Public signature: /Visibilities.Private.externalDisplayName.|8023638203265342574[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Visibilities.Private{}internalDisplayName + // Public signature: /Visibilities.Private.internalDisplayName|363288575296777097[0] + /* fake */ override val internalDisplayName: String + // CHECK JVM_IR: + // Mangled name: Visibilities.Private#(){}kotlin.String + // Public signature: /Visibilities.Private.internalDisplayName.|2525145903245032039[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Private#(){} + // Public signature: /Visibilities.Private.internalDisplayName.|4803840120715855849[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Visibilities.Private{}isPublicAPI + // Public signature: /Visibilities.Private.isPublicAPI|-3614707293274580028[0] + /* fake */ override val isPublicAPI: Boolean + // CHECK JVM_IR: + // Mangled name: Visibilities.Private#(){}kotlin.Boolean + // Public signature: /Visibilities.Private.isPublicAPI.|3495554365118712322[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Private#(){} + // Public signature: /Visibilities.Private.isPublicAPI.|2012942461922668419[0] + /* fake */ override get(): Boolean + + // CHECK: + // Mangled name: Visibilities.Private{}name + // Public signature: /Visibilities.Private.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: Visibilities.Private#(){}kotlin.String + // Public signature: /Visibilities.Private.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Private#(){} + // Public signature: /Visibilities.Private.name.|5879344792307730109[0] + /* fake */ override get(): String + + } + + // CHECK: + // Mangled name: Visibilities.PrivateToThis + // Public signature: /Visibilities.PrivateToThis|null[0] + object PrivateToThis : Visibility { + // CHECK: + // Mangled name: Visibilities.PrivateToThis#(){} + // Public signature: /Visibilities.PrivateToThis.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Visibilities.PrivateToThis#mustCheckInImports(){}kotlin.Boolean + // Public signature: /Visibilities.PrivateToThis.mustCheckInImports|671123431860416266[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.PrivateToThis#mustCheckInImports(){} + // Public signature: /Visibilities.PrivateToThis.mustCheckInImports|3470930282249351522[0] + override fun mustCheckInImports(): Boolean + + // CHECK: + // Mangled name: Visibilities.PrivateToThis{}externalDisplayName + // Public signature: /Visibilities.PrivateToThis.externalDisplayName|391049038221671391[0] + /* fake */ override val externalDisplayName: String + // CHECK JVM_IR: + // Mangled name: Visibilities.PrivateToThis#(){}kotlin.String + // Public signature: /Visibilities.PrivateToThis.externalDisplayName.|-6122052316113926396[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.PrivateToThis#(){} + // Public signature: /Visibilities.PrivateToThis.externalDisplayName.|8023638203265342574[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Visibilities.PrivateToThis{}isPublicAPI + // Public signature: /Visibilities.PrivateToThis.isPublicAPI|-3614707293274580028[0] + /* fake */ override val isPublicAPI: Boolean + // CHECK JVM_IR: + // Mangled name: Visibilities.PrivateToThis#(){}kotlin.Boolean + // Public signature: /Visibilities.PrivateToThis.isPublicAPI.|3495554365118712322[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.PrivateToThis#(){} + // Public signature: /Visibilities.PrivateToThis.isPublicAPI.|2012942461922668419[0] + /* fake */ override get(): Boolean + + // CHECK: + // Mangled name: Visibilities.PrivateToThis{}name + // Public signature: /Visibilities.PrivateToThis.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: Visibilities.PrivateToThis#(){}kotlin.String + // Public signature: /Visibilities.PrivateToThis.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.PrivateToThis#(){} + // Public signature: /Visibilities.PrivateToThis.name.|5879344792307730109[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Visibilities.PrivateToThis{}internalDisplayName + // Public signature: /Visibilities.PrivateToThis.internalDisplayName|363288575296777097[0] + override val internalDisplayName: String + // CHECK JVM_IR: + // Mangled name: Visibilities.PrivateToThis#(){}kotlin.String + // Public signature: /Visibilities.PrivateToThis.internalDisplayName.|2525145903245032039[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.PrivateToThis#(){} + // Public signature: /Visibilities.PrivateToThis.internalDisplayName.|4803840120715855849[0] + override get(): String + + } + + // CHECK: + // Mangled name: Visibilities.Protected + // Public signature: /Visibilities.Protected|null[0] + object Protected : Visibility { + // CHECK: + // Mangled name: Visibilities.Protected#(){} + // Public signature: /Visibilities.Protected.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Visibilities.Protected#mustCheckInImports(){}kotlin.Boolean + // Public signature: /Visibilities.Protected.mustCheckInImports|671123431860416266[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Protected#mustCheckInImports(){} + // Public signature: /Visibilities.Protected.mustCheckInImports|3470930282249351522[0] + override fun mustCheckInImports(): Boolean + + // CHECK: + // Mangled name: Visibilities.Protected{}externalDisplayName + // Public signature: /Visibilities.Protected.externalDisplayName|391049038221671391[0] + /* fake */ override val externalDisplayName: String + // CHECK JVM_IR: + // Mangled name: Visibilities.Protected#(){}kotlin.String + // Public signature: /Visibilities.Protected.externalDisplayName.|-6122052316113926396[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Protected#(){} + // Public signature: /Visibilities.Protected.externalDisplayName.|8023638203265342574[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Visibilities.Protected{}internalDisplayName + // Public signature: /Visibilities.Protected.internalDisplayName|363288575296777097[0] + /* fake */ override val internalDisplayName: String + // CHECK JVM_IR: + // Mangled name: Visibilities.Protected#(){}kotlin.String + // Public signature: /Visibilities.Protected.internalDisplayName.|2525145903245032039[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Protected#(){} + // Public signature: /Visibilities.Protected.internalDisplayName.|4803840120715855849[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Visibilities.Protected{}isPublicAPI + // Public signature: /Visibilities.Protected.isPublicAPI|-3614707293274580028[0] + /* fake */ override val isPublicAPI: Boolean + // CHECK JVM_IR: + // Mangled name: Visibilities.Protected#(){}kotlin.Boolean + // Public signature: /Visibilities.Protected.isPublicAPI.|3495554365118712322[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Protected#(){} + // Public signature: /Visibilities.Protected.isPublicAPI.|2012942461922668419[0] + /* fake */ override get(): Boolean + + // CHECK: + // Mangled name: Visibilities.Protected{}name + // Public signature: /Visibilities.Protected.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: Visibilities.Protected#(){}kotlin.String + // Public signature: /Visibilities.Protected.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Protected#(){} + // Public signature: /Visibilities.Protected.name.|5879344792307730109[0] + /* fake */ override get(): String + + } + + // CHECK: + // Mangled name: Visibilities.Public + // Public signature: /Visibilities.Public|null[0] + object Public : Visibility { + // CHECK: + // Mangled name: Visibilities.Public#(){} + // Public signature: /Visibilities.Public.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Visibilities.Public#mustCheckInImports(){}kotlin.Boolean + // Public signature: /Visibilities.Public.mustCheckInImports|671123431860416266[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Public#mustCheckInImports(){} + // Public signature: /Visibilities.Public.mustCheckInImports|3470930282249351522[0] + override fun mustCheckInImports(): Boolean + + // CHECK: + // Mangled name: Visibilities.Public{}externalDisplayName + // Public signature: /Visibilities.Public.externalDisplayName|391049038221671391[0] + /* fake */ override val externalDisplayName: String + // CHECK JVM_IR: + // Mangled name: Visibilities.Public#(){}kotlin.String + // Public signature: /Visibilities.Public.externalDisplayName.|-6122052316113926396[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Public#(){} + // Public signature: /Visibilities.Public.externalDisplayName.|8023638203265342574[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Visibilities.Public{}internalDisplayName + // Public signature: /Visibilities.Public.internalDisplayName|363288575296777097[0] + /* fake */ override val internalDisplayName: String + // CHECK JVM_IR: + // Mangled name: Visibilities.Public#(){}kotlin.String + // Public signature: /Visibilities.Public.internalDisplayName.|2525145903245032039[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Public#(){} + // Public signature: /Visibilities.Public.internalDisplayName.|4803840120715855849[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Visibilities.Public{}isPublicAPI + // Public signature: /Visibilities.Public.isPublicAPI|-3614707293274580028[0] + /* fake */ override val isPublicAPI: Boolean + // CHECK JVM_IR: + // Mangled name: Visibilities.Public#(){}kotlin.Boolean + // Public signature: /Visibilities.Public.isPublicAPI.|3495554365118712322[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Public#(){} + // Public signature: /Visibilities.Public.isPublicAPI.|2012942461922668419[0] + /* fake */ override get(): Boolean + + // CHECK: + // Mangled name: Visibilities.Public{}name + // Public signature: /Visibilities.Public.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: Visibilities.Public#(){}kotlin.String + // Public signature: /Visibilities.Public.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Public#(){} + // Public signature: /Visibilities.Public.name.|5879344792307730109[0] + /* fake */ override get(): String + + } + + // CHECK: + // Mangled name: Visibilities.Unknown + // Public signature: /Visibilities.Unknown|null[0] + object Unknown : Visibility { + // CHECK: + // Mangled name: Visibilities.Unknown#(){} + // Public signature: /Visibilities.Unknown.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Visibilities.Unknown#mustCheckInImports(){}kotlin.Boolean + // Public signature: /Visibilities.Unknown.mustCheckInImports|671123431860416266[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Unknown#mustCheckInImports(){} + // Public signature: /Visibilities.Unknown.mustCheckInImports|3470930282249351522[0] + override fun mustCheckInImports(): Boolean + + // CHECK: + // Mangled name: Visibilities.Unknown{}externalDisplayName + // Public signature: /Visibilities.Unknown.externalDisplayName|391049038221671391[0] + /* fake */ override val externalDisplayName: String + // CHECK JVM_IR: + // Mangled name: Visibilities.Unknown#(){}kotlin.String + // Public signature: /Visibilities.Unknown.externalDisplayName.|-6122052316113926396[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Unknown#(){} + // Public signature: /Visibilities.Unknown.externalDisplayName.|8023638203265342574[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Visibilities.Unknown{}internalDisplayName + // Public signature: /Visibilities.Unknown.internalDisplayName|363288575296777097[0] + /* fake */ override val internalDisplayName: String + // CHECK JVM_IR: + // Mangled name: Visibilities.Unknown#(){}kotlin.String + // Public signature: /Visibilities.Unknown.internalDisplayName.|2525145903245032039[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Unknown#(){} + // Public signature: /Visibilities.Unknown.internalDisplayName.|4803840120715855849[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Visibilities.Unknown{}isPublicAPI + // Public signature: /Visibilities.Unknown.isPublicAPI|-3614707293274580028[0] + /* fake */ override val isPublicAPI: Boolean + // CHECK JVM_IR: + // Mangled name: Visibilities.Unknown#(){}kotlin.Boolean + // Public signature: /Visibilities.Unknown.isPublicAPI.|3495554365118712322[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Unknown#(){} + // Public signature: /Visibilities.Unknown.isPublicAPI.|2012942461922668419[0] + /* fake */ override get(): Boolean + + // CHECK: + // Mangled name: Visibilities.Unknown{}name + // Public signature: /Visibilities.Unknown.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: Visibilities.Unknown#(){}kotlin.String + // Public signature: /Visibilities.Unknown.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: Visibilities.Unknown#(){} + // Public signature: /Visibilities.Unknown.name.|5879344792307730109[0] + /* fake */ override get(): String + + } + + // CHECK: + // Mangled name: Visibilities#(){} + // Public signature: /Visibilities.|-5645683436151566731[0] + private constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/firProblems/valueClassEquals.sig.kt.txt b/compiler/testData/ir/irText/firProblems/valueClassEquals.sig.kt.txt new file mode 100644 index 00000000000..55d2ce6958e --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/valueClassEquals.sig.kt.txt @@ -0,0 +1,43 @@ +// CHECK: +// Mangled name: {}equals +// Public signature: /equals|-1340381053427629212[0] +val equals: KFunction2 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.reflect.KFunction2 + // Public signature: /equals.|5606412553566840313[0] + get + +// CHECK: +// Mangled name: Z +// Public signature: /Z|null[0] +@JvmInline +value class Z { + // CHECK: + // Mangled name: Z{}s + // Public signature: /Z.s|7217541905509134881[0] + val s: String + // CHECK JVM_IR: + // Mangled name: Z#(){}kotlin.String + // Public signature: /Z.s.|4142379646177092803[0] + get + + // CHECK: + // Mangled name: Z#(kotlin.String){} + // Public signature: /Z.|1280618353163213788[0] + constructor(s: String) /* primary */ + // CHECK JVM_IR: + // Mangled name: Z#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Z.equals|722809408929142791[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Z#hashCode(){}kotlin.Int + // Public signature: /Z.hashCode|-8048879360829830756[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Z#toString(){}kotlin.String + // Public signature: /Z.toString|6958853723545266802[0] + override fun toString(): String + +} diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicAndMembersOfAny.kt b/compiler/testData/ir/irText/js/dynamic/dynamicAndMembersOfAny.kt index 3a1360890e8..f22968ec0da 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicAndMembersOfAny.kt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicAndMembersOfAny.kt @@ -1,8 +1,10 @@ // TARGET_BACKEND: JS_IR - // FIR_IDENTICAL // WITH_STDLIB +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57566 + fun test1(d: dynamic) = d.toString() fun test2(d: dynamic) = d.hashCode() diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicAndMembersOfAny.sig.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicAndMembersOfAny.sig.kt.txt new file mode 100644 index 00000000000..aabb12e8776 --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/dynamicAndMembersOfAny.sig.kt.txt @@ -0,0 +1,15 @@ +// CHECK JS_IR NATIVE: +// Mangled name: #test1(){} +// Public signature: /test1|4353482563436034667[0] +fun test1(d: dynamic): String + +// CHECK JS_IR NATIVE: +// Mangled name: #test2(){} +// Public signature: /test2|-7945586224410659921[0] +fun test2(d: dynamic): Int + +// CHECK JS_IR NATIVE: +// Mangled name: #test3(){} +// Public signature: /test3|8250122632028727853[0] +fun test3(d: dynamic): Boolean + diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicArrayAccess.kt b/compiler/testData/ir/irText/js/dynamic/dynamicArrayAccess.kt index 9c5420061eb..6ed1a665b8b 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicArrayAccess.kt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicArrayAccess.kt @@ -1,5 +1,9 @@ // TARGET_BACKEND: JS_IR // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57566 + fun testArrayAccess1(d: dynamic) = d["KEY"] fun testArrayAccess2(d: dynamic) = d()["KEY"] diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicArrayAccess.sig.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicArrayAccess.sig.kt.txt new file mode 100644 index 00000000000..b4186b01bab --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/dynamicArrayAccess.sig.kt.txt @@ -0,0 +1,15 @@ +// CHECK JS_IR NATIVE: +// Mangled name: #testArrayAccess1(){} +// Public signature: /testArrayAccess1|-7245796695879478116[0] +fun testArrayAccess1(d: dynamic): dynamic + +// CHECK JS_IR NATIVE: +// Mangled name: #testArrayAccess2(){} +// Public signature: /testArrayAccess2|-1661569284054013352[0] +fun testArrayAccess2(d: dynamic): dynamic + +// CHECK JS_IR NATIVE: +// Mangled name: #testArrayAccess3(){} +// Public signature: /testArrayAccess3|1401503501141065915[0] +fun testArrayAccess3(d: dynamic): dynamic + diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicArrayAssignment.kt b/compiler/testData/ir/irText/js/dynamic/dynamicArrayAssignment.kt index 3cd296d2e9a..4c926b484dc 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicArrayAssignment.kt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicArrayAssignment.kt @@ -1,4 +1,8 @@ // TARGET_BACKEND: JS_IR + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57566 + fun testArrayAssignment(d: dynamic) { d["KEY"] = 1 } diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicArrayAssignment.sig.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicArrayAssignment.sig.kt.txt new file mode 100644 index 00000000000..7525ca001ea --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/dynamicArrayAssignment.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #testArrayAssignment(){} +// Public signature: /testArrayAssignment|-7643929268553758425[0] +fun testArrayAssignment(d: dynamic): Unit + +// CHECK: +// Mangled name: #testArrayAssignmentFake(){} +// Public signature: /testArrayAssignmentFake|3175988190655386022[0] +fun testArrayAssignmentFake(d: dynamic): Unit + diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicArrayAugmentedAssignment.kt b/compiler/testData/ir/irText/js/dynamic/dynamicArrayAugmentedAssignment.kt index 790229ee711..48da26b4c0b 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicArrayAugmentedAssignment.kt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicArrayAugmentedAssignment.kt @@ -1,6 +1,9 @@ // TARGET_BACKEND: JS_IR - // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57566 + fun testArrayAugmentedAssignment(d: dynamic) { d["KEY"] += "+=" d["KEY"] -= "-=" diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicArrayAugmentedAssignment.sig.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicArrayAugmentedAssignment.sig.kt.txt new file mode 100644 index 00000000000..c48a4d645de --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/dynamicArrayAugmentedAssignment.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #testArrayAugmentedAssignment(){} +// Public signature: /testArrayAugmentedAssignment|-3592844207838342981[0] +fun testArrayAugmentedAssignment(d: dynamic): Unit + diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicArrayIncrementDecrement.sig.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicArrayIncrementDecrement.sig.kt.txt new file mode 100644 index 00000000000..bec47e19ef9 --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/dynamicArrayIncrementDecrement.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #testArrayIncrementDecrement(){} +// Public signature: /testArrayIncrementDecrement|641183399401632019[0] +fun testArrayIncrementDecrement(d: dynamic): Unit + diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryEqualityOperator.kt b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryEqualityOperator.kt index 01e3400ef14..06e201a4e6c 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryEqualityOperator.kt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryEqualityOperator.kt @@ -1,6 +1,9 @@ // TARGET_BACKEND: JS_IR - // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57566 + fun testEqeq(d: dynamic) = d == 3 fun testExclEq(d: dynamic) = d != 3 fun testEqeqeq(d: dynamic) = d === 3 diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryEqualityOperator.sig.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryEqualityOperator.sig.kt.txt new file mode 100644 index 00000000000..d47eabbf0d1 --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryEqualityOperator.sig.kt.txt @@ -0,0 +1,20 @@ +// CHECK JS_IR NATIVE: +// Mangled name: #testEqeq(){} +// Public signature: /testEqeq|-1993622698448833276[0] +fun testEqeq(d: dynamic): Boolean + +// CHECK JS_IR NATIVE: +// Mangled name: #testEqeqeq(){} +// Public signature: /testEqeqeq|6434412038753944189[0] +fun testEqeqeq(d: dynamic): Boolean + +// CHECK JS_IR NATIVE: +// Mangled name: #testExclEq(){} +// Public signature: /testExclEq|-2117076107258151936[0] +fun testExclEq(d: dynamic): Boolean + +// CHECK JS_IR NATIVE: +// Mangled name: #testExclEqeq(){} +// Public signature: /testExclEqeq|5516019862167337768[0] +fun testExclEqeq(d: dynamic): Boolean + diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryLogicalOperator.kt b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryLogicalOperator.kt index 2ef52877cd0..0129cca4827 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryLogicalOperator.kt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryLogicalOperator.kt @@ -1,4 +1,8 @@ // TARGET_BACKEND: JS_IR // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57566 + fun testAndAnd(d: dynamic) = d && d fun testOrOr(d: dynamic) = d || d diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryLogicalOperator.sig.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryLogicalOperator.sig.kt.txt new file mode 100644 index 00000000000..79ddde5bb32 --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryLogicalOperator.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK JS_IR NATIVE: +// Mangled name: #testAndAnd(){} +// Public signature: /testAndAnd|6769903474387958731[0] +fun testAndAnd(d: dynamic): Boolean + +// CHECK JS_IR NATIVE: +// Mangled name: #testOrOr(){} +// Public signature: /testOrOr|-4888923550082993745[0] +fun testOrOr(d: dynamic): Boolean + diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryOperator.kt b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryOperator.kt index 084e1132e61..2b82271e39a 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryOperator.kt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryOperator.kt @@ -1,6 +1,9 @@ // TARGET_BACKEND: JS_IR - // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57566 + fun testBinaryPlus(d: dynamic) = d + 1 fun testBinaryMinus(d: dynamic) = d - 1 fun testMul(d: dynamic) = d * 2 diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryOperator.sig.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryOperator.sig.kt.txt new file mode 100644 index 00000000000..b3e1f28b645 --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryOperator.sig.kt.txt @@ -0,0 +1,25 @@ +// CHECK JS_IR NATIVE: +// Mangled name: #testBinaryMinus(){} +// Public signature: /testBinaryMinus|-6906044509434142120[0] +fun testBinaryMinus(d: dynamic): dynamic + +// CHECK JS_IR NATIVE: +// Mangled name: #testBinaryPlus(){} +// Public signature: /testBinaryPlus|-1566186978437165994[0] +fun testBinaryPlus(d: dynamic): dynamic + +// CHECK JS_IR NATIVE: +// Mangled name: #testDiv(){} +// Public signature: /testDiv|-5313978605720972233[0] +fun testDiv(d: dynamic): dynamic + +// CHECK JS_IR NATIVE: +// Mangled name: #testMod(){} +// Public signature: /testMod|-4500464822782079065[0] +fun testMod(d: dynamic): dynamic + +// CHECK JS_IR NATIVE: +// Mangled name: #testMul(){} +// Public signature: /testMul|7374329083477531332[0] +fun testMul(d: dynamic): dynamic + diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryRelationalOperator.kt b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryRelationalOperator.kt index 15dadbb2220..c40f06c5b95 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryRelationalOperator.kt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryRelationalOperator.kt @@ -1,6 +1,9 @@ // TARGET_BACKEND: JS_IR - // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57566 + fun testLess(d: dynamic) = d < 2 fun testLessOrEqual(d: dynamic) = d <= 2 fun testGreater(d: dynamic) = d > 2 diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicBinaryRelationalOperator.sig.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryRelationalOperator.sig.kt.txt new file mode 100644 index 00000000000..e6a580182da --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/dynamicBinaryRelationalOperator.sig.kt.txt @@ -0,0 +1,20 @@ +// CHECK JS_IR NATIVE: +// Mangled name: #testGreater(){} +// Public signature: /testGreater|8630519043746384333[0] +fun testGreater(d: dynamic): Boolean + +// CHECK JS_IR NATIVE: +// Mangled name: #testGreaterOrEqual(){} +// Public signature: /testGreaterOrEqual|-4223395036536198085[0] +fun testGreaterOrEqual(d: dynamic): Boolean + +// CHECK JS_IR NATIVE: +// Mangled name: #testLess(){} +// Public signature: /testLess|7641985245454790157[0] +fun testLess(d: dynamic): Boolean + +// CHECK JS_IR NATIVE: +// Mangled name: #testLessOrEqual(){} +// Public signature: /testLessOrEqual|-6484107233559376103[0] +fun testLessOrEqual(d: dynamic): Boolean + diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicCall.kt b/compiler/testData/ir/irText/js/dynamic/dynamicCall.kt index 5313d17e804..4792c4109ce 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicCall.kt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicCall.kt @@ -1,5 +1,9 @@ // TARGET_BACKEND: JS_IR // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57566 + fun test1(d: dynamic) = d.member(1, 2, 3) fun test2(d: dynamic) = d?.member(1, 2, 3) diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicCall.sig.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicCall.sig.kt.txt new file mode 100644 index 00000000000..f6890eb7b74 --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/dynamicCall.sig.kt.txt @@ -0,0 +1,15 @@ +// CHECK JS_IR NATIVE: +// Mangled name: #test1(){} +// Public signature: /test1|4353482563436034667[0] +fun test1(d: dynamic): dynamic + +// CHECK JS_IR NATIVE: +// Mangled name: #test2(){} +// Public signature: /test2|-7945586224410659921[0] +fun test2(d: dynamic): dynamic + +// CHECK JS_IR NATIVE: +// Mangled name: #test3(){} +// Public signature: /test3|8250122632028727853[0] +fun test3(d: dynamic): dynamic + diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicElvisOperator.kt b/compiler/testData/ir/irText/js/dynamic/dynamicElvisOperator.kt index 529c52f56fa..b8d7ee2c84d 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicElvisOperator.kt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicElvisOperator.kt @@ -1,3 +1,6 @@ // TARGET_BACKEND: JS_IR +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57566 + fun test(d: dynamic) = d ?: "other" diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicElvisOperator.sig.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicElvisOperator.sig.kt.txt new file mode 100644 index 00000000000..0dac6d192eb --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/dynamicElvisOperator.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK JS_IR NATIVE: +// Mangled name: #test(){} +// Public signature: /test|8843648336650546510[0] +fun test(d: dynamic): dynamic + diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicExclExclOperator.kt b/compiler/testData/ir/irText/js/dynamic/dynamicExclExclOperator.kt index 643c44bfde5..2fc130c8962 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicExclExclOperator.kt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicExclExclOperator.kt @@ -1,4 +1,8 @@ // TARGET_BACKEND: JS_IR // IGNORE_BACKEND_K1: JS_IR // IGNORE_BACKEND_K1: JS_IR_ES6 + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57566 + fun test(d: dynamic) = d!! diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicExclExclOperator.sig.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicExclExclOperator.sig.kt.txt new file mode 100644 index 00000000000..0dac6d192eb --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/dynamicExclExclOperator.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK JS_IR NATIVE: +// Mangled name: #test(){} +// Public signature: /test|8843648336650546510[0] +fun test(d: dynamic): dynamic + diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicInfixCall.kt b/compiler/testData/ir/irText/js/dynamic/dynamicInfixCall.kt index 55daf4d5613..9473706d424 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicInfixCall.kt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicInfixCall.kt @@ -1,6 +1,9 @@ // TARGET_BACKEND: JS_IR - // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57566 + fun test1(d: dynamic) = d foo 123 fun test2(d: dynamic) = d invoke 123 diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicInfixCall.sig.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicInfixCall.sig.kt.txt new file mode 100644 index 00000000000..a8ba8136b37 --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/dynamicInfixCall.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK JS_IR NATIVE: +// Mangled name: #test1(){} +// Public signature: /test1|4353482563436034667[0] +fun test1(d: dynamic): dynamic + +// CHECK JS_IR NATIVE: +// Mangled name: #test2(){} +// Public signature: /test2|-7945586224410659921[0] +fun test2(d: dynamic): dynamic + diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicMemberAccess.kt b/compiler/testData/ir/irText/js/dynamic/dynamicMemberAccess.kt index 68551c24d3b..288e70c6f1b 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicMemberAccess.kt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicMemberAccess.kt @@ -1,6 +1,9 @@ // TARGET_BACKEND: JS_IR - // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57566 + fun test1(d: dynamic) = d.member fun test2(d: dynamic) = d?.member diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicMemberAccess.sig.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicMemberAccess.sig.kt.txt new file mode 100644 index 00000000000..a8ba8136b37 --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/dynamicMemberAccess.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK JS_IR NATIVE: +// Mangled name: #test1(){} +// Public signature: /test1|4353482563436034667[0] +fun test1(d: dynamic): dynamic + +// CHECK JS_IR NATIVE: +// Mangled name: #test2(){} +// Public signature: /test2|-7945586224410659921[0] +fun test2(d: dynamic): dynamic + diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicMemberAssignment.kt b/compiler/testData/ir/irText/js/dynamic/dynamicMemberAssignment.kt index 4fa2bbe2dc0..ef182722bc8 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicMemberAssignment.kt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicMemberAssignment.kt @@ -1,5 +1,8 @@ // TARGET_BACKEND: JS_IR +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57566 + fun testMemberAssignment(d: dynamic) { d.m = 1 } diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicMemberAssignment.sig.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicMemberAssignment.sig.kt.txt new file mode 100644 index 00000000000..27b615b9c9e --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/dynamicMemberAssignment.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #testMemberAssignment(){} +// Public signature: /testMemberAssignment|3403761995191046849[0] +fun testMemberAssignment(d: dynamic): Unit + +// CHECK: +// Mangled name: #testSafeMemberAssignment(){} +// Public signature: /testSafeMemberAssignment|1432313440653046937[0] +fun testSafeMemberAssignment(d: dynamic): Unit + diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicMemberAugmentedAssignment.kt b/compiler/testData/ir/irText/js/dynamic/dynamicMemberAugmentedAssignment.kt index bcfd2c76519..359cf272be3 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicMemberAugmentedAssignment.kt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicMemberAugmentedAssignment.kt @@ -1,5 +1,8 @@ // TARGET_BACKEND: JS_IR +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57566 + fun testAugmentedMemberAssignment(d: dynamic) { d.m += "+=" d.m -= "-=" diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicMemberAugmentedAssignment.sig.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicMemberAugmentedAssignment.sig.kt.txt new file mode 100644 index 00000000000..7be8eb6da6e --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/dynamicMemberAugmentedAssignment.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #testAugmentedMemberAssignment(){} +// Public signature: /testAugmentedMemberAssignment|6871762003023534167[0] +fun testAugmentedMemberAssignment(d: dynamic): Unit + +// CHECK: +// Mangled name: #testSafeAugmentedMemberAssignment(){} +// Public signature: /testSafeAugmentedMemberAssignment|9098819858529650270[0] +fun testSafeAugmentedMemberAssignment(d: dynamic): Unit + diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicMemberIncrementDecrement.sig.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicMemberIncrementDecrement.sig.kt.txt new file mode 100644 index 00000000000..ee4abe64b3d --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/dynamicMemberIncrementDecrement.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #testMemberIncrementDecrement(){} +// Public signature: /testMemberIncrementDecrement|1604694277771575268[0] +fun testMemberIncrementDecrement(d: dynamic): Unit + +// CHECK: +// Mangled name: #testSafeMemberIncrementDecrement(){} +// Public signature: /testSafeMemberIncrementDecrement|-4306216465980095979[0] +fun testSafeMemberIncrementDecrement(d: dynamic): Unit + diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicUnaryOperator.kt b/compiler/testData/ir/irText/js/dynamic/dynamicUnaryOperator.kt index afb714839a3..314cd44b93e 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicUnaryOperator.kt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicUnaryOperator.kt @@ -1,6 +1,9 @@ // TARGET_BACKEND: JS_IR - // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57566 + fun testUnaryMinus(d: dynamic) = -d fun testUnaryPlus(d: dynamic) = +d fun testExcl(d: dynamic) = !d diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicUnaryOperator.sig.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicUnaryOperator.sig.kt.txt new file mode 100644 index 00000000000..a0980239667 --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/dynamicUnaryOperator.sig.kt.txt @@ -0,0 +1,15 @@ +// CHECK JS_IR NATIVE: +// Mangled name: #testExcl(){} +// Public signature: /testExcl|1647775855598193701[0] +fun testExcl(d: dynamic): dynamic + +// CHECK JS_IR NATIVE: +// Mangled name: #testUnaryMinus(){} +// Public signature: /testUnaryMinus|2676344279010670857[0] +fun testUnaryMinus(d: dynamic): dynamic + +// CHECK JS_IR NATIVE: +// Mangled name: #testUnaryPlus(){} +// Public signature: /testUnaryPlus|3234645334485860647[0] +fun testUnaryPlus(d: dynamic): dynamic + diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicWithSmartCast.kt b/compiler/testData/ir/irText/js/dynamic/dynamicWithSmartCast.kt index a6824be370f..2bb60e34edc 100644 --- a/compiler/testData/ir/irText/js/dynamic/dynamicWithSmartCast.kt +++ b/compiler/testData/ir/irText/js/dynamic/dynamicWithSmartCast.kt @@ -1,6 +1,9 @@ // TARGET_BACKEND: JS_IR // WITH_STDLIB +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57566 + fun test1(d: dynamic) = if (d is String) d.length else -1 fun test2(d: dynamic) = if (d is Array<*>) d.size else -1 diff --git a/compiler/testData/ir/irText/js/dynamic/dynamicWithSmartCast.sig.kt.txt b/compiler/testData/ir/irText/js/dynamic/dynamicWithSmartCast.sig.kt.txt new file mode 100644 index 00000000000..86010b4ac7a --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/dynamicWithSmartCast.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK JS_IR NATIVE: +// Mangled name: #test1(){} +// Public signature: /test1|4353482563436034667[0] +fun test1(d: dynamic): Int + +// CHECK JS_IR NATIVE: +// Mangled name: #test2(){} +// Public signature: /test2|-7945586224410659921[0] +fun test2(d: dynamic): Int + diff --git a/compiler/testData/ir/irText/js/dynamic/implicitCastFromDynamic.kt b/compiler/testData/ir/irText/js/dynamic/implicitCastFromDynamic.kt index 7e8dd060023..14d15ab4c8e 100644 --- a/compiler/testData/ir/irText/js/dynamic/implicitCastFromDynamic.kt +++ b/compiler/testData/ir/irText/js/dynamic/implicitCastFromDynamic.kt @@ -1,6 +1,9 @@ // TARGET_BACKEND: JS_IR - // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57566 + val d: dynamic = 1 val p: Int = d diff --git a/compiler/testData/ir/irText/js/dynamic/implicitCastFromDynamic.sig.kt.txt b/compiler/testData/ir/irText/js/dynamic/implicitCastFromDynamic.sig.kt.txt new file mode 100644 index 00000000000..f41d6ff8912 --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/implicitCastFromDynamic.sig.kt.txt @@ -0,0 +1,38 @@ +// CHECK: +// Mangled name: {}d +// Public signature: /d|5174763769109925331[0] +val d: dynamic + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /d.|-6701718004621354461[0] + get + +// CHECK: +// Mangled name: {}p +// Public signature: /p|6715504260787941082[0] +val p: Int + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /p.|-1162552463316289847[0] + get + +// CHECK JS_IR NATIVE: +// Mangled name: #test1(){} +// Public signature: /test1|4353482563436034667[0] +fun test1(d: dynamic): Int + +// CHECK JS_IR NATIVE: +// Mangled name: #test2(){} +// Public signature: /test2|-7945586224410659921[0] +fun test2(d: dynamic): Any + +// CHECK JS_IR NATIVE: +// Mangled name: #test3(){} +// Public signature: /test3|8250122632028727853[0] +fun test3(d: dynamic): Any? + +// CHECK JS_IR NATIVE: +// Mangled name: #test4(){} +// Public signature: /test4|3998898222236566906[0] +fun test4(d: dynamic): String + diff --git a/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.kt b/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.kt index 0e08d4ff14b..09671137d4e 100644 --- a/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.kt +++ b/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.kt @@ -1,4 +1,8 @@ // TARGET_BACKEND: JS_IR + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57566 + val d1: dynamic = 1 val p: Int = 1 diff --git a/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.sig.kt.txt b/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.sig.kt.txt new file mode 100644 index 00000000000..783d7d26134 --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.sig.kt.txt @@ -0,0 +1,61 @@ +// CHECK: +// Mangled name: {}d1 +// Public signature: /d1|-2026668325688559202[0] +val d1: dynamic + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /d1.|3799770350020755350[0] + get + +// CHECK: +// Mangled name: {}p +// Public signature: /p|6715504260787941082[0] +val p: Int + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /p.|-1162552463316289847[0] + get + +// CHECK: +// Mangled name: {}d2 +// Public signature: /d2|-7196645270133305146[0] +var d2: dynamic + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /d2.|-1981535204947042648[0] + get + // CHECK: + // Mangled name: #(){} + // Public signature: /d2.|8009685074731428505[0] + set + +// CHECK: +// Mangled name: #test1(kotlin.String){} +// Public signature: /test1|3813564455063048258[0] +fun test1(s: String): Unit + +// CHECK: +// Mangled name: #test2(kotlin.Any){} +// Public signature: /test2|-8648451680149324146[0] +fun test2(a: Any): Unit + +// CHECK: +// Mangled name: #test3(kotlin.Any?){} +// Public signature: /test3|7681112685114804269[0] +fun test3(a: Any?): Unit + +// CHECK: +// Mangled name: #test4(kotlin.Any;kotlin.String;kotlin.Any?){} +// Public signature: /test4|-3496354737059131368[0] +fun test4(a: Any, s: String, na: Any?): Unit + +// CHECK: +// Mangled name: #test5(kotlin.Any;kotlin.String;kotlin.Any?){} +// Public signature: /test5|-54558059321704654[0] +fun test5(a: Any, s: String, na: Any?): Unit + +// CHECK JS_IR NATIVE: +// Mangled name: #withDynamic(){} +// Public signature: /withDynamic|4181319760857558891[0] +fun withDynamic(d: dynamic): dynamic + diff --git a/compiler/testData/ir/irText/js/dynamic/invokeOperator.kt b/compiler/testData/ir/irText/js/dynamic/invokeOperator.kt index 7d984cc8203..2393ee2ade8 100644 --- a/compiler/testData/ir/irText/js/dynamic/invokeOperator.kt +++ b/compiler/testData/ir/irText/js/dynamic/invokeOperator.kt @@ -1,6 +1,9 @@ // TARGET_BACKEND: JS_IR - // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57566 + fun invoke() {} fun test1(a: dynamic) = a(1) diff --git a/compiler/testData/ir/irText/js/dynamic/invokeOperator.sig.kt.txt b/compiler/testData/ir/irText/js/dynamic/invokeOperator.sig.kt.txt new file mode 100644 index 00000000000..5fb2576ff18 --- /dev/null +++ b/compiler/testData/ir/irText/js/dynamic/invokeOperator.sig.kt.txt @@ -0,0 +1,40 @@ +// CHECK: +// Mangled name: #invoke(){} +// Public signature: /invoke|-4663091332620260873[0] +fun invoke(): Unit + +// CHECK JS_IR NATIVE: +// Mangled name: #test1(){} +// Public signature: /test1|4353482563436034667[0] +fun test1(a: dynamic): dynamic + +// CHECK JS_IR NATIVE: +// Mangled name: #test2(){} +// Public signature: /test2|-7945586224410659921[0] +fun test2(a: dynamic): dynamic + +// CHECK JS_IR NATIVE: +// Mangled name: #test3(;){} +// Public signature: /test3|-5295421377258897884[0] +fun test3(a: dynamic, b: dynamic): dynamic + +// CHECK JS_IR NATIVE: +// Mangled name: #test4(;){} +// Public signature: /test4|-1850506594378519629[0] +fun test4(a: dynamic, b: dynamic): dynamic + +// CHECK JS_IR NATIVE: +// Mangled name: #test5(;){} +// Public signature: /test5|254402909642760010[0] +fun test5(a: dynamic, b: dynamic): dynamic + +// CHECK JS_IR NATIVE: +// Mangled name: #test6(;){} +// Public signature: /test6|2790484771664022046[0] +fun test6(a: dynamic, b: dynamic): dynamic + +// CHECK: +// Mangled name: #test7(){} +// Public signature: /test7|538407233409957251[0] +fun test7(a: dynamic): Unit + diff --git a/compiler/testData/ir/irText/js/external/kt38765.ir.txt b/compiler/testData/ir/irText/js/external/kt38765.ir.txt index a27fc09557c..c446764fcd4 100644 --- a/compiler/testData/ir/irText/js/external/kt38765.ir.txt +++ b/compiler/testData/ir/irText/js/external/kt38765.ir.txt @@ -61,6 +61,8 @@ FILE fqName:events fileName:/kt38765.kt init: EXPRESSION_BODY ENUM_CONSTRUCTOR_CALL 'private constructor () [external,primary] declared in events.internal.NestedExternalEnum' PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [external,fake_override,val] + annotations: + IntrinsicConstEvaluation overridden: public final name: kotlin.String [val] FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.String [external,fake_override] diff --git a/compiler/testData/ir/irText/js/external/kt38765.kt b/compiler/testData/ir/irText/js/external/kt38765.kt index 2be973c686d..07e75ea29db 100644 --- a/compiler/testData/ir/irText/js/external/kt38765.kt +++ b/compiler/testData/ir/irText/js/external/kt38765.kt @@ -1,6 +1,8 @@ // TARGET_BACKEND: JS_IR -// IGNORE_BACKEND_K1: JS_IR -// IGNORE_BACKEND_K1: JS_IR_ES6 + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57777 + package events external open class internal { diff --git a/compiler/testData/ir/irText/js/external/kt38765.kt.txt b/compiler/testData/ir/irText/js/external/kt38765.kt.txt index 156fb37c094..0aa163eebad 100644 --- a/compiler/testData/ir/irText/js/external/kt38765.kt.txt +++ b/compiler/testData/ir/irText/js/external/kt38765.kt.txt @@ -1,24 +1,24 @@ package events open external class internal { - external constructor() /* primary */ + external constructor() /* primary */ open external class EventEmitterP : internal { - external constructor() /* primary */ + external constructor() /* primary */ } open external class EventEmitterS : internal { - external constructor(a: Any) + external constructor(a: Any) } external object NestedExternalObject : internal { - private external constructor() /* primary */ + private external constructor() /* primary */ } external enum class NestedExternalEnum : Enum { - private external constructor() /* primary */ + private external constructor() /* primary */ A = NestedExternalEnum() B = NestedExternalEnum() @@ -27,6 +27,9 @@ open external class internal { external fun valueOf(value: String): NestedExternalEnum /* Synthetic body for ENUM_VALUEOF */ + external val entries: EnumEntries + external get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ + } external interface NestedExternalInterface { diff --git a/compiler/testData/ir/irText/js/external/kt38765.sig.kt.txt b/compiler/testData/ir/irText/js/external/kt38765.sig.kt.txt new file mode 100644 index 00000000000..73c417384e7 --- /dev/null +++ b/compiler/testData/ir/irText/js/external/kt38765.sig.kt.txt @@ -0,0 +1,130 @@ +package events + +// CHECK: +// Mangled name: events.internal +// Public signature: events/internal|null[0] +open external class internal { + // CHECK: + // Mangled name: events.internal.EventEmitterP + // Public signature: events/internal.EventEmitterP|null[0] + open external class EventEmitterP : internal { + // CHECK: + // Mangled name: events.internal.EventEmitterP#(){} + // Public signature: events/internal.EventEmitterP.|-5645683436151566731[0] + external constructor() /* primary */ + + } + + // CHECK: + // Mangled name: events.internal.EventEmitterS + // Public signature: events/internal.EventEmitterS|null[0] + open external class EventEmitterS : internal { + // CHECK: + // Mangled name: events.internal.EventEmitterS#(kotlin.Any){} + // Public signature: events/internal.EventEmitterS.|4518179880532599055[0] + external constructor(a: Any) + + } + + // CHECK: + // Mangled name: events.internal.NestedExternalEnum + // Public signature: events/internal.NestedExternalEnum|null[0] + external enum class NestedExternalEnum : Enum { + // CHECK: + // Mangled name: events.internal.NestedExternalEnum#(){} + // Public signature: events/internal.NestedExternalEnum.|-5645683436151566731[0] + private external constructor() /* primary */ + // CHECK: + // Mangled name: events.internal.NestedExternalEnum.A + // Public signature: events/internal.NestedExternalEnum.A|null[0] + A + + // CHECK: + // Mangled name: events.internal.NestedExternalEnum.B + // Public signature: events/internal.NestedExternalEnum.B|null[0] + B + + // CHECK JS_IR NATIVE: + // Mangled name: events.internal.NestedExternalEnum#valueOf#static(kotlin.String){} + // Public signature: events/internal.NestedExternalEnum.valueOf|-4683474617854611729[0] + external fun valueOf(value: String): NestedExternalEnum + + // CHECK JS_IR NATIVE: + // Mangled name: events.internal.NestedExternalEnum#values#static(){} + // Public signature: events/internal.NestedExternalEnum.values|-8715569000920726747[0] + external fun values(): Array + + // CHECK JS_IR NATIVE: + // Mangled name: events.internal.NestedExternalEnum#compareTo(events.internal.NestedExternalEnum){} + // Public signature: events/internal.NestedExternalEnum.compareTo|-4902667871773591290[0] + external /* fake */ override operator fun compareTo(other: NestedExternalEnum): Int + + // CHECK JS_IR NATIVE: + // Mangled name: events.internal.NestedExternalEnum#equals(kotlin.Any?){} + // Public signature: events/internal.NestedExternalEnum.equals|4638265728071529943[0] + external /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JS_IR NATIVE: + // Mangled name: events.internal.NestedExternalEnum#hashCode(){} + // Public signature: events/internal.NestedExternalEnum.hashCode|3409210261493131192[0] + external /* fake */ override fun hashCode(): Int + + // CHECK JS_IR NATIVE: + // Mangled name: events.internal.NestedExternalEnum#toString(){} + // Public signature: events/internal.NestedExternalEnum.toString|-1522858123163872138[0] + external /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: events.internal.NestedExternalEnum#static{}entries + // Public signature: events/internal.NestedExternalEnum.entries|-5134227801081826149[0] + external val entries: EnumEntries + // CHECK JS_IR NATIVE: + // Mangled name: events.internal.NestedExternalEnum##static(){} + // Public signature: events/internal.NestedExternalEnum.entries.|-6068527377476727729[0] + external get(): EnumEntries + + // CHECK: + // Mangled name: events.internal.NestedExternalEnum{}name + // Public signature: events/internal.NestedExternalEnum.name|4231860309499509769[0] + external /* fake */ override val name: String + // CHECK JS_IR NATIVE: + // Mangled name: events.internal.NestedExternalEnum#(){} + // Public signature: events/internal.NestedExternalEnum.name.|5879344792307730109[0] + external /* fake */ override get(): String + + // CHECK: + // Mangled name: events.internal.NestedExternalEnum{}ordinal + // Public signature: events/internal.NestedExternalEnum.ordinal|1912745122988592376[0] + external /* fake */ override val ordinal: Int + // CHECK JS_IR NATIVE: + // Mangled name: events.internal.NestedExternalEnum#(){} + // Public signature: events/internal.NestedExternalEnum.ordinal.|8409904226035914023[0] + external /* fake */ override get(): Int + + } + + // CHECK: + // Mangled name: events.internal.NestedExternalInterface + // Public signature: events/internal.NestedExternalInterface|null[0] + external interface NestedExternalInterface { + + } + + // CHECK: + // Mangled name: events.internal.NestedExternalObject + // Public signature: events/internal.NestedExternalObject|null[0] + external object NestedExternalObject : internal { + // CHECK: + // Mangled name: events.internal.NestedExternalObject#(){} + // Public signature: events/internal.NestedExternalObject.|-5645683436151566731[0] + private external constructor() /* primary */ + + } + + // CHECK: + // Mangled name: events.internal#(){} + // Public signature: events/internal.|-5645683436151566731[0] + external constructor() /* primary */ + +} + diff --git a/compiler/testData/ir/irText/js/native/nativeNativeKotlin.kt.txt b/compiler/testData/ir/irText/js/native/nativeNativeKotlin.kt.txt index aa41d859c64..7ec107e260a 100644 --- a/compiler/testData/ir/irText/js/native/nativeNativeKotlin.kt.txt +++ b/compiler/testData/ir/irText/js/native/nativeNativeKotlin.kt.txt @@ -1,13 +1,13 @@ package foo open external class A { - external constructor() /* primary */ + external constructor() /* primary */ external fun foo(): String } open external class B : A { - external constructor() /* primary */ + external constructor() /* primary */ external fun bar(): String } diff --git a/compiler/testData/ir/irText/js/native/nativeNativeKotlin.sig.kt.txt b/compiler/testData/ir/irText/js/native/nativeNativeKotlin.sig.kt.txt new file mode 100644 index 00000000000..9ad9f7e81a3 --- /dev/null +++ b/compiler/testData/ir/irText/js/native/nativeNativeKotlin.sig.kt.txt @@ -0,0 +1,64 @@ +package foo + +// CHECK: +// Mangled name: foo.A +// Public signature: foo/A|null[0] +open external class A { + // CHECK: + // Mangled name: foo.A#(){} + // Public signature: foo/A.|-5645683436151566731[0] + external constructor() /* primary */ + + // CHECK JS_IR NATIVE: + // Mangled name: foo.A#foo(){} + // Public signature: foo/A.foo|-1041209573719867811[0] + external fun foo(): String + +} + +// CHECK: +// Mangled name: foo.B +// Public signature: foo/B|null[0] +open external class B : A { + // CHECK: + // Mangled name: foo.B#(){} + // Public signature: foo/B.|-5645683436151566731[0] + external constructor() /* primary */ + + // CHECK JS_IR NATIVE: + // Mangled name: foo.B#foo(){} + // Public signature: foo/B.foo|-1041209573719867811[0] + external /* fake */ override fun foo(): String + + // CHECK JS_IR NATIVE: + // Mangled name: foo.B#bar(){} + // Public signature: foo/B.bar|496682602797471549[0] + external fun bar(): String + +} + +// CHECK: +// Mangled name: foo.C +// Public signature: foo/C|null[0] +class C : B { + // CHECK: + // Mangled name: foo.C#(){} + // Public signature: foo/C.|-5645683436151566731[0] + constructor() /* primary */ + // CHECK JS_IR NATIVE: + // Mangled name: foo.C#bar(){} + // Public signature: foo/C.bar|496682602797471549[0] + /* fake */ override fun bar(): String + + // CHECK JS_IR NATIVE: + // Mangled name: foo.C#foo(){} + // Public signature: foo/C.foo|-1041209573719867811[0] + /* fake */ override fun foo(): String + +} + +// CHECK JS_IR NATIVE: +// Mangled name: foo#box(){} +// Public signature: foo/box|2173511048851971368[0] +fun box(): String + diff --git a/compiler/testData/ir/irText/lambdas/anonymousFunction.kt b/compiler/testData/ir/irText/lambdas/anonymousFunction.kt index 4fb2bd03162..4ff9e9ae4ea 100644 --- a/compiler/testData/ir/irText/lambdas/anonymousFunction.kt +++ b/compiler/testData/ir/irText/lambdas/anonymousFunction.kt @@ -1,6 +1,10 @@ // FIR_IDENTICAL // WITH_STDLIB +// DUMP_LOCAL_DECLARATION_SIGNATURES // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57428 + val anonymous = fun() { println() } diff --git a/compiler/testData/ir/irText/lambdas/anonymousFunction.sig.kt.txt b/compiler/testData/ir/irText/lambdas/anonymousFunction.sig.kt.txt new file mode 100644 index 00000000000..c918abee2b9 --- /dev/null +++ b/compiler/testData/ir/irText/lambdas/anonymousFunction.sig.kt.txt @@ -0,0 +1,18 @@ +// CHECK: +// Mangled name: {}anonymous +// Public signature: /anonymous|-1633601112294415930[0] +val anonymous: Function0 + field + // CHECK JVM_IR: + // Mangled name (compatible mode: false): {}anonymous##static(){} + // Mangled name (compatible mode: true): anonymous##static(){} + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /anonymous.|-7938030596525369571[0] + local fun (): Unit + + // CHECK: + // Mangled name: #(){}kotlin.Function0 + // Public signature: /anonymous.|4047260013555274752[0] + get + diff --git a/compiler/testData/ir/irText/lambdas/destructuringInLambda.sig.kt.txt b/compiler/testData/ir/irText/lambdas/destructuringInLambda.sig.kt.txt new file mode 100644 index 00000000000..8cf516e1ab1 --- /dev/null +++ b/compiler/testData/ir/irText/lambdas/destructuringInLambda.sig.kt.txt @@ -0,0 +1,98 @@ +// CHECK: +// Mangled name: {}fn +// Public signature: /fn|-1096960354582375131[0] +var fn: Function1 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function1 + // Public signature: /fn.|-1538543637358155392[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /fn.|7436020190901948688[0] + get + // CHECK: + // Mangled name: #(kotlin.Function1){} + // Public signature: /fn.|5076231225819362553[0] + set + +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +data class A { + // CHECK: + // Mangled name: A{}x + // Public signature: /A.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: A{}y + // Public signature: /A.y|3625903257357557171[0] + val y: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.y.|-6745575372101973707[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.y.|-7902422373892128922[0] + get + + // CHECK: + // Mangled name: A#(kotlin.Int;kotlin.Int){} + // Public signature: /A.|-7691762014320324121[0] + constructor(x: Int, y: Int) /* primary */ + // CHECK JVM_IR: + // Mangled name: A#component1(){}kotlin.Int + // Public signature: /A.component1|-8217597213800111288[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#component1(){} + // Public signature: /A.component1|162597135895221648[0] + operator fun component1(): Int + + // CHECK JVM_IR: + // Mangled name: A#component2(){}kotlin.Int + // Public signature: /A.component2|-7444333055342785242[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#component2(){} + // Public signature: /A.component2|3796717572321500973[0] + operator fun component2(): Int + + // CHECK JVM_IR: + // Mangled name: A#copy(kotlin.Int;kotlin.Int){}A + // Public signature: /A.copy|1926272323689019234[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#copy(kotlin.Int;kotlin.Int){} + // Public signature: /A.copy|4382504155595030584[0] + fun copy(x: Int, y: Int): A + + // CHECK JVM_IR: + // Mangled name: A#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /A.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#equals(kotlin.Any?){} + // Public signature: /A.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: A#hashCode(){}kotlin.Int + // Public signature: /A.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#hashCode(){} + // Public signature: /A.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: A#toString(){}kotlin.String + // Public signature: /A.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#toString(){} + // Public signature: /A.toString|-1522858123163872138[0] + override fun toString(): String + +} + diff --git a/compiler/testData/ir/irText/lambdas/extensionLambda.sig.kt.txt b/compiler/testData/ir/irText/lambdas/extensionLambda.sig.kt.txt new file mode 100644 index 00000000000..8dabd5dca1f --- /dev/null +++ b/compiler/testData/ir/irText/lambdas/extensionLambda.sig.kt.txt @@ -0,0 +1,8 @@ +// CHECK JVM_IR: +// Mangled name: #test1(){}kotlin.Int +// Public signature: /test1|3246027394688469880[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +fun test1(): Int + diff --git a/compiler/testData/ir/irText/lambdas/justLambda.kt b/compiler/testData/ir/irText/lambdas/justLambda.kt index 274aabf0789..2b150212a69 100644 --- a/compiler/testData/ir/irText/lambdas/justLambda.kt +++ b/compiler/testData/ir/irText/lambdas/justLambda.kt @@ -1,4 +1,9 @@ // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: JS_IR +// MUTE_SIGNATURE_COMPARISON_K2: NATIVE +// ^ KT-57818 + val test1 = { 42 } -val test2 = { } \ No newline at end of file +val test2 = { } diff --git a/compiler/testData/ir/irText/lambdas/justLambda.sig.kt.txt b/compiler/testData/ir/irText/lambdas/justLambda.sig.kt.txt new file mode 100644 index 00000000000..da0569c3cc8 --- /dev/null +++ b/compiler/testData/ir/irText/lambdas/justLambda.sig.kt.txt @@ -0,0 +1,24 @@ +// CHECK: +// Mangled name: {}test1 +// Public signature: /test1|6005685442305498193[0] +val test1: Function0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function0 + // Public signature: /test1.|3140014614812373095[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test1.|-5735092642142423279[0] + get + +// CHECK: +// Mangled name: {}test2 +// Public signature: /test2|2517758057000911509[0] +val test2: Function0 + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Function0 + // Public signature: /test2.|-6581063117552766488[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test2.|-5218942532816206869[0] + get + diff --git a/compiler/testData/ir/irText/lambdas/lambdaReturningUnit.sig.kt.txt b/compiler/testData/ir/irText/lambdas/lambdaReturningUnit.sig.kt.txt new file mode 100644 index 00000000000..667275be3e5 --- /dev/null +++ b/compiler/testData/ir/irText/lambdas/lambdaReturningUnit.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #box(){} +// Public signature: /box|2173511048851971368[0] +suspend fun box(): Unit + +// CHECK: +// Mangled name: #flaf(kotlin.Function0){} +// Public signature: /flaf|8689906342143583664[0] +inline fun flaf(block: Function0): Unit + diff --git a/compiler/testData/ir/irText/lambdas/localFunction.sig.kt.txt b/compiler/testData/ir/irText/lambdas/localFunction.sig.kt.txt new file mode 100644 index 00000000000..1bfc407c7fc --- /dev/null +++ b/compiler/testData/ir/irText/lambdas/localFunction.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #outer(){} +// Public signature: /outer|1607449560170809066[0] +fun outer(): Unit + diff --git a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.sig.kt.txt b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.sig.kt.txt new file mode 100644 index 00000000000..a6d969227c5 --- /dev/null +++ b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.sig.kt.txt @@ -0,0 +1,61 @@ +// CHECK: +// Mangled name: IFoo +// Public signature: /IFoo|null[0] +interface IFoo { + + // CHECK: + // Mangled name: IFoo@A{}foo + // Public signature: /IFoo.foo|1214000299789500455[0] + val A.foo: B + // CHECK JVM_IR: + // Mangled name: IFoo#@A(){}B + // Public signature: /IFoo.foo.|8070848468738985847[0] + // CHECK JS_IR NATIVE: + // Mangled name: IFoo#@A(){} + // Public signature: /IFoo.foo.|-1820743651074494698[0] + get(): B + +} + +// CHECK: +// Mangled name: IInvoke +// Public signature: /IInvoke|null[0] +interface IInvoke { + + // CHECK JVM_IR: + // Mangled name: IInvoke#invoke@B(){}kotlin.Int + // Public signature: /IInvoke.invoke|7560171197904259096[0] + // CHECK JS_IR NATIVE: + // Mangled name: IInvoke#invoke@B(){} + // Public signature: /IInvoke.invoke|-8763880178141053779[0] + operator fun B.invoke(): Int + +} + +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +object A { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + private constructor() /* primary */ + +} + +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +object B { + // CHECK: + // Mangled name: B#(){} + // Public signature: /B.|-5645683436151566731[0] + private constructor() /* primary */ + +} + +// CHECK: +// Mangled name: #test(IFoo;IInvoke){} +// Public signature: /test|8554265419982095815[0] +fun test(fooImpl: IFoo, invokeImpl: IInvoke): Unit + diff --git a/compiler/testData/ir/irText/lambdas/nonLocalReturn.sig.kt.txt b/compiler/testData/ir/irText/lambdas/nonLocalReturn.sig.kt.txt new file mode 100644 index 00000000000..1b813100ff2 --- /dev/null +++ b/compiler/testData/ir/irText/lambdas/nonLocalReturn.sig.kt.txt @@ -0,0 +1,30 @@ +// CHECK: +// Mangled name: #test0(){} +// Public signature: /test0|-2819007353171228053[0] +fun test0(): Unit + +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +fun test1(): Unit + +// CHECK: +// Mangled name: #test2(){} +// Public signature: /test2|4279114864133353152[0] +fun test2(): Unit + +// CHECK: +// Mangled name: #test3(){} +// Public signature: /test3|-3759735065270951803[0] +fun test3(): Unit + +// CHECK: +// Mangled name: #testLrmFoo1(kotlin.collections.List){} +// Public signature: /testLrmFoo1|3318128046819540804[0] +fun testLrmFoo1(ints: List): Unit + +// CHECK: +// Mangled name: #testLrmFoo2(kotlin.collections.List){} +// Public signature: /testLrmFoo2|-5288542979552034590[0] +fun testLrmFoo2(ints: List): Unit + diff --git a/compiler/testData/ir/irText/lambdas/samAdapter.kt b/compiler/testData/ir/irText/lambdas/samAdapter.kt index 05ff00b5aca..e3a248b9462 100644 --- a/compiler/testData/ir/irText/lambdas/samAdapter.kt +++ b/compiler/testData/ir/irText/lambdas/samAdapter.kt @@ -5,4 +5,4 @@ fun test1() { val hello = Runnable { println("Hello, world!") } hello.run() -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/lambdas/samAdapter.sig.kt.txt b/compiler/testData/ir/irText/lambdas/samAdapter.sig.kt.txt new file mode 100644 index 00000000000..bbcccb9d294 --- /dev/null +++ b/compiler/testData/ir/irText/lambdas/samAdapter.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +fun test1(): Unit + diff --git a/compiler/testData/ir/irText/properties/backingField/backingFieldVisibility.sig.kt.txt b/compiler/testData/ir/irText/properties/backingField/backingFieldVisibility.sig.kt.txt new file mode 100644 index 00000000000..892612ce4cc --- /dev/null +++ b/compiler/testData/ir/irText/properties/backingField/backingFieldVisibility.sig.kt.txt @@ -0,0 +1,68 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A { + // CHECK: + // Mangled name: A{}a + // Public signature: /A.a|-1200697420457237799[0] + val a: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Number + // Public signature: /A.a.|-5418543833660929450[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.a.|6785176174175479410[0] + get + + // CHECK: + // Mangled name: A{}b + // Public signature: /A.b|772347207915745207[0] + val b: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Number + // Public signature: /A.b.|2675477957877241625[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.b.|812004636995167743[0] + get + + // CHECK: + // Mangled name: A{}c + // Public signature: /A.c|-4416962153448040627[0] + val c: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.c.|-2440337234483931882[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.c.|2368736057102379596[0] + get + + // CHECK: + // Mangled name: A{}d + // Public signature: /A.d|5174763769109925331[0] + val d: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.d.|-3703416348690628760[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.d.|-6701718004621354461[0] + get + + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: A#rest(){} + // Public signature: /A.rest|-218529575230056205[0] + fun rest(): Unit + +} + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit diff --git a/compiler/testData/ir/irText/properties/backingField/explicitBackingFieldType.sig.kt.txt b/compiler/testData/ir/irText/properties/backingField/explicitBackingFieldType.sig.kt.txt new file mode 100644 index 00000000000..ebce03c772c --- /dev/null +++ b/compiler/testData/ir/irText/properties/backingField/explicitBackingFieldType.sig.kt.txt @@ -0,0 +1,62 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A { + // CHECK: + // Mangled name: A{}a + // Public signature: /A.a|-1200697420457237799[0] + val a: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.a.|4232747788241509192[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.a.|6785176174175479410[0] + get + + // CHECK: + // Mangled name: A{}it + // Public signature: /A.it|3309866017710461759[0] + val it: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Number + // Public signature: /A.it.|-5000280677775858846[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.it.|1332554369542649775[0] + get + + // CHECK: + // Mangled name: A{}invertedTypes + // Public signature: /A.invertedTypes|-5387375160663636997[0] + var invertedTypes: Number + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.invertedTypes.|-1770574096074676248[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.invertedTypes.|6483831475743108403[0] + get(): Int + // CHECK: + // Mangled name: A#(kotlin.Int){} + // Public signature: /A.invertedTypes.|7674452151545793623[0] + set + + // CHECK: + // Mangled name: A{}p + // Public signature: /A.p|6715504260787941082[0] + val p: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.p.|5329635969197638839[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.p.|-1162552463316289847[0] + get(): Int + + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + +} diff --git a/compiler/testData/ir/irText/properties/backingField/independentBackingFieldType.sig.kt.txt b/compiler/testData/ir/irText/properties/backingField/independentBackingFieldType.sig.kt.txt new file mode 100644 index 00000000000..78d82f4d88d --- /dev/null +++ b/compiler/testData/ir/irText/properties/backingField/independentBackingFieldType.sig.kt.txt @@ -0,0 +1,31 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A { + // CHECK: + // Mangled name: A{}it + // Public signature: /A.it|3309866017710461759[0] + var it: Double + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.it.|6190054477763999448[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.it.|1332554369542649775[0] + get(): Int + // CHECK: + // Mangled name: A#(kotlin.Int){} + // Public signature: /A.it.|-4393420298619979651[0] + set(value: Int): Unit + + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit diff --git a/compiler/testData/ir/irText/properties/backingField/propertyTypeNarrowing.sig.kt.txt b/compiler/testData/ir/irText/properties/backingField/propertyTypeNarrowing.sig.kt.txt new file mode 100644 index 00000000000..7c9e41708f6 --- /dev/null +++ b/compiler/testData/ir/irText/properties/backingField/propertyTypeNarrowing.sig.kt.txt @@ -0,0 +1,47 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A { + // CHECK: + // Mangled name: A{}it + // Public signature: /A.it|3309866017710461759[0] + val it: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Number + // Public signature: /A.it.|-5000280677775858846[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.it.|1332554369542649775[0] + get + + // CHECK: + // Mangled name: A{}p + // Public signature: /A.p|6715504260787941082[0] + val p: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.p.|5329635969197638839[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.p.|-1162552463316289847[0] + get(): Int + + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: A#test(){}kotlin.Int + // Public signature: /A.test|4216975235718029399[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#test(){} + // Public signature: /A.test|6620506149988718649[0] + fun test(): Int + +} + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit diff --git a/compiler/testData/ir/irText/regressions/coercionInLoop.sig.kt.txt b/compiler/testData/ir/irText/regressions/coercionInLoop.sig.kt.txt new file mode 100644 index 00000000000..db9fda4185d --- /dev/null +++ b/compiler/testData/ir/irText/regressions/coercionInLoop.sig.kt.txt @@ -0,0 +1,8 @@ +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +// CHECK JS_IR NATIVE: +// Mangled name: #box(){} +// Public signature: /box|2173511048851971368[0] +fun box(): String + diff --git a/compiler/testData/ir/irText/regressions/integerCoercionToT.kt b/compiler/testData/ir/irText/regressions/integerCoercionToT.kt index f02aa672943..364806c5209 100644 --- a/compiler/testData/ir/irText/regressions/integerCoercionToT.kt +++ b/compiler/testData/ir/irText/regressions/integerCoercionToT.kt @@ -1,6 +1,9 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57436 + interface CPointed inline fun CPointed.reinterpret(): T = TODO() diff --git a/compiler/testData/ir/irText/regressions/integerCoercionToT.sig.kt.txt b/compiler/testData/ir/irText/regressions/integerCoercionToT.sig.kt.txt new file mode 100644 index 00000000000..a08d0233efc --- /dev/null +++ b/compiler/testData/ir/irText/regressions/integerCoercionToT.sig.kt.txt @@ -0,0 +1,74 @@ +// CHECK: +// Mangled name: CInt32VarX +// Public signature: /CInt32VarX|null[0] +class CInt32VarX : CPointed { + // CHECK: + // Mangled name: CInt32VarX#(){} + // Public signature: /CInt32VarX.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: IdType +// Public signature: /IdType|null[0] +class IdType : CPointed { + // CHECK: + // Mangled name: IdType{}value + // Public signature: /IdType.value|1987073854177347439[0] + val value: Int + // CHECK JVM_IR: + // Mangled name: IdType#(){}kotlin.Int + // Public signature: /IdType.value.|-5900028706170996[0] + // CHECK JS_IR NATIVE: + // Mangled name: IdType#(){} + // Public signature: /IdType.value.|3260093555963109437[0] + get + + // CHECK: + // Mangled name: IdType#(kotlin.Int){} + // Public signature: /IdType.|-5182794243525578284[0] + constructor(value: Int) /* primary */ + +} + +// CHECK: +// Mangled name: CPointed +// Public signature: /CPointed|null[0] +interface CPointed { + +} + +// CHECK: +// Mangled name: #foo(IdType;CInt32VarX){} +// Public signature: /foo|-5455779368502417749[0] +fun foo(value: IdType, cv: CInt32VarX): Unit + +// CHECK JVM_IR: +// Mangled name: #reinterpret@CPointed(){0§}0:0 +// Public signature: /reinterpret|6686627751758834868[0] +// CHECK JS_IR NATIVE: +// Mangled name: #reinterpret@CPointed(){0§} +// Public signature: /reinterpret|-1583466554098866733[0] +inline fun CPointed.reinterpret(): T + +// CHECK: +// Mangled name: @CInt32VarX<0:0>{0§}value +// Public signature: /value|-135689265793066449[0] +var CInt32VarX.value: T_INT + // CHECK JVM_IR: + // Mangled name: #@CInt32VarX<0:0>(){0§}0:0 + // Public signature: /value.|2596477086313818765[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@CInt32VarX<0:0>(){0§} + // Public signature: /value.|7308799289468598697[0] + get(): T_INT + // CHECK: + // Mangled name: #@CInt32VarX<0:0>(0:0){0§} + // Public signature: /value.|4371752181027190206[0] + set(value: T_INT): Unit + +// CHECK: +// Mangled name: CInt32Var +// Public signature: /CInt32Var|null[0] +typealias CInt32Var = CInt32VarX diff --git a/compiler/testData/ir/irText/regressions/kt24114.sig.kt.txt b/compiler/testData/ir/irText/regressions/kt24114.sig.kt.txt new file mode 100644 index 00000000000..f32a9227ba7 --- /dev/null +++ b/compiler/testData/ir/irText/regressions/kt24114.sig.kt.txt @@ -0,0 +1,32 @@ +// CHECK JVM_IR: +// Mangled name: #one(){}kotlin.Int +// Public signature: /one|-1338778839794458943[0] +// CHECK JS_IR NATIVE: +// Mangled name: #one(){} +// Public signature: /one|-883930323179095603[0] +fun one(): Int + +// CHECK JVM_IR: +// Mangled name: #test1(){}kotlin.Int +// Public signature: /test1|3246027394688469880[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +fun test1(): Int + +// CHECK JVM_IR: +// Mangled name: #test2(){}kotlin.Int +// Public signature: /test2|5542371834528279174[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2(){} +// Public signature: /test2|4279114864133353152[0] +fun test2(): Int + +// CHECK JVM_IR: +// Mangled name: #two(){}kotlin.Int +// Public signature: /two|-3668245894055563667[0] +// CHECK JS_IR NATIVE: +// Mangled name: #two(){} +// Public signature: /two|-8191816142589217386[0] +fun two(): Int + diff --git a/compiler/testData/ir/irText/regressions/kt44855.sig.kt.txt b/compiler/testData/ir/irText/regressions/kt44855.sig.kt.txt new file mode 100644 index 00000000000..1dcc7848bd3 --- /dev/null +++ b/compiler/testData/ir/irText/regressions/kt44855.sig.kt.txt @@ -0,0 +1,41 @@ +// CHECK: +// Mangled name: Child +// Public signature: /Child|null[0] +open class Child : Parent { + // CHECK: + // Mangled name: Child{}x + // Public signature: /Child.x|-8060530855978347579[0] + val x: Parent? + // CHECK JVM_IR: + // Mangled name: Child#(){}Parent? + // Public signature: /Child.x.|-4268238355990068356[0] + get + + // CHECK: + // Mangled name: Child.QQQ + // Public signature: /Child.QQQ|null[0] + inner class QQQ { + // CHECK: + // Mangled name: Child.QQQ#(){} + // Public signature: /Child.QQQ.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Child.QQQ#z(){} + // Public signature: /Child.QQQ.z|-6990221057904452282[0] + fun z(): Unit + + } + + // CHECK: + // Mangled name: Child#(Parent?){} + // Public signature: /Child.|690323910030303924[0] + constructor(x: Parent?) /* primary */ + + // CHECK JVM_IR: + // Mangled name: Child#getQqq(){}kotlin.String? + // Public signature: /Child.getQqq|2603726480275639305[0] + /* fake */ override fun getQqq(): String? + +} + diff --git a/compiler/testData/ir/irText/regressions/kt45236.kt b/compiler/testData/ir/irText/regressions/kt45236.kt index d9f7b23e1e8..8d8b7dee569 100644 --- a/compiler/testData/ir/irText/regressions/kt45236.kt +++ b/compiler/testData/ir/irText/regressions/kt45236.kt @@ -2,6 +2,9 @@ // SKIP_KT_DUMP // TARGET_BACKEND: JVM_IR +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429 + import kotlin.contracts.ExperimentalContracts import kotlin.contracts.contract diff --git a/compiler/testData/ir/irText/regressions/kt45236.sig.kt.txt b/compiler/testData/ir/irText/regressions/kt45236.sig.kt.txt new file mode 100644 index 00000000000..1a6c5423b36 --- /dev/null +++ b/compiler/testData/ir/irText/regressions/kt45236.sig.kt.txt @@ -0,0 +1,89 @@ +// CHECK: +// Mangled name: NetRequestStatus +// Public signature: /NetRequestStatus|null[0] +sealed class NetRequestStatus { + // CHECK: + // Mangled name: NetRequestStatus.Error + // Public signature: /NetRequestStatus.Error|null[0] + data class Error : NetRequestStatus { + // CHECK: + // Mangled name: NetRequestStatus.Error{}error + // Public signature: /NetRequestStatus.Error.error|6099401258667737098[0] + val error: Throwable + // CHECK JVM_IR: + // Mangled name: NetRequestStatus.Error#(){}kotlin.Throwable + // Public signature: /NetRequestStatus.Error.error.|-5591110135270758069[0] + get + + // CHECK: + // Mangled name: NetRequestStatus.Error{}value + // Public signature: /NetRequestStatus.Error.value|1987073854177347439[0] + override val value: T? + // CHECK JVM_IR: + // Mangled name: NetRequestStatus.Error#(){}1:0? + // Public signature: /NetRequestStatus.Error.value.|6345929521467247406[0] + override get + + // CHECK: + // Mangled name: NetRequestStatus.Error#(kotlin.Throwable;1:0?){} + // Public signature: /NetRequestStatus.Error.|-1373568199086185373[0] + constructor(error: Throwable, value: T?) /* primary */ + // CHECK JVM_IR: + // Mangled name: NetRequestStatus.Error#component1(){}kotlin.Throwable + // Public signature: /NetRequestStatus.Error.component1|2250146239720393392[0] + operator fun component1(): Throwable + + // CHECK JVM_IR: + // Mangled name: NetRequestStatus.Error#component2(){}1:0? + // Public signature: /NetRequestStatus.Error.component2|8724683043803012713[0] + operator fun component2(): T? + + // CHECK JVM_IR: + // Mangled name: NetRequestStatus.Error#copy(kotlin.Throwable;1:0?){}NetRequestStatus.Error<1:0> + // Public signature: /NetRequestStatus.Error.copy|1925006413771870834[0] + fun copy(error: Throwable, value: T?): Error + + // CHECK JVM_IR: + // Mangled name: NetRequestStatus.Error#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /NetRequestStatus.Error.equals|722809408929142791[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: NetRequestStatus.Error#hashCode(){}kotlin.Int + // Public signature: /NetRequestStatus.Error.hashCode|-8048879360829830756[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: NetRequestStatus.Error#toString(){}kotlin.String + // Public signature: /NetRequestStatus.Error.toString|6958853723545266802[0] + override fun toString(): String + + } + + // CHECK: + // Mangled name: NetRequestStatus#(){} + // Public signature: /NetRequestStatus.|-5645683436151566731[0] + protected constructor() /* primary */ + + // CHECK: + // Mangled name: NetRequestStatus{}value + // Public signature: /NetRequestStatus.value|1987073854177347439[0] + abstract val value: T? + // CHECK JVM_IR: + // Mangled name: NetRequestStatus#(){}1:0? + // Public signature: /NetRequestStatus.value.|6345929521467247406[0] + abstract get + +} + +// CHECK JVM_IR: +// Mangled name: #isError@NetRequestStatus<0:0>(){0§}kotlin.Boolean +// Public signature: /isError|6754547245432239931[0] +@OptIn(markerClass = [ExperimentalContracts::class]) +fun NetRequestStatus.isError(): Boolean + +// CHECK: +// Mangled name: #successOrThrow(){0§} +// Public signature: /successOrThrow|8924064942759337382[0] +fun successOrThrow(): Unit + diff --git a/compiler/testData/ir/irText/regressions/newInferenceFixationOrder1.sig.kt.txt b/compiler/testData/ir/irText/regressions/newInferenceFixationOrder1.sig.kt.txt new file mode 100644 index 00000000000..c1bc4559abf --- /dev/null +++ b/compiler/testData/ir/irText/regressions/newInferenceFixationOrder1.sig.kt.txt @@ -0,0 +1,39 @@ +// CHECK: +// Mangled name: Inv2 +// Public signature: /Inv2|null[0] +interface Inv2 { + +} + +// CHECK JVM_IR: +// Mangled name: #box(){}kotlin.String +// Public signature: /box|-9347091776561469[0] +// CHECK JS_IR NATIVE: +// Mangled name: #box(){} +// Public signature: /box|2173511048851971368[0] +fun box(): String + +// CHECK JVM_IR: +// Mangled name: #check(0:0;0:1;kotlin.Function1<0:0,0:1>){0§;1§}Inv2<0:0,0:1> +// Public signature: /check|5984400751488580697[0] +// CHECK JS_IR NATIVE: +// Mangled name: #check(0:0;0:1;kotlin.Function1<0:0,0:1>){0§;1§} +// Public signature: /check|-3580207389157345567[0] +fun check(x: T, y: R, f: Function1): Inv2 + +// CHECK JVM_IR: +// Mangled name: #foo(){0§;1§}kotlin.Function1<0:0,0:1> +// Public signature: /foo|-9122187844133412005[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo(){0§;1§} +// Public signature: /foo|5215108069702224664[0] +fun foo(): Function1 + +// CHECK JVM_IR: +// Mangled name: #test(){}Inv2 +// Public signature: /test|1156894151612153537[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Inv2 + diff --git a/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.kt b/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.kt index 75b3f283029..18a328aad4e 100644 --- a/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.kt +++ b/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.kt @@ -1,3 +1,6 @@ +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR +// ^ KT-57429 + class A(val q: Q) typealias B = A @@ -7,4 +10,4 @@ typealias B2 = A> fun bar() { val b = B(2) val b2 = B2(b) -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.sig.kt.txt b/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.sig.kt.txt new file mode 100644 index 00000000000..957aa67cac0 --- /dev/null +++ b/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.sig.kt.txt @@ -0,0 +1,36 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A { + // CHECK: + // Mangled name: A{}q + // Public signature: /A.q|3274930974999175741[0] + val q: Q + // CHECK JVM_IR: + // Mangled name: A#(){}1:0 + // Public signature: /A.q.|-447041854451904985[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.q.|-39243554116721919[0] + get + + // CHECK: + // Mangled name: A#(1:0){} + // Public signature: /A.|-8731461708390519279[0] + constructor(q: Q) /* primary */ + +} + +// CHECK: +// Mangled name: #bar(){} +// Public signature: /bar|496682602797471549[0] +fun bar(): Unit + +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +typealias B = A +// CHECK: +// Mangled name: B2 +// Public signature: /B2|null[0] +typealias B2 = A> diff --git a/compiler/testData/ir/irText/regressions/typeParametersInImplicitCast.sig.kt.txt b/compiler/testData/ir/irText/regressions/typeParametersInImplicitCast.sig.kt.txt new file mode 100644 index 00000000000..b574285d8f6 --- /dev/null +++ b/compiler/testData/ir/irText/regressions/typeParametersInImplicitCast.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK JVM_IR: +// Mangled name: #problematic(kotlin.collections.List>){0§}kotlin.collections.List<0:0> +// Public signature: /problematic|-8622452458410513914[0] +fun problematic(lss: List>): List + diff --git a/compiler/testData/ir/irText/singletons/companion.sig.kt.txt b/compiler/testData/ir/irText/singletons/companion.sig.kt.txt new file mode 100644 index 00000000000..7ad39b5f878 --- /dev/null +++ b/compiler/testData/ir/irText/singletons/companion.sig.kt.txt @@ -0,0 +1,32 @@ +// CHECK: +// Mangled name: Z +// Public signature: /Z|null[0] +class Z { + // CHECK: + // Mangled name: Z.Companion + // Public signature: /Z.Companion|null[0] + companion object Companion { + // CHECK: + // Mangled name: Z.Companion#(){} + // Public signature: /Z.Companion.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK: + // Mangled name: Z.Companion#test(){} + // Public signature: /Z.Companion.test|6620506149988718649[0] + fun test(): Unit + + } + + // CHECK: + // Mangled name: Z#(){} + // Public signature: /Z.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Z#test2(){} + // Public signature: /Z.test2|4279114864133353152[0] + fun test2(): Unit + +} + diff --git a/compiler/testData/ir/irText/singletons/enumEntry.kt b/compiler/testData/ir/irText/singletons/enumEntry.kt index 8fcd718cf9e..9fa949119b3 100644 --- a/compiler/testData/ir/irText/singletons/enumEntry.kt +++ b/compiler/testData/ir/irText/singletons/enumEntry.kt @@ -1,6 +1,9 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57775, KT-57430, KT-57777 + enum class Z { ENTRY { fun test() {} diff --git a/compiler/testData/ir/irText/singletons/enumEntry.sig.kt.txt b/compiler/testData/ir/irText/singletons/enumEntry.sig.kt.txt new file mode 100644 index 00000000000..0dab17137ec --- /dev/null +++ b/compiler/testData/ir/irText/singletons/enumEntry.sig.kt.txt @@ -0,0 +1,199 @@ +// CHECK: +// Mangled name: Z +// Public signature: /Z|null[0] +open enum class Z : Enum { + // CHECK: + // Mangled name: Z#(){} + // Public signature: /Z.|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK: + // Mangled name: Z.ENTRY + // Public signature: /Z.ENTRY|null[0] + + ENTRY + // CHECK: + // Mangled name: Z.ENTRY + // Public signature: /Z.ENTRY.|null[0] + private enum entry class ENTRY : Z { + // CHECK: + // Mangled name: Z.ENTRY.A + // Public signature: /Z.ENTRY..A|null[0] + local inner class A { + // CHECK: + // Mangled name: Z.ENTRY.A#(){} + // Public signature: /Z.ENTRY..A.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Z.ENTRY.A#test2(){} + // Public signature: /Z.ENTRY..A.test2|4279114864133353152[0] + fun test2(): Unit + + } + + // CHECK: + // Mangled name: Z.ENTRY#(){} + // Public signature: /Z.ENTRY..|-5645683436151566731[0] + private constructor() /* primary */ + // CHECK JVM_IR: + // Mangled name: Z.ENTRY#clone(){}kotlin.Any + // Public signature: /Z.ENTRY..clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: Z.ENTRY#compareTo(Z){} + // Public signature: /Z.ENTRY..compareTo|7572315864006954503[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: Z.ENTRY#compareTo(Z){}kotlin.Int + // Public signature: /Z.ENTRY..compareTo|-7935111597565816011[0] + // CHECK JS_IR NATIVE: + // Mangled name: Z.ENTRY#equals(kotlin.Any?){} + // Public signature: /Z.ENTRY..equals|4638265728071529943[0] + /* fake */ override operator fun compareTo(other: Z): Int + + // CHECK JVM_IR: + // Mangled name: Z.ENTRY#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Z.ENTRY..equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: Z.ENTRY#hashCode(){} + // Public signature: /Z.ENTRY..hashCode|3409210261493131192[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Z.ENTRY#hashCode(){}kotlin.Int + // Public signature: /Z.ENTRY..hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: Z.ENTRY#toString(){} + // Public signature: /Z.ENTRY..toString|-1522858123163872138[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Z.ENTRY#toString(){}kotlin.String + // Public signature: /Z.ENTRY..toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: Z.ENTRY#test(){} + // Public signature: /Z.ENTRY..test|6620506149988718649[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: Z.ENTRY#test(){} + // Public signature: /Z.ENTRY..test|6620506149988718649[0] + fun test(): Unit + + // CHECK: + // Mangled name: Z.ENTRY{}name + // Public signature: /Z.ENTRY..name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: Z.ENTRY#(){}kotlin.String + // Public signature: /Z.ENTRY..name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: Z.ENTRY{}ordinal + // Public signature: /Z.ENTRY..ordinal|1912745122988592376[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Z.ENTRY{}ordinal + // Public signature: /Z.ENTRY..ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: Z.ENTRY#(){}kotlin.Int + // Public signature: /Z.ENTRY..ordinal.|-6902664390061762634[0] + // CHECK JS_IR NATIVE: + // Mangled name: Z#valueOf#static(kotlin.String){} + // Public signature: /Z.valueOf|-4683474617854611729[0] + /* fake */ override get(): Int + + } + + // CHECK JVM_IR: + // Mangled name: Z#valueOf#static(kotlin.String){}Z + // Public signature: /Z.valueOf|6700955022581377295[0] + // CHECK JS_IR NATIVE: + // Mangled name: Z#values#static(){} + // Public signature: /Z.values|-8715569000920726747[0] + fun valueOf(value: String): Z + + // CHECK JVM_IR: + // Mangled name: Z#values#static(){}kotlin.Array + // Public signature: /Z.values|-4467060086112669746[0] + // CHECK JS_IR NATIVE: + // Mangled name: Z#compareTo(Z){} + // Public signature: /Z.compareTo|7572315864006954503[0] + fun values(): Array + + // CHECK JVM_IR: + // Mangled name: Z#clone(){}kotlin.Any + // Public signature: /Z.clone|-6903128697527593263[0] + // CHECK JS_IR NATIVE: + // Mangled name: Z#equals(kotlin.Any?){} + // Public signature: /Z.equals|4638265728071529943[0] + protected /* fake */ override fun clone(): Any + + // CHECK JVM_IR: + // Mangled name: Z#compareTo(Z){}kotlin.Int + // Public signature: /Z.compareTo|-7935111597565816011[0] + // CHECK JS_IR NATIVE: + // Mangled name: Z#hashCode(){} + // Public signature: /Z.hashCode|3409210261493131192[0] + /* fake */ override operator fun compareTo(other: Z): Int + + // CHECK JVM_IR: + // Mangled name: Z#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Z.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: Z#toString(){} + // Public signature: /Z.toString|-1522858123163872138[0] + /* fake */ override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Z#hashCode(){}kotlin.Int + // Public signature: /Z.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: Z#static{}entries + // Public signature: /Z.entries|-5134227801081826149[0] + /* fake */ override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Z#toString(){}kotlin.String + // Public signature: /Z.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: Z##static(){} + // Public signature: /Z.entries.|-6068527377476727729[0] + /* fake */ override fun toString(): String + + // CHECK: + // Mangled name: Z#static{}entries + // Public signature: /Z.entries|-5134227801081826149[0] + val entries: EnumEntries + // CHECK JVM_IR: + // Mangled name: Z##static(){}kotlin.enums.EnumEntries + // Public signature: /Z.entries.|3224480899107517660[0] + // CHECK JS_IR NATIVE: + // Mangled name: Z#(){} + // Public signature: /Z.name.|5879344792307730109[0] + get(): EnumEntries + + // CHECK: + // Mangled name: Z{}name + // Public signature: /Z.name|4231860309499509769[0] + /* fake */ override val name: String + // CHECK JVM_IR: + // Mangled name: Z#(){}kotlin.String + // Public signature: /Z.name.|-8006111524522882650[0] + // CHECK JS_IR NATIVE: + // Mangled name: Z#(){} + // Public signature: /Z.ordinal.|8409904226035914023[0] + /* fake */ override get(): String + + // CHECK: + // Mangled name: Z{}ordinal + // Public signature: /Z.ordinal|1912745122988592376[0] + /* fake */ override val ordinal: Int + // CHECK JVM_IR: + // Mangled name: Z#(){}kotlin.Int + // Public signature: /Z.ordinal.|-6902664390061762634[0] + /* fake */ override get(): Int + +} + diff --git a/compiler/testData/ir/irText/singletons/object.sig.kt.txt b/compiler/testData/ir/irText/singletons/object.sig.kt.txt new file mode 100644 index 00000000000..283a9bc0f78 --- /dev/null +++ b/compiler/testData/ir/irText/singletons/object.sig.kt.txt @@ -0,0 +1,32 @@ +// CHECK: +// Mangled name: Z +// Public signature: /Z|null[0] +object Z { + // CHECK: + // Mangled name: Z.A + // Public signature: /Z.A|null[0] + class A { + // CHECK: + // Mangled name: Z.A#(){} + // Public signature: /Z.A.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Z.A#test2(){} + // Public signature: /Z.A.test2|4279114864133353152[0] + fun test2(): Unit + + } + + // CHECK: + // Mangled name: Z#(){} + // Public signature: /Z.|-5645683436151566731[0] + private constructor() /* primary */ + + // CHECK: + // Mangled name: Z#test(){} + // Public signature: /Z.test|6620506149988718649[0] + fun test(): Unit + +} + diff --git a/compiler/testData/ir/irText/stubs/arraysFromBuiltins.sig.kt.txt b/compiler/testData/ir/irText/stubs/arraysFromBuiltins.sig.kt.txt new file mode 100644 index 00000000000..940596c626c --- /dev/null +++ b/compiler/testData/ir/irText/stubs/arraysFromBuiltins.sig.kt.txt @@ -0,0 +1,8 @@ +// CHECK: +// Mangled name: {}test +// Public signature: /test|-5712650070209114719[0] +val test: IntIterator + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.collections.IntIterator + // Public signature: /test.|5296058918654080755[0] + get diff --git a/compiler/testData/ir/irText/stubs/builtinMap.sig.kt.txt b/compiler/testData/ir/irText/stubs/builtinMap.sig.kt.txt new file mode 100644 index 00000000000..354cf882920 --- /dev/null +++ b/compiler/testData/ir/irText/stubs/builtinMap.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK JVM_IR: +// Mangled name: #plus@kotlin.collections.Map(kotlin.Pair<0:0,0:1>){0§;1§}kotlin.collections.Map<0:0,0:1> +// Public signature: /plus|-6703819129199897123[0] +fun Map.plus(pair: Pair): Map + diff --git a/compiler/testData/ir/irText/stubs/constFromBuiltins.sig.kt.txt b/compiler/testData/ir/irText/stubs/constFromBuiltins.sig.kt.txt new file mode 100644 index 00000000000..0ece01d813a --- /dev/null +++ b/compiler/testData/ir/irText/stubs/constFromBuiltins.sig.kt.txt @@ -0,0 +1,9 @@ +// CHECK: +// Mangled name: {}test +// Public signature: /test|-5712650070209114719[0] +val test: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test.|3701432460336260723[0] + get + diff --git a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.kt b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.kt index 5b6c5f344e6..506318a8d54 100644 --- a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.kt +++ b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.kt @@ -1,6 +1,9 @@ // IGNORE_BACKEND_K1: JS_IR // IGNORE_BACKEND_K1: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429 + // MODULE: m1 // FILE: genericClassInDifferentModule_m1.kt diff --git a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.sig.kt.txt b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.sig.kt.txt new file mode 100644 index 00000000000..4c8df6cfef0 --- /dev/null +++ b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.sig.kt.txt @@ -0,0 +1,120 @@ +// MODULE: m1 +// FILE: genericClassInDifferentModule_m1.kt + +// CHECK: +// Mangled name: Base +// Public signature: /Base|null[0] +abstract class Base { + // CHECK: + // Mangled name: Base{}x + // Public signature: /Base.x|-8060530855978347579[0] + val x: T + // CHECK JVM_IR: + // Mangled name: Base#(){}1:0 + // Public signature: /Base.x.|-8893883356128097563[0] + // CHECK JS_IR NATIVE: + // Mangled name: Base#(){} + // Public signature: /Base.x.|1482705010654679335[0] + get + + // CHECK: + // Mangled name: Base#(1:0){} + // Public signature: /Base.|-8731461708390519279[0] + constructor(x: T) /* primary */ + + // CHECK JVM_IR: + // Mangled name: Base#foo(0:0){0§}1:0 + // Public signature: /Base.foo|8673945311830780726[0] + // CHECK JS_IR NATIVE: + // Mangled name: Base#foo(0:0){0§} + // Public signature: /Base.foo|-6838606926256314363[0] + abstract fun foo(y: Y): T + + // CHECK: + // Mangled name: Base{}bar + // Public signature: /Base.bar|-7864284097863469857[0] + abstract var bar: T + // CHECK JVM_IR: + // Mangled name: Base#(){}1:0 + // Public signature: /Base.bar.|7899956589744407340[0] + // CHECK JS_IR NATIVE: + // Mangled name: Base#(){} + // Public signature: /Base.bar.|6880642144337645699[0] + abstract get + // CHECK: + // Mangled name: Base#(1:0){} + // Public signature: /Base.bar.|3083825024913650500[0] + abstract set + + // CHECK: + // Mangled name: Base@0:0{0§}exn + // Public signature: /Base.exn|2371047114698435273[0] + abstract var Z.exn: T + // CHECK JVM_IR: + // Mangled name: Base#@0:0(){0§}1:0 + // Public signature: /Base.exn.|6217753676739394662[0] + // CHECK JS_IR NATIVE: + // Mangled name: Base#@0:0(){0§} + // Public signature: /Base.exn.|-202876889853335253[0] + abstract get + // CHECK: + // Mangled name: Base#@0:0(1:0){0§} + // Public signature: /Base.exn.|5747714515092438414[0] + abstract set + +} + +// MODULE: m2 +// FILE: genericClassInDifferentModule_m2.kt + +// CHECK: +// Mangled name: Derived1 +// Public signature: /Derived1|null[0] +class Derived1 : Base { + // CHECK: + // Mangled name: Derived1{}bar + // Public signature: /Derived1.bar|-7864284097863469857[0] + override var bar: T + // CHECK JVM_IR: + // Mangled name: Derived1#(){}1:0 + // Public signature: /Derived1.bar.|7899956589744407340[0] + override get + // CHECK: + // Mangled name: Derived1#(1:0){} + // Public signature: /Derived1.bar.|3083825024913650500[0] + override set + + // CHECK: + // Mangled name: Derived1#(1:0){} + // Public signature: /Derived1.|-8731461708390519279[0] + constructor(x: T) /* primary */ + + // CHECK JVM_IR: + // Mangled name: Derived1#foo(0:0){0§}1:0 + // Public signature: /Derived1.foo|8673945311830780726[0] + override fun foo(y: Y): T + + // CHECK: + // Mangled name: Derived1{}x + // Public signature: /Derived1.x|-8060530855978347579[0] + /* fake */ override val x: T + // CHECK JVM_IR: + // Mangled name: Derived1#(){}1:0 + // Public signature: /Derived1.x.|-8893883356128097563[0] + /* fake */ override get(): T + + // CHECK: + // Mangled name: Derived1@0:0{0§}exn + // Public signature: /Derived1.exn|2371047114698435273[0] + override var Z.exn: T + // CHECK JVM_IR: + // Mangled name: Derived1#@0:0(){0§}1:0 + // Public signature: /Derived1.exn.|6217753676739394662[0] + override get(): T + // CHECK: + // Mangled name: Derived1#@0:0(1:0){0§} + // Public signature: /Derived1.exn.|5747714515092438414[0] + override set(value: T): Unit + +} + diff --git a/compiler/testData/ir/irText/stubs/javaConstructorWithTypeParameters.sig.kt.txt b/compiler/testData/ir/irText/stubs/javaConstructorWithTypeParameters.sig.kt.txt new file mode 100644 index 00000000000..85455f28992 --- /dev/null +++ b/compiler/testData/ir/irText/stubs/javaConstructorWithTypeParameters.sig.kt.txt @@ -0,0 +1,20 @@ +// CHECK JVM_IR: +// Mangled name: #test1(){}J1 +// Public signature: /test1|3199616915653410742[0] +fun test1(): J1 + +// CHECK JVM_IR: +// Mangled name: #test2(){}J1 +// Public signature: /test2|7911590194658936613[0] +fun test2(): J1 + +// CHECK JVM_IR: +// Mangled name: #test3(J1){}J1.J2 +// Public signature: /test3|-2201383984425029215[0] +fun test3(j1: J1): J2 + +// CHECK JVM_IR: +// Mangled name: #test4(J1){}J1.J2 +// Public signature: /test4|6994753301121646380[0] +fun test4(j1: J1): J2 + diff --git a/compiler/testData/ir/irText/stubs/javaEnum.sig.kt.txt b/compiler/testData/ir/irText/stubs/javaEnum.sig.kt.txt new file mode 100644 index 00000000000..0a456c3238d --- /dev/null +++ b/compiler/testData/ir/irText/stubs/javaEnum.sig.kt.txt @@ -0,0 +1,9 @@ +// CHECK: +// Mangled name: {}test +// Public signature: /test|-5712650070209114719[0] +val test: JEnum + // CHECK JVM_IR: + // Mangled name: #(){}JEnum + // Public signature: /test.|-6218625217141810690[0] + get + diff --git a/compiler/testData/ir/irText/stubs/javaInnerClass.sig.kt.txt b/compiler/testData/ir/irText/stubs/javaInnerClass.sig.kt.txt new file mode 100644 index 00000000000..7b644ba9d01 --- /dev/null +++ b/compiler/testData/ir/irText/stubs/javaInnerClass.sig.kt.txt @@ -0,0 +1,24 @@ +// CHECK: +// Mangled name: Test1 +// Public signature: /Test1|null[0] +class Test1 : J { + // CHECK: + // Mangled name: Test1{}test + // Public signature: /Test1.test|-5712650070209114719[0] + val test: JInner + // CHECK JVM_IR: + // Mangled name: Test1#(){}J.JInner + // Public signature: /Test1.test.|3142095303045720451[0] + get + + // CHECK: + // Mangled name: Test1#(){} + // Public signature: /Test1.|-5645683436151566731[0] + constructor() /* primary */ + // CHECK: + // Mangled name: Test1#bar(){} + // Public signature: /Test1.bar|496682602797471549[0] + /* fake */ override fun bar(): Unit + +} + diff --git a/compiler/testData/ir/irText/stubs/javaMethod.sig.kt.txt b/compiler/testData/ir/irText/stubs/javaMethod.sig.kt.txt new file mode 100644 index 00000000000..2497afee26a --- /dev/null +++ b/compiler/testData/ir/irText/stubs/javaMethod.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #test(J){} +// Public signature: /test|-8477572416399964095[0] +fun test(j: J): Unit + diff --git a/compiler/testData/ir/irText/stubs/javaNestedClass.sig.kt.txt b/compiler/testData/ir/irText/stubs/javaNestedClass.sig.kt.txt new file mode 100644 index 00000000000..8f399b4a90b --- /dev/null +++ b/compiler/testData/ir/irText/stubs/javaNestedClass.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #test(J.JJ){} +// Public signature: /test|-1956916194268064921[0] +fun test(jj: JJ): Unit + diff --git a/compiler/testData/ir/irText/stubs/javaNestedClassesInHierarchy.sig.kt.txt b/compiler/testData/ir/irText/stubs/javaNestedClassesInHierarchy.sig.kt.txt new file mode 100644 index 00000000000..9a448659e25 --- /dev/null +++ b/compiler/testData/ir/irText/stubs/javaNestedClassesInHierarchy.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + diff --git a/compiler/testData/ir/irText/stubs/javaStaticMethod.sig.kt.txt b/compiler/testData/ir/irText/stubs/javaStaticMethod.sig.kt.txt new file mode 100644 index 00000000000..9a448659e25 --- /dev/null +++ b/compiler/testData/ir/irText/stubs/javaStaticMethod.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + diff --git a/compiler/testData/ir/irText/stubs/javaSyntheticProperty.sig.kt.txt b/compiler/testData/ir/irText/stubs/javaSyntheticProperty.sig.kt.txt new file mode 100644 index 00000000000..04cd53a4eb9 --- /dev/null +++ b/compiler/testData/ir/irText/stubs/javaSyntheticProperty.sig.kt.txt @@ -0,0 +1,9 @@ +// CHECK: +// Mangled name: {}test +// Public signature: /test|-5712650070209114719[0] +val test: String? + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String? + // Public signature: /test.|4001706854451181956[0] + get + diff --git a/compiler/testData/ir/irText/stubs/jdkClassSyntheticProperty.sig.kt.txt b/compiler/testData/ir/irText/stubs/jdkClassSyntheticProperty.sig.kt.txt new file mode 100644 index 00000000000..223c23420c8 --- /dev/null +++ b/compiler/testData/ir/irText/stubs/jdkClassSyntheticProperty.sig.kt.txt @@ -0,0 +1,9 @@ +// CHECK: +// Mangled name: @java.lang.Class<*>{}test +// Public signature: /test|-5107008281653532078[0] +val Class<*>.test: Array? + // CHECK JVM_IR: + // Mangled name: #@java.lang.Class<*>(){}kotlin.Array? + // Public signature: /test.|5143661076951635746[0] + get(): Array? + diff --git a/compiler/testData/ir/irText/stubs/kotlinInnerClass.sig.kt.txt b/compiler/testData/ir/irText/stubs/kotlinInnerClass.sig.kt.txt new file mode 100644 index 00000000000..86b4dad997a --- /dev/null +++ b/compiler/testData/ir/irText/stubs/kotlinInnerClass.sig.kt.txt @@ -0,0 +1,5 @@ +// CHECK: +// Mangled name: #test(Outer.Inner){} +// Public signature: /test|-7065473236966425170[0] +fun test(inner: Inner): Unit + diff --git a/compiler/testData/ir/irText/stubs/simple.kt b/compiler/testData/ir/irText/stubs/simple.kt index a8b4361cc3b..579c95f4df9 100644 --- a/compiler/testData/ir/irText/stubs/simple.kt +++ b/compiler/testData/ir/irText/stubs/simple.kt @@ -1,3 +1,7 @@ // 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/stubs/simple.sig.kt.txt b/compiler/testData/ir/irText/stubs/simple.sig.kt.txt new file mode 100644 index 00000000000..565d03f8db4 --- /dev/null +++ b/compiler/testData/ir/irText/stubs/simple.sig.kt.txt @@ -0,0 +1,12 @@ +// CHECK: +// Mangled name: {}test +// Public signature: /test|-5712650070209114719[0] +val test: Int + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.Int + // Public signature: /test.|3701432460336260723[0] + // CHECK JS_IR NATIVE: + // Mangled name: #(){} + // Public signature: /test.|208282462577758837[0] + get + diff --git a/compiler/testData/ir/irText/types/abbreviatedTypes.sig.kt.txt b/compiler/testData/ir/irText/types/abbreviatedTypes.sig.kt.txt new file mode 100644 index 00000000000..5ae82a75cf7 --- /dev/null +++ b/compiler/testData/ir/irText/types/abbreviatedTypes.sig.kt.txt @@ -0,0 +1,40 @@ +// CHECK JVM_IR: +// Mangled name: #test1(kotlin.collections.List){}kotlin.collections.List +// Public signature: /test1|5510304245988545247[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test1(kotlin.collections.List){} +// Public signature: /test1|-6321727921997545888[0] +fun test1(x: List): List + +// CHECK JVM_IR: +// Mangled name: #test2(kotlin.collections.List>){}kotlin.collections.List> +// Public signature: /test2|-8198897601185053178[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test2(kotlin.collections.List>){} +// Public signature: /test2|-5740489603269288144[0] +fun test2(x: List>): List> + +// CHECK JVM_IR: +// Mangled name: #test3(kotlin.collections.List>){}kotlin.collections.List> +// Public signature: /test3|7316669450113571999[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test3(kotlin.collections.List>){} +// Public signature: /test3|-1654983922072882043[0] +fun test3(x: List>): List> + +// CHECK JVM_IR: +// Mangled name: #test4(kotlin.collections.List>){}kotlin.collections.List> +// Public signature: /test4|7378137562896561443[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test4(kotlin.collections.List>){} +// Public signature: /test4|-8069698833973176329[0] +fun test4(x: List>): List> + +// CHECK: +// Mangled name: I +// Public signature: /I|null[0] +typealias I = Int +// CHECK: +// Mangled name: L +// Public signature: /L|null[0] +typealias L = List diff --git a/compiler/testData/ir/irText/types/asOnPlatformType.sig.kt.txt b/compiler/testData/ir/irText/types/asOnPlatformType.sig.kt.txt new file mode 100644 index 00000000000..b2da4e86101 --- /dev/null +++ b/compiler/testData/ir/irText/types/asOnPlatformType.sig.kt.txt @@ -0,0 +1,15 @@ +// CHECK JVM_IR: +// Mangled name: #foo@0:0(){0§}0:0 +// Public signature: /foo|5130895959053851544[0] +inline fun T.foo(): T + +// CHECK JVM_IR: +// Mangled name: #fooN@0:0(){0§}0:0? +// Public signature: /fooN|-7256324909189827969[0] +inline fun T.fooN(): T? + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt index 2946d404981..efd812bda57 100644 --- a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt @@ -2,6 +2,9 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429, KT-57778 + import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.sig.kt.txt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.sig.kt.txt new file mode 100644 index 00000000000..351a8d7c36d --- /dev/null +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.sig.kt.txt @@ -0,0 +1,203 @@ +// CHECK: +// Mangled name: ChannelCoroutine +// Public signature: /ChannelCoroutine|null[0] +open class ChannelCoroutine { + // CHECK: + // Mangled name: ChannelCoroutine#(){} + // Public signature: /ChannelCoroutine.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: ChannelCoroutine#sendFair(1:0){} + // Public signature: /ChannelCoroutine.sendFair|9002973699384044266[0] + suspend fun sendFair(element: E): Unit + +} + +// CHECK: +// Mangled name: SafeCollector +// Public signature: /SafeCollector|null[0] +class SafeCollector : FlowCollector { + // CHECK: + // Mangled name: SafeCollector{}collector + // Public signature: /SafeCollector.collector|4340129746635199588[0] + internal val collector: FlowCollector + // CHECK JVM_IR: + // Mangled name: SafeCollector#(){}FlowCollector<1:0> + // Public signature: /SafeCollector.collector.|7868666490655551038[0] + // CHECK JS_IR NATIVE: + // Mangled name: SafeCollector#(){} + // Public signature: /SafeCollector.collector.|2795575727343345994[0] + internal get + + // CHECK: + // Mangled name: SafeCollector#(FlowCollector<1:0>){} + // Public signature: /SafeCollector.|-8536486589002361817[0] + constructor(collector: FlowCollector) /* primary */ + + // CHECK: + // Mangled name: SafeCollector#emit(1:0){} + // Public signature: /SafeCollector.emit|-8401228374452471444[0] + override suspend fun emit(value: T): Unit + +} + +// CHECK: +// Mangled name: CoroutineScope +// Public signature: /CoroutineScope|null[0] +interface CoroutineScope { + +} + +// CHECK: +// Mangled name: Flow +// Public signature: /Flow|null[0] +interface Flow { + + // CHECK: + // Mangled name: Flow#collect(FlowCollector<1:0>){} + // Public signature: /Flow.collect|5114876798301803727[0] + abstract suspend fun collect(collector: FlowCollector): Unit + +} + +// CHECK: +// Mangled name: FlowCollector +// Public signature: /FlowCollector|null[0] +interface FlowCollector { + + // CHECK: + // Mangled name: FlowCollector#emit(1:0){} + // Public signature: /FlowCollector.emit|-8401228374452471444[0] + abstract suspend fun emit(value: T): Unit + +} + +// CHECK: +// Mangled name: ProducerScope +// Public signature: /ProducerScope|null[0] +interface ProducerScope : CoroutineScope, SendChannel { + + // CHECK: + // Mangled name: ProducerScope#send(1:0){} + // Public signature: /ProducerScope.send|-5896904506239336668[0] + abstract /* fake */ override suspend fun send(e: E): Unit + + // CHECK: + // Mangled name: ProducerScope{}channel + // Public signature: /ProducerScope.channel|1234507572828696339[0] + abstract val channel: SendChannel + // CHECK JVM_IR: + // Mangled name: ProducerScope#(){}SendChannel<1:0> + // Public signature: /ProducerScope.channel.|6405133005890607699[0] + // CHECK JS_IR NATIVE: + // Mangled name: ProducerScope#(){} + // Public signature: /ProducerScope.channel.|-6008301720542490954[0] + abstract get + +} + +// CHECK: +// Mangled name: ReceiveChannel +// Public signature: /ReceiveChannel|null[0] +interface ReceiveChannel { + +} + +// CHECK: +// Mangled name: SendChannel +// Public signature: /SendChannel|null[0] +interface SendChannel { + + // CHECK: + // Mangled name: SendChannel#send(1:0){} + // Public signature: /SendChannel.send|-5896904506239336668[0] + abstract suspend fun send(e: E): Unit + +} + +// CHECK JVM_IR: +// Mangled name: #asChannel@CoroutineScope(Flow<*>){}ReceiveChannel +// Public signature: [ File 'castsInsideCoroutineInference.kt' <- /asChannel|-3549601571428075944[0] ] +// CHECK JS_IR NATIVE: +// Mangled name: #asChannel@CoroutineScope(Flow<*>){} +private fun CoroutineScope.asChannel(flow: Flow<*>): ReceiveChannel + +// CHECK JVM_IR: +// Mangled name: #asFairChannel@CoroutineScope(Flow<*>){}ReceiveChannel +// Public signature: [ File 'castsInsideCoroutineInference.kt' <- /asFairChannel|-8739457176543595950[0] ] +// CHECK JS_IR NATIVE: +// Mangled name: #asFairChannel@CoroutineScope(Flow<*>){} +private fun CoroutineScope.asFairChannel(flow: Flow<*>): ReceiveChannel + +// CHECK: +// Mangled name: #collect@Flow<0:0>(kotlin.coroutines.SuspendFunction1<0:0,kotlin.Unit>){0§} +// Public signature: /collect|-7963666311311772650[0] +suspend inline fun Flow.collect(crossinline action: SuspendFunction1): Unit + +// CHECK JVM_IR: +// Mangled name: #flow(kotlin.coroutines.SuspendFunction1,kotlin.Unit>){0§}Flow<0:0> +// Public signature: /flow|-8236097055230938451[0] +// CHECK JS_IR NATIVE: +// Mangled name: #flow(kotlin.coroutines.SuspendFunction1,kotlin.Unit>){0§} +// Public signature: /flow|-783786779684717779[0] +@OptIn(markerClass = [ExperimentalTypeInference::class]) +fun flow(block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow + +// CHECK JVM_IR: +// Mangled name: #flowScope(kotlin.coroutines.SuspendFunction1){0§}0:0 +// Public signature: /flowScope|-4863413966525211507[0] +// CHECK JS_IR NATIVE: +// Mangled name: #flowScope(kotlin.coroutines.SuspendFunction1){0§} +// Public signature: /flowScope|-6102709541537901279[0] +@OptIn(markerClass = [ExperimentalTypeInference::class]) +suspend fun flowScope(block: @ExtensionFunctionType SuspendFunction1): R + +// CHECK: +// Mangled name: #invokeSafely@FlowCollector<0:0>(kotlin.coroutines.SuspendFunction2,kotlin.Throwable?,kotlin.Unit>){0§} +// Public signature: /invokeSafely|-132311587249073600[0] +suspend fun FlowCollector.invokeSafely(action: @ExtensionFunctionType SuspendFunction2, Throwable?, Unit>): Unit + +// CHECK JVM_IR: +// Mangled name: #onCompletion@Flow<0:0>(kotlin.coroutines.SuspendFunction2,kotlin.Throwable?,kotlin.Unit>){0§}Flow<0:0> +// Public signature: /onCompletion|-3071899649967554187[0] +// CHECK JS_IR NATIVE: +// Mangled name: #onCompletion@Flow<0:0>(kotlin.coroutines.SuspendFunction2,kotlin.Throwable?,kotlin.Unit>){0§} +// Public signature: /onCompletion|7285895848812186696[0] +fun Flow.onCompletion(action: @ExtensionFunctionType SuspendFunction2, Throwable?, Unit>): Flow + +// CHECK JVM_IR: +// Mangled name: #onCompletion@Flow<0:0>(kotlin.coroutines.SuspendFunction1){0§}Flow<0:0> +// Public signature: /onCompletion|647694112352607196[0] +// CHECK JS_IR NATIVE: +// Mangled name: #onCompletion@Flow<0:0>(kotlin.coroutines.SuspendFunction1){0§} +// Public signature: /onCompletion|8392097553242172135[0] +fun Flow.onCompletion(action: SuspendFunction1): Flow + +// CHECK JVM_IR: +// Mangled name: #produce@CoroutineScope(kotlin.coroutines.SuspendFunction1,kotlin.Unit>){0§}ReceiveChannel<0:0> +// Public signature: /produce|5215241159089619820[0] +// CHECK JS_IR NATIVE: +// Mangled name: #produce@CoroutineScope(kotlin.coroutines.SuspendFunction1,kotlin.Unit>){0§} +// Public signature: /produce|3284755252337258516[0] +@OptIn(markerClass = [ExperimentalTypeInference::class]) +fun CoroutineScope.produce(block: @ExtensionFunctionType SuspendFunction1, Unit>): ReceiveChannel + +// CHECK JVM_IR: +// Mangled name: #scopedFlow(kotlin.coroutines.SuspendFunction2,kotlin.Unit>){0§}Flow<0:0> +// Public signature: /scopedFlow|2249590853579674662[0] +// CHECK JS_IR NATIVE: +// Mangled name: #scopedFlow(kotlin.coroutines.SuspendFunction2,kotlin.Unit>){0§} +// Public signature: /scopedFlow|2704701452611653533[0] +@OptIn(markerClass = [ExperimentalTypeInference::class]) +fun scopedFlow(block: @ExtensionFunctionType SuspendFunction2, Unit>): Flow + +// CHECK JVM_IR: +// Mangled name: #unsafeFlow(kotlin.coroutines.SuspendFunction1,kotlin.Unit>){0§}Flow<0:0> +// Public signature: /unsafeFlow|-135607760831793589[0] +// CHECK JS_IR NATIVE: +// Mangled name: #unsafeFlow(kotlin.coroutines.SuspendFunction1,kotlin.Unit>){0§} +// Public signature: /unsafeFlow|3400544419813792330[0] +@OptIn(markerClass = [ExperimentalTypeInference::class]) +inline fun unsafeFlow(crossinline block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow + diff --git a/compiler/testData/ir/irText/types/coercionToUnitInLambdaReturnValue.sig.kt.txt b/compiler/testData/ir/irText/types/coercionToUnitInLambdaReturnValue.sig.kt.txt new file mode 100644 index 00000000000..36bfe8de6b6 --- /dev/null +++ b/compiler/testData/ir/irText/types/coercionToUnitInLambdaReturnValue.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + +// CHECK: +// Mangled name: #use(kotlin.Function0){} +// Public signature: /use|1701817712136207647[0] +fun use(fn: Function0): Unit + diff --git a/compiler/testData/ir/irText/types/definitelyNonNull.kt b/compiler/testData/ir/irText/types/definitelyNonNull.kt index 32abde4820c..4d4dda2412a 100644 --- a/compiler/testData/ir/irText/types/definitelyNonNull.kt +++ b/compiler/testData/ir/irText/types/definitelyNonNull.kt @@ -1,5 +1,8 @@ //!LANGUAGE: +DefinitelyNonNullableTypes +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR +// ^ KT-57755 + fun elvisLike(x: T, y: T & Any): T & Any = x ?: y fun main() { @@ -8,4 +11,4 @@ fun main() { elvisLike("", "").length // OK elvisLike(null, "").length // OK -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/types/definitelyNonNull.sig.kt.txt b/compiler/testData/ir/irText/types/definitelyNonNull.sig.kt.txt new file mode 100644 index 00000000000..f435466559b --- /dev/null +++ b/compiler/testData/ir/irText/types/definitelyNonNull.sig.kt.txt @@ -0,0 +1,17 @@ +// CHECK JVM_IR: +// Mangled name: #elvisLike(0:0;0:0){0§}0:0 +// Public signature: /elvisLike|7044130161831229286[0] +// CHECK JS_IR NATIVE: +// Mangled name: #elvisLike(0:0;0:0){0§} +// Public signature: /elvisLike|-2891753181650577145[0] +fun elvisLike(x: T, y: (T & Any)): (T & Any) + +// CHECK JVM_IR: +// Mangled name computed from Ir: #main(){} +// Mangled name computed from Descriptor: #main(){}%definitelyNonNull.kt +// Public signature: /main|536315142565162436[0] +// CHECK JS_IR NATIVE: +// Mangled name: #main(){} +// Public signature: /main|-4284757841571462650[0] +fun main(): Unit + diff --git a/compiler/testData/ir/irText/types/definitelyNonNullOverride.sig.kt.txt b/compiler/testData/ir/irText/types/definitelyNonNullOverride.sig.kt.txt new file mode 100644 index 00000000000..a26a095e9f7 --- /dev/null +++ b/compiler/testData/ir/irText/types/definitelyNonNullOverride.sig.kt.txt @@ -0,0 +1,61 @@ +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +open class B { + // CHECK: + // Mangled name: B#(){} + // Public signature: /B.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: B#bar(1:0){} + // Public signature: /B.bar|-7393952686038474037[0] + open fun bar(t: T): Unit + + // CHECK: + // Mangled name: B#foo(1:0){} + // Public signature: /B.foo|-701456291278879981[0] + open fun foo(t: T): Unit + + // CHECK: + // Mangled name: B#qux(B<1:0>){} + // Public signature: /B.qux|511223586194505643[0] + open fun qux(b: B): Unit + + // CHECK: + // Mangled name: B#six(1:0;0:0){0§} + // Public signature: /B.six|-243783432810149721[0] + open fun six(t: T, q: F): Unit + +} + +// CHECK: +// Mangled name: D +// Public signature: /D|null[0] +class D : B<(T & Any)> { + // CHECK: + // Mangled name: D#(){} + // Public signature: /D.|-5645683436151566731[0] + constructor() /* primary */ + // CHECK: + // Mangled name: D#bar(1:0){} + // Public signature: /D.bar|-7393952686038474037[0] + /* fake */ override fun bar(t: (T & Any)): Unit + + // CHECK: + // Mangled name: D#qux(B<1:0>){} + // Public signature: /D.qux|511223586194505643[0] + /* fake */ override fun qux(b: B<(T & Any)>): Unit + + // CHECK: + // Mangled name: D#six(1:0;0:0){0§} + // Public signature: /D.six|-243783432810149721[0] + /* fake */ override fun six(t: (T & Any), q: F): Unit + + // CHECK: + // Mangled name: D#foo(1:0){} + // Public signature: /D.foo|-701456291278879981[0] + override fun foo(t: (T & Any)): Unit + +} + diff --git a/compiler/testData/ir/irText/types/definitelyNonNullSAM.sig.kt.txt b/compiler/testData/ir/irText/types/definitelyNonNullSAM.sig.kt.txt new file mode 100644 index 00000000000..42c47c381a5 --- /dev/null +++ b/compiler/testData/ir/irText/types/definitelyNonNullSAM.sig.kt.txt @@ -0,0 +1,144 @@ +// CHECK: +// Mangled name: AC +// Public signature: /AC|null[0] +abstract class AC : I1, I2 { + // CHECK: + // Mangled name: AC{}sam + // Public signature: /AC.sam|8824598858531533052[0] + override val sam: FIn + // CHECK JVM_IR: + // Mangled name: AC#(){}FIn<1:0> + // Public signature: /AC.sam.|7063493038287370262[0] + // CHECK JS_IR NATIVE: + // Mangled name: AC#(){} + // Public signature: /AC.sam.|6359168897517051114[0] + override get + + // CHECK: + // Mangled name: AC#(){} + // Public signature: /AC.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: AC{}l + // Public signature: /AC.l|3307215303229595169[0] + abstract /* fake */ override val l: @ExtensionFunctionType Function1 + // CHECK JVM_IR: + // Mangled name: AC#(){}kotlin.Function1<1:0,kotlin.Unit> + // Public signature: /AC.l.|-5292723073790207311[0] + // CHECK JS_IR NATIVE: + // Mangled name: AC#(){} + // Public signature: /AC.l.|3795442967620585[0] + abstract /* fake */ override get(): @ExtensionFunctionType Function1 + +} + +// CHECK: +// Mangled name: AD +// Public signature: /AD|null[0] +abstract class AD : AC<(T & Any)> { + // CHECK: + // Mangled name: AD{}l + // Public signature: /AD.l|3307215303229595169[0] + override val l: @ExtensionFunctionType Function1<(T & Any), Unit> + // CHECK JVM_IR: + // Mangled name: AD#(){}kotlin.Function1<1:0,kotlin.Unit> + // Public signature: /AD.l.|-5292723073790207311[0] + // CHECK JS_IR NATIVE: + // Mangled name: AD#(){} + // Public signature: /AD.l.|3795442967620585[0] + override get + + // CHECK: + // Mangled name: AD#(){} + // Public signature: /AD.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: AD{}sam + // Public signature: /AD.sam|8824598858531533052[0] + /* fake */ override val sam: FIn<(T & Any)> + // CHECK JVM_IR: + // Mangled name: AD#(){}FIn<1:0> + // Public signature: /AD.sam.|7063493038287370262[0] + // CHECK JS_IR NATIVE: + // Mangled name: AD#(){} + // Public signature: /AD.sam.|6359168897517051114[0] + /* fake */ override get(): FIn<(T & Any)> + +} + +// CHECK: +// Mangled name: Test +// Public signature: /Test|null[0] +class Test { + // CHECK: + // Mangled name: Test#(){} + // Public signature: /Test.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Test#foo(){}FIn<1:0> + // Public signature: /Test.foo|8840966648510275976[0] + // CHECK JS_IR NATIVE: + // Mangled name: Test#foo(){} + // Public signature: /Test.foo|-1041209573719867811[0] + fun foo(): FIn<(S & Any)> + +} + +// CHECK: +// Mangled name: FIn +// Public signature: /FIn|null[0] +fun interface FIn { + + // CHECK: + // Mangled name: FIn#f(1:0){} + // Public signature: /FIn.f|5824974961856025845[0] + abstract fun f(x: T): Unit + +} + +// CHECK: +// Mangled name: I1 +// Public signature: /I1|null[0] +interface I1 { + + // CHECK: + // Mangled name: I1{}l + // Public signature: /I1.l|3307215303229595169[0] + abstract val l: @ExtensionFunctionType Function1 + // CHECK JVM_IR: + // Mangled name: I1#(){}kotlin.Function1<1:0,kotlin.Unit> + // Public signature: /I1.l.|-5292723073790207311[0] + // CHECK JS_IR NATIVE: + // Mangled name: I1#(){} + // Public signature: /I1.l.|3795442967620585[0] + abstract get + +} + +// CHECK: +// Mangled name: I2 +// Public signature: /I2|null[0] +interface I2 { + + // CHECK: + // Mangled name: I2{}sam + // Public signature: /I2.sam|8824598858531533052[0] + abstract val sam: FIn + // CHECK JVM_IR: + // Mangled name: I2#(){}FIn<1:0> + // Public signature: /I2.sam.|7063493038287370262[0] + // CHECK JS_IR NATIVE: + // Mangled name: I2#(){} + // Public signature: /I2.sam.|6359168897517051114[0] + abstract get + +} + +// CHECK: +// Mangled name: #bar(){0§} +// Public signature: /bar|5907622255144383210[0] +fun bar(): Unit + diff --git a/compiler/testData/ir/irText/types/definitelyNonNullWithJava.sig.kt.txt b/compiler/testData/ir/irText/types/definitelyNonNullWithJava.sig.kt.txt new file mode 100644 index 00000000000..30616710f0f --- /dev/null +++ b/compiler/testData/ir/irText/types/definitelyNonNullWithJava.sig.kt.txt @@ -0,0 +1,17 @@ +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +interface B : A { + + // CHECK JVM_IR: + // Mangled name: B#bar(1:0){}1:0 + // Public signature: /B.bar|-3264834230504995152[0] + abstract override fun bar(x: (T1 & Any)): (T1 & Any) + + // CHECK JVM_IR: + // Mangled name: B#foo(1:0){}1:0 + // Public signature: /B.foo|2191932182509326162[0] + abstract override fun foo(x: T1): T1 + +} + diff --git a/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.kt b/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.kt index 7af84afc511..a43110661d4 100644 --- a/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.kt +++ b/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.kt @@ -1,5 +1,8 @@ //!LANGUAGE: +DefinitelyNonNullableTypes +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR +// ^ KT-57429 + interface I { fun input(t: T) fun output(): T diff --git a/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.sig.kt.txt b/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.sig.kt.txt new file mode 100644 index 00000000000..2a17984c378 --- /dev/null +++ b/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.sig.kt.txt @@ -0,0 +1,79 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C : I<(TT & Any)> { + // CHECK: + // Mangled name: C{}t + // Public signature: /C.t|-8767999791664836944[0] + val t: TT + // CHECK JVM_IR: + // Mangled name: C#(){}1:0 + // Public signature: /C.t.|5296523675281381766[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.t.|7061140872129253552[0] + get + + // CHECK: + // Mangled name: C#(1:0){} + // Public signature: /C.|-8731461708390519279[0] + constructor(t: TT) /* primary */ + + // CHECK: + // Mangled name: C#input(1:0){} + // Public signature: /C.input|-6221011490461630624[0] + override fun input(t: (TT & Any)): Unit + + // CHECK JVM_IR: + // Mangled name: C#output(){}1:0 + // Public signature: /C.output|2948120958996440939[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#output(){} + // Public signature: /C.output|-7727065428490554292[0] + override fun output(): (TT & Any) + +} + +// CHECK: +// Mangled name: I +// Public signature: /I|null[0] +interface I { + + // CHECK: + // Mangled name: I#input(1:0){} + // Public signature: /I.input|-6221011490461630624[0] + abstract fun input(t: T): Unit + + // CHECK JVM_IR: + // Mangled name: I#output(){}1:0 + // Public signature: /I.output|2948120958996440939[0] + // CHECK JS_IR NATIVE: + // Mangled name: I#output(){} + // Public signature: /I.output|-7727065428490554292[0] + abstract fun output(): T + +} + +// CHECK JVM_IR: +// Mangled name: #bar(I){0§}0:0 +// Public signature: /bar|-698012471907349043[0] +// CHECK JS_IR NATIVE: +// Mangled name: #bar(I){0§} +// Public signature: /bar|8057913304781866209[0] +fun bar(i: I): (T & Any) + +// CHECK: +// Mangled name: #foo(I<0:0>){0§} +// Public signature: /foo|-4379732489572208906[0] +fun foo(i: I<(T & Any)>): Unit + +// CHECK: +// Mangled name: #foo2(0:0;0:1){0§;1§>} +// Public signature: /foo2|-3942115984547416735[0] +fun > foo2(p1: T1, p2: T2): Unit + +// CHECK: +// Mangled name: #qux(0:0;I){0§} +// Public signature: /qux|-1677664792094905915[0] +fun qux(t: T, i: I): Unit + diff --git a/compiler/testData/ir/irText/types/definitelyNotNullAsReceiver.kt b/compiler/testData/ir/irText/types/definitelyNotNullAsReceiver.kt index 50020b8ad47..e363fd86295 100644 --- a/compiler/testData/ir/irText/types/definitelyNotNullAsReceiver.kt +++ b/compiler/testData/ir/irText/types/definitelyNotNullAsReceiver.kt @@ -1,5 +1,9 @@ // FIR_IDENTICAL //!LANGUAGE: +DefinitelyNonNullableTypes +// DUMP_LOCAL_DECLARATION_SIGNATURES + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57428 fun (T & Any).foo() {} fun foo(l: (T & Any) -> Unit) {} @@ -7,4 +11,4 @@ fun foo(l: (T & Any) -> Unit) {} fun box() { "".foo() foo { "$it" } -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/types/definitelyNotNullAsReceiver.sig.kt.txt b/compiler/testData/ir/irText/types/definitelyNotNullAsReceiver.sig.kt.txt new file mode 100644 index 00000000000..86771b45d38 --- /dev/null +++ b/compiler/testData/ir/irText/types/definitelyNotNullAsReceiver.sig.kt.txt @@ -0,0 +1,18 @@ +// CHECK: +// Mangled name: #box(){} +// Public signature: /box|2173511048851971368[0] +fun box(): Unit + // CHECK: + // Mangled name: #box(){}##static(kotlin.String){} + local fun (it: String): Unit + +// CHECK: +// Mangled name: #foo@0:0(){0§} +// Public signature: /foo|2893921150824224093[0] +fun (T & Any).foo(): Unit + +// CHECK: +// Mangled name: #foo(kotlin.Function1<0:0,kotlin.Unit>){0§} +// Public signature: /foo|-1916457112981119359[0] +fun foo(l: Function1<(T & Any), Unit>): Unit + diff --git a/compiler/testData/ir/irText/types/definitelyNotNullWithIntersection1.sig.kt.txt b/compiler/testData/ir/irText/types/definitelyNotNullWithIntersection1.sig.kt.txt new file mode 100644 index 00000000000..022732c951f --- /dev/null +++ b/compiler/testData/ir/irText/types/definitelyNotNullWithIntersection1.sig.kt.txt @@ -0,0 +1,40 @@ +// CHECK: +// Mangled name: In +// Public signature: /In|null[0] +class In { + // CHECK: + // Mangled name: In#(){} + // Public signature: /In.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #foo(kotlin.Array>;kotlin.Array>;kotlin.Array>){0§}kotlin.Boolean +// Public signature: /foo|-198761928253014648[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo(kotlin.Array>;kotlin.Array>;kotlin.Array>){0§} +// Public signature: /foo|-2320221976933961665[0] +fun foo(a: Array>, b: Array>, c: Array>): Boolean + +// CHECK JVM_IR: +// Mangled name: #ofType@In<0:0>(kotlin.Any?){0§}kotlin.Boolean +// Public signature: /ofType|2383203766625380016[0] +// CHECK JS_IR NATIVE: +// Mangled name: #ofType@In<0:0>(kotlin.Any?){0§} +// Public signature: /ofType|-4707862451809276934[0] +inline fun In.ofType(y: Any?): Boolean + +// CHECK JVM_IR: +// Mangled name: #select(0:0;0:0;0:0){0§}0:0 +// Public signature: /select|-2119556969989927038[0] +// CHECK JS_IR NATIVE: +// Mangled name: #select(0:0;0:0;0:0){0§} +// Public signature: /select|-3805572863006559463[0] +fun select(x: S, y: S, z: S): S + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + diff --git a/compiler/testData/ir/irText/types/dontLeaveStubTypesInSetter.kt b/compiler/testData/ir/irText/types/dontLeaveStubTypesInSetter.kt index 90c41f97be7..7543e74f341 100644 --- a/compiler/testData/ir/irText/types/dontLeaveStubTypesInSetter.kt +++ b/compiler/testData/ir/irText/types/dontLeaveStubTypesInSetter.kt @@ -3,6 +3,9 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429, KT-57755 + class Foo(var x: T) fun foo(x: MutableList): Foo = TODO() diff --git a/compiler/testData/ir/irText/types/dontLeaveStubTypesInSetter.sig.kt.txt b/compiler/testData/ir/irText/types/dontLeaveStubTypesInSetter.sig.kt.txt new file mode 100644 index 00000000000..ddac22893a0 --- /dev/null +++ b/compiler/testData/ir/irText/types/dontLeaveStubTypesInSetter.sig.kt.txt @@ -0,0 +1,44 @@ +// CHECK: +// Mangled name: Foo +// Public signature: /Foo|null[0] +class Foo { + // CHECK: + // Mangled name: Foo{}x + // Public signature: /Foo.x|-8060530855978347579[0] + var x: T + // CHECK JVM_IR: + // Mangled name: Foo#(){}1:0 + // Public signature: /Foo.x.|-8893883356128097563[0] + // CHECK JS_IR NATIVE: + // Mangled name: Foo#(){} + // Public signature: /Foo.x.|1482705010654679335[0] + get + // CHECK: + // Mangled name: Foo#(1:0){} + // Public signature: /Foo.x.|-9166455774953348944[0] + set + + // CHECK: + // Mangled name: Foo#(1:0){} + // Public signature: /Foo.|-8731461708390519279[0] + constructor(x: T) /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #foo(kotlin.collections.MutableList<0:0>){0§}Foo<0:0> +// Public signature: /foo|1536530770177772929[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo(kotlin.collections.MutableList<0:0>){0§} +// Public signature: /foo|5998809843393521079[0] +fun foo(x: MutableList): Foo + +// CHECK JVM_IR: +// Mangled name computed from Ir: #main(){} +// Mangled name computed from Descriptor: #main(){}%dontLeaveStubTypesInSetter.kt +// Public signature: /main|-2535684763027974809[0] +// CHECK JS_IR NATIVE: +// Mangled name: #main(){} +// Public signature: /main|-4284757841571462650[0] +fun main(): Unit + diff --git a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.kt b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.kt index 00f38e26f12..c747408402c 100644 --- a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.kt +++ b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.kt @@ -1,4 +1,8 @@ // !LANGUAGE: -ForbidUsingExtensionPropertyTypeParameterInDelegate + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429, KT-57436 + import kotlin.reflect.KProperty1 import kotlin.reflect.KMutableProperty1 import kotlin.reflect.KProperty diff --git a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.sig.kt.txt b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.sig.kt.txt new file mode 100644 index 00000000000..ee97ff3235c --- /dev/null +++ b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.sig.kt.txt @@ -0,0 +1,162 @@ +// CHECK: +// Mangled name: @Value<0:0,CR<0:0>>{0§}additionalText +// Public signature: /additionalText|-3624592186686248643[0] +val Value>.additionalText: P /* by */ + // CHECK JVM_IR: + // Mangled name: #@Value<0:0,CR<0:0>>(){0§}P<0:0,0:0> + // Public signature: /additionalText.|-2964788147301147474[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@Value<0:0,CR<0:0>>(){0§} + // Public signature: /additionalText.|7110754747328025719[0] + get(): P + +// CHECK: +// Mangled name: CR +// Public signature: /CR|null[0] +class CR : IR { + // CHECK: + // Mangled name: CR{}r + // Public signature: /CR.r|-8117627916896159533[0] + val r: R + // CHECK JVM_IR: + // Mangled name: CR#(){}1:0 + // Public signature: /CR.r.|8828977917809363505[0] + // CHECK JS_IR NATIVE: + // Mangled name: CR#(){} + // Public signature: /CR.r.|-7424184448774736572[0] + get + + // CHECK: + // Mangled name: CR#(1:0){} + // Public signature: /CR.|-8731461708390519279[0] + constructor(r: R) /* primary */ + + // CHECK JVM_IR: + // Mangled name: CR#foo(){}1:0 + // Public signature: /CR.foo|-5478580208809996038[0] + // CHECK JS_IR NATIVE: + // Mangled name: CR#foo(){} + // Public signature: /CR.foo|-1041209573719867811[0] + override fun foo(): R + +} + +// CHECK: +// Mangled name: P +// Public signature: /P|null[0] +class P { + // CHECK: + // Mangled name: P{}p1 + // Public signature: /P.p1|7711764890799440087[0] + val p1: P1 + // CHECK JVM_IR: + // Mangled name: P#(){}1:0 + // Public signature: /P.p1.|-4219781876451304030[0] + // CHECK JS_IR NATIVE: + // Mangled name: P#(){} + // Public signature: /P.p1.|419663188770843259[0] + get + + // CHECK: + // Mangled name: P{}p2 + // Public signature: /P.p2|1837305664617486052[0] + val p2: P2 + // CHECK JVM_IR: + // Mangled name: P#(){}1:1 + // Public signature: /P.p2.|6195993200459932152[0] + // CHECK JS_IR NATIVE: + // Mangled name: P#(){} + // Public signature: /P.p2.|3135798795606784082[0] + get + + // CHECK: + // Mangled name: P#(1:0;1:1){} + // Public signature: /P.|3086114026882374588[0] + constructor(p1: P1, p2: P2) /* primary */ + +} + +// CHECK: +// Mangled name: Value +// Public signature: /Value|null[0] +class Value> { + // CHECK: + // Mangled name: Value{}value1 + // Public signature: /Value.value1|-1609410989855067486[0] + var value1: T + // CHECK JVM_IR: + // Mangled name: Value#(){}1:0 + // Public signature: /Value.value1.|6019421524321236052[0] + // CHECK JS_IR NATIVE: + // Mangled name: Value#(){} + // Public signature: /Value.value1.|6997002919469559625[0] + get + // CHECK: + // Mangled name: Value#(1:0){} + // Public signature: /Value.value1.|6839885877777773163[0] + set + + // CHECK: + // Mangled name: Value{}value2 + // Public signature: /Value.value2|-1664181645671419060[0] + val value2: IT + // CHECK JVM_IR: + // Mangled name: Value#(){}1:1 + // Public signature: /Value.value2.|3746012481463661565[0] + // CHECK JS_IR NATIVE: + // Mangled name: Value#(){} + // Public signature: /Value.value2.|1776957621204807843[0] + get + + // CHECK: + // Mangled name: Value#(1:0;1:1){} + // Public signature: /Value.|3086114026882374588[0] + constructor(value1: T, value2: IT) /* primary */ + +} + +// CHECK: +// Mangled name: IDelegate1 +// Public signature: /IDelegate1|null[0] +interface IDelegate1 { + + // CHECK JVM_IR: + // Mangled name: IDelegate1#getValue(1:0;kotlin.reflect.KProperty<*>){}1:1 + // Public signature: /IDelegate1.getValue|-902248562118213940[0] + // CHECK JS_IR NATIVE: + // Mangled name: IDelegate1#getValue(1:0;kotlin.reflect.KProperty<*>){} + // Public signature: /IDelegate1.getValue|-5099931934018608327[0] + abstract operator fun getValue(t: T1, p: KProperty<*>): R1 + +} + +// CHECK: +// Mangled name: IDelegate2 +// Public signature: /IDelegate2|null[0] +interface IDelegate2 { + + // CHECK JVM_IR: + // Mangled name: IDelegate2#getValue(1:0;kotlin.reflect.KProperty<*>){}1:1 + // Public signature: /IDelegate2.getValue|-902248562118213940[0] + // CHECK JS_IR NATIVE: + // Mangled name: IDelegate2#getValue(1:0;kotlin.reflect.KProperty<*>){} + // Public signature: /IDelegate2.getValue|-5099931934018608327[0] + abstract operator fun getValue(t: T2, p: KProperty<*>): R2 + +} + +// CHECK: +// Mangled name: IR +// Public signature: /IR|null[0] +interface IR { + + // CHECK JVM_IR: + // Mangled name: IR#foo(){}1:0 + // Public signature: /IR.foo|-5478580208809996038[0] + // CHECK JS_IR NATIVE: + // Mangled name: IR#foo(){} + // Public signature: /IR.foo|-1041209573719867811[0] + abstract fun foo(): R + +} + diff --git a/compiler/testData/ir/irText/types/genericFunWithStar.sig.kt.txt b/compiler/testData/ir/irText/types/genericFunWithStar.sig.kt.txt new file mode 100644 index 00000000000..fe3704a6c9b --- /dev/null +++ b/compiler/testData/ir/irText/types/genericFunWithStar.sig.kt.txt @@ -0,0 +1,55 @@ +// CHECK: +// Mangled name: Box +// Public signature: /Box|null[0] +abstract class Box : IBar, IFoo where T : IBar, T : IFoo { + // CHECK: + // Mangled name: Box#(){} + // Public signature: /Box.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Box#bar(kotlin.Array>...){}I<*> + // Public signature: /Box.bar|-1391226342944074333[0] + // CHECK JS_IR NATIVE: + // Mangled name: Box#bar(kotlin.Array>...){} + // Public signature: /Box.bar|8084001391747740010[0] + fun bar(vararg serializers: I<*>): I<*> + + // CHECK JVM_IR: + // Mangled name: Box#foo(I<0:0>){0§}I> + // Public signature: /Box.foo|-2974216352759527693[0] + // CHECK JS_IR NATIVE: + // Mangled name: Box#foo(I<0:0>){0§} + // Public signature: /Box.foo|4625415251535989427[0] + abstract fun foo(tSerializer: I): I> where F : IBar, F : IFoo + +} + +// CHECK: +// Mangled name: I +// Public signature: /I|null[0] +interface I where G : IBar, G : IFoo { + +} + +// CHECK: +// Mangled name: IBar +// Public signature: /IBar|null[0] +interface IBar : IBase { + +} + +// CHECK: +// Mangled name: IBase +// Public signature: /IBase|null[0] +interface IBase { + +} + +// CHECK: +// Mangled name: IFoo +// Public signature: /IFoo|null[0] +interface IFoo : IBase { + +} + diff --git a/compiler/testData/ir/irText/types/genericPropertyReferenceType.kt b/compiler/testData/ir/irText/types/genericPropertyReferenceType.kt index 1ba698a4d21..57a62249a65 100644 --- a/compiler/testData/ir/irText/types/genericPropertyReferenceType.kt +++ b/compiler/testData/ir/irText/types/genericPropertyReferenceType.kt @@ -1,4 +1,8 @@ // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429, KT-57427 + import kotlin.reflect.KMutableProperty class C(var x: T) @@ -18,4 +22,4 @@ fun test1() { fun test2(a: Any) { a as C use(a::y) -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/types/genericPropertyReferenceType.sig.kt.txt b/compiler/testData/ir/irText/types/genericPropertyReferenceType.sig.kt.txt new file mode 100644 index 00000000000..69f8d0369cf --- /dev/null +++ b/compiler/testData/ir/irText/types/genericPropertyReferenceType.sig.kt.txt @@ -0,0 +1,58 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C{}x + // Public signature: /C.x|-8060530855978347579[0] + var x: T + // CHECK JVM_IR: + // Mangled name: C#(){}1:0 + // Public signature: /C.x.|-8893883356128097563[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#(){} + // Public signature: /C.x.|1482705010654679335[0] + get + // CHECK: + // Mangled name: C#(1:0){} + // Public signature: /C.x.|-9166455774953348944[0] + set + + // CHECK: + // Mangled name: C#(1:0){} + // Public signature: /C.|-8731461708390519279[0] + constructor(x: T) /* primary */ + +} + +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +fun test1(): Unit + +// CHECK: +// Mangled name: #test2(kotlin.Any){} +// Public signature: /test2|-8648451680149324146[0] +fun test2(a: Any): Unit + +// CHECK: +// Mangled name: #use(kotlin.reflect.KMutableProperty){} +// Public signature: /use|7185961134944189994[0] +fun use(p: KMutableProperty): Unit + +// CHECK: +// Mangled name: @C<0:0>{0§}y +// Public signature: /y|-2732700153869010159[0] +var C.y: T + // CHECK JVM_IR: + // Mangled name: #@C<0:0>(){0§}0:0 + // Public signature: /y.|-1625423128410329211[0] + // CHECK JS_IR NATIVE: + // Mangled name: #@C<0:0>(){0§} + // Public signature: /y.|5204013647875052288[0] + get(): T + // CHECK: + // Mangled name: #@C<0:0>(0:0){0§} + // Public signature: /y.|6088413970012677834[0] + set(v: T): Unit + diff --git a/compiler/testData/ir/irText/types/inStarProjectionInReceiverType.sig.kt.txt b/compiler/testData/ir/irText/types/inStarProjectionInReceiverType.sig.kt.txt new file mode 100644 index 00000000000..cc59b7b2968 --- /dev/null +++ b/compiler/testData/ir/irText/types/inStarProjectionInReceiverType.sig.kt.txt @@ -0,0 +1,45 @@ +// CHECK: +// Mangled name: Foo +// Public signature: /Foo|null[0] +interface Foo { + + // CHECK: + // Mangled name: Foo#foo(1:0){} + // Public signature: /Foo.foo|-701456291278879981[0] + abstract fun foo(x: T): Unit + + // CHECK: + // Mangled name: Foo{}x + // Public signature: /Foo.x|-8060530855978347579[0] + abstract val x: Int + // CHECK JVM_IR: + // Mangled name: Foo#(){}kotlin.Int + // Public signature: /Foo.x.|4966956098150895696[0] + // CHECK JS_IR NATIVE: + // Mangled name: Foo#(){} + // Public signature: /Foo.x.|1482705010654679335[0] + abstract get + +} + +// CHECK JVM_IR: +// Mangled name: #testReceiver@Foo<*>(){}kotlin.Int +// Public signature: /testReceiver|-6773216258466639837[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testReceiver@Foo<*>(){} +// Public signature: /testReceiver|-7894732961780427626[0] +fun Foo<*>.testReceiver(): Int + +// CHECK: +// Mangled name: #testSmartCastOnExtensionReceiver@Foo<*>(){} +// Public signature: /testSmartCastOnExtensionReceiver|5429678017158557324[0] +fun Foo<*>.testSmartCastOnExtensionReceiver(): Unit + +// CHECK JVM_IR: +// Mangled name: #testValueParameter(Foo<*>){}kotlin.Int +// Public signature: /testValueParameter|6369528729009014404[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testValueParameter(Foo<*>){} +// Public signature: /testValueParameter|-1072740451270393632[0] +fun testValueParameter(vp: Foo<*>): Int + diff --git a/compiler/testData/ir/irText/types/intersectionType1.sig.kt.txt b/compiler/testData/ir/irText/types/intersectionType1.sig.kt.txt new file mode 100644 index 00000000000..e7f4dd7927a --- /dev/null +++ b/compiler/testData/ir/irText/types/intersectionType1.sig.kt.txt @@ -0,0 +1,40 @@ +// CHECK: +// Mangled name: In +// Public signature: /In|null[0] +class In { + // CHECK: + // Mangled name: In#(){} + // Public signature: /In.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK JVM_IR: +// Mangled name: #foo(kotlin.Array>;kotlin.Array>){0§}kotlin.Boolean +// Public signature: /foo|2099284871117952931[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo(kotlin.Array>;kotlin.Array>){0§} +// Public signature: /foo|-9186958305964035853[0] +fun foo(a: Array>, b: Array>): Boolean + +// CHECK JVM_IR: +// Mangled name: #ofType@In<0:0>(kotlin.Any?){0§}kotlin.Boolean +// Public signature: /ofType|2383203766625380016[0] +// CHECK JS_IR NATIVE: +// Mangled name: #ofType@In<0:0>(kotlin.Any?){0§} +// Public signature: /ofType|-4707862451809276934[0] +inline fun In.ofType(y: Any?): Boolean + +// CHECK JVM_IR: +// Mangled name: #select(0:0;0:0){0§}0:0 +// Public signature: /select|8100705338685480795[0] +// CHECK JS_IR NATIVE: +// Mangled name: #select(0:0;0:0){0§} +// Public signature: /select|6468210419697232897[0] +fun select(x: S, y: S): S + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + diff --git a/compiler/testData/ir/irText/types/intersectionType2.sig.kt.txt b/compiler/testData/ir/irText/types/intersectionType2.sig.kt.txt new file mode 100644 index 00000000000..a4977582151 --- /dev/null +++ b/compiler/testData/ir/irText/types/intersectionType2.sig.kt.txt @@ -0,0 +1,52 @@ +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +open class B : A, Foo { + // CHECK: + // Mangled name: B#(){} + // Public signature: /B.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +open class C : A, Foo { + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +interface A { + +} + +// CHECK: +// Mangled name: Foo +// Public signature: /Foo|null[0] +interface Foo { + +} + +// CHECK JVM_IR: +// Mangled name: #foo(){}kotlin.Any +// Public signature: /foo|-9059697968601777418[0] +// CHECK JS_IR NATIVE: +// Mangled name: #foo(){} +// Public signature: /foo|-1041209573719867811[0] +fun foo(): Any + +// CHECK JVM_IR: +// Mangled name: #run(kotlin.Function0<0:0>){0§}0:0 +// Public signature: /run|3503148828372491191[0] +// CHECK JS_IR NATIVE: +// Mangled name: #run(kotlin.Function0<0:0>){0§} +// Public signature: /run|8432521068183421057[0] +fun run(fn: Function0): T + diff --git a/compiler/testData/ir/irText/types/intersectionType3.sig.kt.txt b/compiler/testData/ir/irText/types/intersectionType3.sig.kt.txt new file mode 100644 index 00000000000..b22af04f034 --- /dev/null +++ b/compiler/testData/ir/irText/types/intersectionType3.sig.kt.txt @@ -0,0 +1,109 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +interface A { + +} + +// CHECK: +// Mangled name: A1 +// Public signature: /A1|null[0] +interface A1 : A { + +} + +// CHECK: +// Mangled name: A2 +// Public signature: /A2|null[0] +interface A2 : A { + +} + +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +interface B { + +} + +// CHECK: +// Mangled name: In +// Public signature: /In|null[0] +interface In { + +} + +// CHECK: +// Mangled name: Z1 +// Public signature: /Z1|null[0] +interface Z1 : A, B { + +} + +// CHECK: +// Mangled name: Z2 +// Public signature: /Z2|null[0] +interface Z2 : A, B { + +} + +// CHECK: +// Mangled name: #asT@In<0:0>(){0§} +// Public signature: /asT|-6759682177852648403[0] +inline fun In.asT(): Unit + +// CHECK JVM_IR: +// Mangled name: #isT@In<0:0>(){0§}kotlin.Boolean +// Public signature: /isT|8771576346253960603[0] +// CHECK JS_IR NATIVE: +// Mangled name: #isT@In<0:0>(){0§} +// Public signature: /isT|-5271358953373566018[0] +inline fun In.isT(): Boolean + +// CHECK JVM_IR: +// Mangled name: #sel(0:0;0:0){0§}0:0 +// Public signature: /sel|-3127722538163724092[0] +// CHECK JS_IR NATIVE: +// Mangled name: #sel(0:0;0:0){0§} +// Public signature: /sel|-259814768749576946[0] +fun sel(x: S, y: S): S + +// CHECK: +// Mangled name: #testInAs1(In;In){} +// Public signature: /testInAs1|-1470115559429545343[0] +fun testInAs1(x: In, y: In): Unit + +// CHECK: +// Mangled name: #testInAs2(In;In){} +// Public signature: /testInAs2|-3389815125418569226[0] +fun testInAs2(x: In, y: In): Unit + +// CHECK: +// Mangled name: #testInAs3(In;In){} +// Public signature: /testInAs3|5823331336080521451[0] +fun testInAs3(x: In, y: In): Unit + +// CHECK JVM_IR: +// Mangled name: #testInIs1(In;In){}kotlin.Boolean +// Public signature: /testInIs1|-5403748215345836831[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testInIs1(In;In){} +// Public signature: /testInIs1|4819444353092136691[0] +fun testInIs1(x: In, y: In): Boolean + +// CHECK JVM_IR: +// Mangled name: #testInIs2(In;In){}kotlin.Boolean +// Public signature: /testInIs2|-683199318068952927[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testInIs2(In;In){} +// Public signature: /testInIs2|-5620077316495477950[0] +fun testInIs2(x: In, y: In): Boolean + +// CHECK JVM_IR: +// Mangled name: #testInIs3(In;In){}kotlin.Boolean +// Public signature: /testInIs3|6337187045487006592[0] +// CHECK JS_IR NATIVE: +// Mangled name: #testInIs3(In;In){} +// Public signature: /testInIs3|2260493346542468096[0] +fun testInIs3(x: In, y: In): Boolean + diff --git a/compiler/testData/ir/irText/types/intersectionTypeInSamType.sig.kt.txt b/compiler/testData/ir/irText/types/intersectionTypeInSamType.sig.kt.txt new file mode 100644 index 00000000000..cec47df8933 --- /dev/null +++ b/compiler/testData/ir/irText/types/intersectionTypeInSamType.sig.kt.txt @@ -0,0 +1,124 @@ +// CHECK: +// Mangled name: G1 +// Public signature: /G1|null[0] +class G1 { + // CHECK: + // Mangled name: G1#(){} + // Public signature: /G1.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: G1#checkFoo(IFoo){} + // Public signature: /G1.checkFoo|-5158579555496340270[0] + fun checkFoo(x: IFoo): Unit + +} + +// CHECK: +// Mangled name: G2 +// Public signature: /G2|null[0] +class G2 where T : X, T : Z { + // CHECK: + // Mangled name: G2#(){} + // Public signature: /G2.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: G2#checkBar1(IBar1){} + // Public signature: /G2.checkBar1|8625706131283272107[0] + fun checkBar1(x: IBar1): Unit + + // CHECK: + // Mangled name: G2#checkBar2(IBar2){} + // Public signature: /G2.checkBar2|2985423947777386089[0] + fun checkBar2(x: IBar2): Unit + + // CHECK: + // Mangled name: G2#checkFoo(IFoo){} + // Public signature: /G2.checkFoo|-5158579555496340270[0] + fun checkFoo(x: IFoo): Unit + +} + +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +interface A : X, Z { + +} + +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +interface B : X, Z { + +} + +// CHECK: +// Mangled name: IBar1 +// Public signature: /IBar1|null[0] +fun interface IBar1 where T : X, T : Z { + + // CHECK: + // Mangled name: IBar1#bar(1:0){} + // Public signature: /IBar1.bar|-7393952686038474037[0] + abstract fun bar(t: T): Unit + +} + +// CHECK: +// Mangled name: IBar2 +// Public signature: /IBar2|null[0] +fun interface IBar2 where T : X, T : Z { + + // CHECK: + // Mangled name: IBar2#bar(1:0){} + // Public signature: /IBar2.bar|-7393952686038474037[0] + abstract fun bar(t: T): Unit + +} + +// CHECK: +// Mangled name: IFoo +// Public signature: /IFoo|null[0] +fun interface IFoo { + + // CHECK: + // Mangled name: IFoo#foo(1:0){} + // Public signature: /IFoo.foo|-701456291278879981[0] + abstract fun foo(t: T): Unit + +} + +// CHECK: +// Mangled name: X +// Public signature: /X|null[0] +interface X { + +} + +// CHECK: +// Mangled name: Z +// Public signature: /Z|null[0] +interface Z { + +} + +// CHECK JVM_IR: +// Mangled name: #sel(0:0;0:0){0§}0:0 +// Public signature: /sel|-3127722538163724092[0] +// CHECK JS_IR NATIVE: +// Mangled name: #sel(0:0;0:0){0§} +// Public signature: /sel|-259814768749576946[0] +fun sel(x: T, y: T): T + +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +fun test1(): Unit + +// CHECK: +// Mangled name: #test2(){} +// Public signature: /test2|4279114864133353152[0] +fun test2(): Unit + diff --git a/compiler/testData/ir/irText/types/javaWildcardType.kt b/compiler/testData/ir/irText/types/javaWildcardType.kt index 9baaf41a54d..181e6eb58b2 100644 --- a/compiler/testData/ir/irText/types/javaWildcardType.kt +++ b/compiler/testData/ir/irText/types/javaWildcardType.kt @@ -1,4 +1,8 @@ // TARGET_BACKEND: JVM + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57754 + // FILE: javaWildcardType.kt interface K { fun kf1(): Collection @@ -20,4 +24,4 @@ public interface J { void jg1(Collection c); void jg2(Collection c); -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/types/javaWildcardType.sig.kt.txt b/compiler/testData/ir/irText/types/javaWildcardType.sig.kt.txt new file mode 100644 index 00000000000..0a38afed736 --- /dev/null +++ b/compiler/testData/ir/irText/types/javaWildcardType.sig.kt.txt @@ -0,0 +1,85 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C : J, K { + // CHECK: + // Mangled name: C#(J;K){} + // Public signature: /C.|-2567074436149559695[0] + constructor(j: J, k: K) /* primary */ + // CHECK: + // Mangled name: C.$$delegate_0 + // Public signature: /C.$$delegate_0|-7286425919675154353[0] + private /* final field */ val $$delegate_0: J + // CHECK: + // Mangled name: C.$$delegate_1 + // Public signature: /C.$$delegate_1|-7286425919675154353[0] + private /* final field */ val $$delegate_1: K + // CHECK JVM_IR: + // Mangled name: C#jf1(){}kotlin.collections.MutableCollection? + // Public signature: /C.jf1|-387990976967063904[0] + override fun jf1(): MutableCollection? + + // CHECK JVM_IR: + // Mangled name: C#jf2(){}kotlin.collections.MutableCollection? + // Public signature: /C.jf2|-7398686593036415617[0] + override fun jf2(): MutableCollection? + + // CHECK: + // Mangled name: C#jg1(kotlin.collections.MutableCollection?){} + // Public signature: /C.jg1|2174775240821458908[0] + override fun jg1(c: MutableCollection?): Unit + + // CHECK: + // Mangled name: C#jg2(kotlin.collections.MutableCollection?){} + // Public signature: /C.jg2|-7555364934046539560[0] + override fun jg2(c: MutableCollection?): Unit + + // CHECK JVM_IR: + // Mangled name: C#kf1(){}kotlin.collections.Collection + // Public signature: /C.kf1|-5428150421605044193[0] + override fun kf1(): Collection + + // CHECK JVM_IR: + // Mangled name: C#kf2(){}kotlin.collections.Collection + // Public signature: /C.kf2|8420376873797628329[0] + override fun kf2(): Collection + + // CHECK: + // Mangled name: C#kg1(kotlin.collections.Collection){} + // Public signature: /C.kg1|6666459745981582410[0] + override fun kg1(c: Collection): Unit + + // CHECK: + // Mangled name: C#kg2(kotlin.collections.Collection){} + // Public signature: /C.kg2|-8205692300519552855[0] + override fun kg2(c: Collection): Unit + +} + +// CHECK: +// Mangled name: K +// Public signature: /K|null[0] +interface K { + + // CHECK JVM_IR: + // Mangled name: K#kf1(){}kotlin.collections.Collection + // Public signature: /K.kf1|-5428150421605044193[0] + abstract fun kf1(): Collection + + // CHECK JVM_IR: + // Mangled name: K#kf2(){}kotlin.collections.Collection + // Public signature: /K.kf2|8420376873797628329[0] + abstract fun kf2(): Collection + + // CHECK: + // Mangled name: K#kg1(kotlin.collections.Collection){} + // Public signature: /K.kg1|6666459745981582410[0] + abstract fun kg1(c: Collection): Unit + + // CHECK: + // Mangled name: K#kg2(kotlin.collections.Collection){} + // Public signature: /K.kg2|-8205692300519552855[0] + abstract fun kg2(c: Collection): Unit + +} + diff --git a/compiler/testData/ir/irText/types/kt36143.sig.kt.txt b/compiler/testData/ir/irText/types/kt36143.sig.kt.txt new file mode 100644 index 00000000000..5b6f9a6bebf --- /dev/null +++ b/compiler/testData/ir/irText/types/kt36143.sig.kt.txt @@ -0,0 +1,8 @@ +// CHECK JVM_IR: +// Mangled name: #test@kotlin.Array(){}kotlin.Int +// Public signature: /test|5356494473111947391[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test@kotlin.Array(){} +// Public signature: /test|1764811181460445584[0] +fun Array.test(): Int + diff --git a/compiler/testData/ir/irText/types/kt49526.sig.kt.txt b/compiler/testData/ir/irText/types/kt49526.sig.kt.txt new file mode 100644 index 00000000000..bf035888864 --- /dev/null +++ b/compiler/testData/ir/irText/types/kt49526.sig.kt.txt @@ -0,0 +1,8 @@ +// CHECK JVM_IR: +// Mangled name: #test(){}kotlin.Boolean +// Public signature: /test|8354328004142328829[0] +// CHECK JS_IR NATIVE: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Boolean + diff --git a/compiler/testData/ir/irText/types/localVariableOfIntersectionType.sig.kt.txt b/compiler/testData/ir/irText/types/localVariableOfIntersectionType.sig.kt.txt new file mode 100644 index 00000000000..a44264c0d28 --- /dev/null +++ b/compiler/testData/ir/irText/types/localVariableOfIntersectionType.sig.kt.txt @@ -0,0 +1,70 @@ +// CHECK: +// Mangled name: IA +// Public signature: /IA|null[0] +interface IA { + + // CHECK: + // Mangled name: IA#foo(){} + // Public signature: /IA.foo|-1041209573719867811[0] + abstract fun foo(): Unit + +} + +// CHECK: +// Mangled name: IB +// Public signature: /IB|null[0] +interface IB { + + // CHECK: + // Mangled name: IB#bar(){} + // Public signature: /IB.bar|496682602797471549[0] + abstract fun bar(): Unit + +} + +// CHECK: +// Mangled name: In +// Public signature: /In|null[0] +interface In { + +} + +// CHECK: +// Mangled name: Inv +// Public signature: /Inv|null[0] +interface Inv { + + // CHECK: + // Mangled name: Inv{}t + // Public signature: /Inv.t|-8767999791664836944[0] + abstract val t: T + // CHECK JVM_IR: + // Mangled name: Inv#(){}1:0 + // Public signature: /Inv.t.|5296523675281381766[0] + // CHECK JS_IR NATIVE: + // Mangled name: Inv#(){} + // Public signature: /Inv.t.|7061140872129253552[0] + abstract get + +} + +// CHECK: +// Mangled name: Z +// Public signature: /Z|null[0] +interface Z { + + // CHECK JVM_IR: + // Mangled name: Z#create(In<0:0>;In<0:0>){0§}Inv<0:0> + // Public signature: /Z.create|7944253173603668399[0] + // CHECK JS_IR NATIVE: + // Mangled name: Z#create(In<0:0>;In<0:0>){0§} + // Public signature: /Z.create|-4145351315131572749[0] + abstract fun create(x: In, y: In): Inv + +} + +// CHECK: +// Mangled name: #test(In;In;Z){} +// Public signature: /test|-7709946016530502758[0] +fun test(a: In, b: In, z: Z): Unit + diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullability.sig.kt.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullability.sig.kt.txt new file mode 100644 index 00000000000..7fd9c0da804 --- /dev/null +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullability.sig.kt.txt @@ -0,0 +1,48 @@ +// CHECK: +// Mangled name: {}testGlobalVal +// Public signature: /testGlobalVal|-7890151294500331033[0] +val testGlobalVal: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /testGlobalVal.|-3066052240315060283[0] + get + +// CHECK: +// Mangled name: #testJUse(){} +// Public signature: /testJUse|-778395660464810777[0] +fun testJUse(): Unit + +// CHECK: +// Mangled name: #testLocalVal(){} +// Public signature: /testLocalVal|-7792259248330039914[0] +fun testLocalVal(): Unit + +// CHECK: +// Mangled name: #testLocalVarUse(){} +// Public signature: /testLocalVarUse|-2742930964593648658[0] +fun testLocalVarUse(): Unit + +// CHECK JVM_IR: +// Mangled name: #testReturnValue(){}kotlin.String +// Public signature: /testReturnValue|5442151564926968913[0] +fun testReturnValue(): String + +// CHECK: +// Mangled name: #testUse(){} +// Public signature: /testUse|-7403625566932697674[0] +fun testUse(): Unit + +// CHECK: +// Mangled name: #use(kotlin.String){} +// Public signature: /use|282927213234974825[0] +fun use(s: String): Unit + +// CHECK: +// Mangled name: {}testGlobalValGetter +// Public signature: /testGlobalValGetter|4373373755408489194[0] +val testGlobalValGetter: String + // CHECK JVM_IR: + // Mangled name: #(){}kotlin.String + // Public signature: /testGlobalValGetter.|4232922191754925744[0] + get(): String + diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.kt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.kt index d87cd844041..53200da8e06 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.kt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.kt @@ -1,5 +1,9 @@ // TARGET_BACKEND: JVM // WITH_STDLIB + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429 + // FILE: enhancedNullabilityInDestructuringAssignment.kt fun use(x: Any, y: Any) {} diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.sig.kt.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.sig.kt.txt new file mode 100644 index 00000000000..3312bfaf469 --- /dev/null +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.sig.kt.txt @@ -0,0 +1,108 @@ +// CHECK: +// Mangled name: P +// Public signature: /P|null[0] +class P { + // CHECK: + // Mangled name: P{}x + // Public signature: /P.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: P#(){}kotlin.Int + // Public signature: /P.x.|4966956098150895696[0] + get + + // CHECK: + // Mangled name: P{}y + // Public signature: /P.y|3625903257357557171[0] + val y: Int + // CHECK JVM_IR: + // Mangled name: P#(){}kotlin.Int + // Public signature: /P.y.|-6745575372101973707[0] + get + + // CHECK: + // Mangled name: P#(kotlin.Int;kotlin.Int){} + // Public signature: /P.|-7691762014320324121[0] + constructor(x: Int, y: Int) /* primary */ + + // CHECK JVM_IR: + // Mangled name: P#component1(){}kotlin.Int + // Public signature: /P.component1|-8217597213800111288[0] + operator fun component1(): Int + + // CHECK JVM_IR: + // Mangled name: P#component2(){}kotlin.Int + // Public signature: /P.component2|-7444333055342785242[0] + operator fun component2(): Int + +} + +// CHECK: +// Mangled name: Q +// Public signature: /Q|null[0] +class Q { + // CHECK: + // Mangled name: Q{}x + // Public signature: /Q.x|-8060530855978347579[0] + val x: T1 + // CHECK JVM_IR: + // Mangled name: Q#(){}1:0 + // Public signature: /Q.x.|-8893883356128097563[0] + get + + // CHECK: + // Mangled name: Q{}y + // Public signature: /Q.y|3625903257357557171[0] + val y: T2 + // CHECK JVM_IR: + // Mangled name: Q#(){}1:1 + // Public signature: /Q.y.|6657541212363005233[0] + get + + // CHECK: + // Mangled name: Q#(1:0;1:1){} + // Public signature: /Q.|3086114026882374588[0] + constructor(x: T1, y: T2) /* primary */ + + // CHECK JVM_IR: + // Mangled name: Q#component1(){}1:0 + // Public signature: /Q.component1|2393470133763651536[0] + operator fun component1(): T1 + + // CHECK JVM_IR: + // Mangled name: Q#component2(){}1:1 + // Public signature: /Q.component2|319033347667924570[0] + operator fun component2(): T2 + +} + +// CHECK: +// Mangled name: #test1(){} +// Public signature: /test1|4297044443957252634[0] +fun test1(): Unit + +// CHECK: +// Mangled name: #test2(){} +// Public signature: /test2|4279114864133353152[0] +fun test2(): Unit + +// CHECK: +// Mangled name: #test2Desugared(){} +// Public signature: /test2Desugared|-3180716473372303323[0] +fun test2Desugared(): Unit + +// CHECK: +// Mangled name: #test3(){} +// Public signature: /test3|-3759735065270951803[0] +fun test3(): Unit + +// CHECK: +// Mangled name: #test4(){} +// Public signature: /test4|5588455914500386239[0] +fun test4(): Unit + +// CHECK: +// Mangled name: #use(kotlin.Any;kotlin.Any){} +// Public signature: /use|-6359788865457040335[0] +fun use(x: Any, y: Any): Unit + diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.sig.kt.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.sig.kt.txt new file mode 100644 index 00000000000..68af60b237d --- /dev/null +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.sig.kt.txt @@ -0,0 +1,105 @@ +// CHECK: +// Mangled name: P +// Public signature: /P|null[0] +data class P { + // CHECK: + // Mangled name: P{}x + // Public signature: /P.x|-8060530855978347579[0] + val x: Int + // CHECK JVM_IR: + // Mangled name: P#(){}kotlin.Int + // Public signature: /P.x.|4966956098150895696[0] + get + + // CHECK: + // Mangled name: P{}y + // Public signature: /P.y|3625903257357557171[0] + val y: Int + // CHECK JVM_IR: + // Mangled name: P#(){}kotlin.Int + // Public signature: /P.y.|-6745575372101973707[0] + get + + // CHECK: + // Mangled name: P#(kotlin.Int;kotlin.Int){} + // Public signature: /P.|-7691762014320324121[0] + constructor(x: Int, y: Int) /* primary */ + // CHECK JVM_IR: + // Mangled name: P#component1(){}kotlin.Int + // Public signature: /P.component1|-8217597213800111288[0] + operator fun component1(): Int + + // CHECK JVM_IR: + // Mangled name: P#component2(){}kotlin.Int + // Public signature: /P.component2|-7444333055342785242[0] + operator fun component2(): Int + + // CHECK JVM_IR: + // Mangled name: P#copy(kotlin.Int;kotlin.Int){}P + // Public signature: /P.copy|7812152200479194143[0] + fun copy(x: Int, y: Int): P + + // CHECK JVM_IR: + // Mangled name: P#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /P.equals|722809408929142791[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: P#hashCode(){}kotlin.Int + // Public signature: /P.hashCode|-8048879360829830756[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: P#toString(){}kotlin.String + // Public signature: /P.toString|6958853723545266802[0] + override fun toString(): String + +} + +// CHECK: +// Mangled name: K +// Public signature: /K|null[0] +interface K { + + // CHECK JVM_IR: + // Mangled name: K#arrayOfNotNull(){}kotlin.Array

+ // Public signature: /K.arrayOfNotNull|-3412104294529727261[0] + abstract fun arrayOfNotNull(): Array

+ +} + +// CHECK: +// Mangled name: #testDesugaredForInList(){} +// Public signature: /testDesugaredForInList|-5782772317279913567[0] +fun testDesugaredForInList(): Unit + +// CHECK: +// Mangled name: #testForInArrayUnused(J){} +// Public signature: /testForInArrayUnused|-1510075261509964471[0] +fun testForInArrayUnused(j: J): Unit + +// CHECK: +// Mangled name: #testForInArrayUse(J){} +// Public signature: /testForInArrayUse|4222411163139319025[0] +fun testForInArrayUse(j: J): Unit + +// CHECK: +// Mangled name: #testForInListDestructured(){} +// Public signature: /testForInListDestructured|-6792759367826308939[0] +fun testForInListDestructured(): Unit + +// CHECK: +// Mangled name: #testForInListUnused(){} +// Public signature: /testForInListUnused|-2195059500816622210[0] +fun testForInListUnused(): Unit + +// CHECK: +// Mangled name: #testForInListUse(){} +// Public signature: /testForInListUse|2913967956256667805[0] +fun testForInListUse(): Unit + +// CHECK: +// Mangled name: #use(P){} +// Public signature: /use|3488579196470931687[0] +fun use(s: P): Unit + diff --git a/compiler/testData/ir/irText/types/nullChecks/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.sig.kt.txt b/compiler/testData/ir/irText/types/nullChecks/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.sig.kt.txt new file mode 100644 index 00000000000..8f98a954807 --- /dev/null +++ b/compiler/testData/ir/irText/types/nullChecks/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.sig.kt.txt @@ -0,0 +1,30 @@ +// CHECK JVM_IR: +// Mangled name: #testKotlinCompareToPlatform@JavaClass(){}kotlin.Int +// Public signature: /testKotlinCompareToPlatform|-5546439559750208367[0] +fun JavaClass.testKotlinCompareToPlatform(): Int + +// CHECK JVM_IR: +// Mangled name: #testKotlinEqualsPlatform@JavaClass(){}kotlin.Boolean +// Public signature: /testKotlinEqualsPlatform|-887320242138996512[0] +fun JavaClass.testKotlinEqualsPlatform(): Boolean + +// CHECK JVM_IR: +// Mangled name: #testPlatformCompareToKotlin@JavaClass(){}kotlin.Int +// Public signature: /testPlatformCompareToKotlin|3114749525946571528[0] +fun JavaClass.testPlatformCompareToKotlin(): Int + +// CHECK JVM_IR: +// Mangled name: #testPlatformCompareToPlatform@JavaClass(){}kotlin.Int +// Public signature: /testPlatformCompareToPlatform|-2508800761104076198[0] +fun JavaClass.testPlatformCompareToPlatform(): Int + +// CHECK JVM_IR: +// Mangled name: #testPlatformEqualsKotlin@JavaClass(){}kotlin.Boolean +// Public signature: /testPlatformEqualsKotlin|2622447210423888595[0] +fun JavaClass.testPlatformEqualsKotlin(): Boolean + +// CHECK JVM_IR: +// Mangled name: #testPlatformEqualsPlatform@JavaClass(){}kotlin.Boolean +// Public signature: /testPlatformEqualsPlatform|-3505772133030731244[0] +fun JavaClass.testPlatformEqualsPlatform(): Boolean + diff --git a/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.sig.kt.txt b/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.sig.kt.txt new file mode 100644 index 00000000000..d165287b1b0 --- /dev/null +++ b/compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.sig.kt.txt @@ -0,0 +1,55 @@ +// CHECK: +// Mangled name: MySet +// Public signature: /MySet|null[0] +class MySet : Set { + // CHECK: + // Mangled name: MySet#(){} + // Public signature: /MySet.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: MySet#contains(kotlin.String){}kotlin.Boolean + // Public signature: /MySet.contains|-5026920908417540913[0] + override operator fun contains(element: String): Boolean + + // CHECK JVM_IR: + // Mangled name: MySet#containsAll(kotlin.collections.Collection){}kotlin.Boolean + // Public signature: /MySet.containsAll|-2238462666028753495[0] + override fun containsAll(elements: Collection): Boolean + + // CHECK JVM_IR: + // Mangled name: MySet#isEmpty(){}kotlin.Boolean + // Public signature: /MySet.isEmpty|-626562167393617703[0] + override fun isEmpty(): Boolean + + // CHECK JVM_IR: + // Mangled name: MySet#iterator(){}kotlin.collections.Iterator + // Public signature: /MySet.iterator|-3234682308746536807[0] + override operator fun iterator(): Iterator + + // CHECK: + // Mangled name: MySet{}size + // Public signature: /MySet.size|-6253659984320132064[0] + override val size: Int + // CHECK JVM_IR: + // Mangled name: MySet#(){}kotlin.Int + // Public signature: /MySet.size.|-3941649985161900780[0] + override get(): Int + +} + +// CHECK: +// Mangled name: #f(kotlin.String){} +// Public signature: /f|5157548403930815746[0] +fun f(s: String): Unit + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + +// CHECK: +// Mangled name: #testContains(MySet){} +// Public signature: /testContains|-6934706963240728441[0] +fun testContains(m: MySet): Unit + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckInElvisRhs.sig.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckInElvisRhs.sig.kt.txt new file mode 100644 index 00000000000..8161a19753c --- /dev/null +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckInElvisRhs.sig.kt.txt @@ -0,0 +1,14 @@ +// MODULE: lib +// MODULE: main +// FILE: nullCheckInElvisRhs.kt + +// CHECK JVM_IR: +// Mangled name: #baz(){}kotlin.String? +// Public signature: /baz|3245777681320490676[0] +fun baz(): String? + +// CHECK JVM_IR: +// Mangled name: #test(){}kotlin.String +// Public signature: /test|-7008832412320199001[0] +fun test(): String + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.kt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.kt index 6cd10d8e3f9..a028120e033 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.kt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.kt @@ -1,5 +1,8 @@ // TARGET_BACKEND: JVM +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57754 + // MODULE: lib // FILE: A.java public class A { diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.sig.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.sig.kt.txt new file mode 100644 index 00000000000..d36c05e812f --- /dev/null +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.sig.kt.txt @@ -0,0 +1,56 @@ +// MODULE: lib +// MODULE: main +// FILE: nullCheckOnInterfaceDelegation.kt + +// CHECK: +// Mangled name: Delegated +// Public signature: /Delegated|null[0] +class Delegated : IFoo { + // CHECK: + // Mangled name: Delegated#(){} + // Public signature: /Delegated.|-5645683436151566731[0] + constructor() /* primary */ + // CHECK: + // Mangled name: Delegated.$$delegate_0 + // Public signature: /Delegated.$$delegate_0|-7286425919675154353[0] + private /* final field */ val $$delegate_0: Derived + // CHECK JVM_IR: + // Mangled name: Delegated#foo(){}kotlin.String + // Public signature: /Delegated.foo|485335955883620819[0] + override fun foo(): String + +} + +// CHECK: +// Mangled name: Derived +// Public signature: /Derived|null[0] +class Derived : A, IFoo { + // CHECK: + // Mangled name: Derived#(){} + // Public signature: /Derived.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Derived#foo(){}kotlin.String? + // Public signature: /Derived.foo|4483044608789364619[0] + override fun foo(): String? + +} + +// CHECK: +// Mangled name: IFoo +// Public signature: /IFoo|null[0] +interface IFoo { + + // CHECK JVM_IR: + // Mangled name: IFoo#foo(){}kotlin.String + // Public signature: /IFoo.foo|485335955883620819[0] + abstract fun foo(): String + +} + +// CHECK JVM_IR: +// Mangled name: #testReturnValue(){}kotlin.String +// Public signature: /testReturnValue|5442151564926968913[0] +fun testReturnValue(): String + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsT.kt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsT.kt index e7695a9ae6d..83a84976421 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsT.kt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsT.kt @@ -1,5 +1,6 @@ // TARGET_BACKEND: JVM // FIR_IDENTICAL + // FILE: nnStringVsT.kt fun useT(fn: () -> T) = fn() diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsT.sig.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsT.sig.kt.txt new file mode 100644 index 00000000000..a88c4939bdc --- /dev/null +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsT.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #testNoNullCheck(){} +// Public signature: /testNoNullCheck|6855631801773553469[0] +fun testNoNullCheck(): Unit + +// CHECK JVM_IR: +// Mangled name: #useT(kotlin.Function0<0:0>){0§}0:0 +// Public signature: /useT|3740152703351504606[0] +fun useT(fn: Function0): T + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTAny.kt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTAny.kt index 7c639c16554..1fbafaeafcd 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTAny.kt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTAny.kt @@ -1,5 +1,6 @@ // TARGET_BACKEND: JVM // FIR_IDENTICAL + // FILE: nnStringVsTAny.kt fun useTAny(fn: () -> T) = fn() diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTAny.sig.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTAny.sig.kt.txt new file mode 100644 index 00000000000..0005a70b1c0 --- /dev/null +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTAny.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #testNoNullCheck(){} +// Public signature: /testNoNullCheck|6855631801773553469[0] +fun testNoNullCheck(): Unit + +// CHECK JVM_IR: +// Mangled name: #useTAny(kotlin.Function0<0:0>){0§}0:0 +// Public signature: /useTAny|-857588679383677873[0] +fun useTAny(fn: Function0): T + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTConstrained.kt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTConstrained.kt index 54022c04d0c..5fa160bbea3 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTConstrained.kt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTConstrained.kt @@ -1,5 +1,10 @@ // TARGET_BACKEND: JVM // FIR_IDENTICAL +// DUMP_LOCAL_DECLARATION_SIGNATURES + +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57428 + // FILE: nnStringVsTConstrained.kt fun useTConstrained(xs: Array, fn: () -> T) = fn() diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTConstrained.sig.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTConstrained.sig.kt.txt new file mode 100644 index 00000000000..08c7a94be2a --- /dev/null +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTConstrained.sig.kt.txt @@ -0,0 +1,13 @@ +// CHECK: +// Mangled name: #testWithNullCheck(kotlin.Array){} +// Public signature: /testWithNullCheck|7420857220126640924[0] +fun testWithNullCheck(xs: Array): Unit + // CHECK JVM_IR: + // Mangled name: #testWithNullCheck(kotlin.Array){}##static(){}kotlin.String + local fun (): String + +// CHECK JVM_IR: +// Mangled name: #useTConstrained(kotlin.Array<0:0>;kotlin.Function0<0:0>){0§}0:0 +// Public signature: /useTConstrained|-7115678268313457255[0] +fun useTConstrained(xs: Array, fn: Function0): T + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXArray.kt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXArray.kt index 862fcbdff32..e70ee5096d2 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXArray.kt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXArray.kt @@ -1,5 +1,6 @@ // TARGET_BACKEND: JVM // FIR_IDENTICAL + // FILE: nnStringVsTXArray.kt fun useTX(x: T, fn: () -> T) = fn() diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXArray.sig.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXArray.sig.kt.txt new file mode 100644 index 00000000000..6b4c02181e6 --- /dev/null +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXArray.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #testWithNullCheck(kotlin.Array){} +// Public signature: /testWithNullCheck|7420857220126640924[0] +fun testWithNullCheck(xs: Array): Unit + +// CHECK JVM_IR: +// Mangled name: #useTX(0:0;kotlin.Function0<0:0>){0§}0:0 +// Public signature: /useTX|-6964391636652065512[0] +fun useTX(x: T, fn: Function0): T + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXString.kt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXString.kt index 8257db025a1..bcbd95b0a08 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXString.kt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXString.kt @@ -1,5 +1,6 @@ // TARGET_BACKEND: JVM // FIR_IDENTICAL + // FILE: nnStringVsTXString.kt fun useTX(x: T, fn: () -> T) = fn() diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXString.sig.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXString.sig.kt.txt new file mode 100644 index 00000000000..d6aa0b86d32 --- /dev/null +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/nnStringVsTXString.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #testWithNullCheck(){} +// Public signature: /testWithNullCheck|3877804200563740268[0] +fun testWithNullCheck(): Unit + +// CHECK JVM_IR: +// Mangled name: #useTX(0:0;kotlin.Function0<0:0>){0§}0:0 +// Public signature: /useTX|-6964391636652065512[0] +fun useTX(x: T, fn: Function0): T + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsAny.kt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsAny.kt index 5a5c09e2407..ade4db91d22 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsAny.kt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsAny.kt @@ -1,5 +1,6 @@ // TARGET_BACKEND: JVM // FIR_IDENTICAL + // FILE: stringVsAny.kt fun useAny(fn: () -> Any) = fn() diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsAny.sig.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsAny.sig.kt.txt new file mode 100644 index 00000000000..6f7d884e2a3 --- /dev/null +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsAny.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #testNullCheck(){} +// Public signature: /testNullCheck|3964065321325408775[0] +fun testNullCheck(): Unit + +// CHECK JVM_IR: +// Mangled name: #useAny(kotlin.Function0){}kotlin.Any +// Public signature: /useAny|7648226468706473651[0] +fun useAny(fn: Function0): Any + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsT.kt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsT.kt index 3d2e12527b3..eb1ab6b7241 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsT.kt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsT.kt @@ -1,5 +1,6 @@ // TARGET_BACKEND: JVM // FIR_IDENTICAL + // FILE: stringVsT.kt fun useT(fn: () -> T) = fn() diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsT.sig.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsT.sig.kt.txt new file mode 100644 index 00000000000..a88c4939bdc --- /dev/null +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsT.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #testNoNullCheck(){} +// Public signature: /testNoNullCheck|6855631801773553469[0] +fun testNoNullCheck(): Unit + +// CHECK JVM_IR: +// Mangled name: #useT(kotlin.Function0<0:0>){0§}0:0 +// Public signature: /useT|3740152703351504606[0] +fun useT(fn: Function0): T + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTAny.kt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTAny.kt index 08f0a1c60fc..d9a04fe8674 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTAny.kt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTAny.kt @@ -1,5 +1,6 @@ // TARGET_BACKEND: JVM // FIR_IDENTICAL + // FILE: stringVsTAny.kt fun useTAny(fn: () -> T) = fn() diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTAny.sig.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTAny.sig.kt.txt new file mode 100644 index 00000000000..0005a70b1c0 --- /dev/null +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTAny.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #testNoNullCheck(){} +// Public signature: /testNoNullCheck|6855631801773553469[0] +fun testNoNullCheck(): Unit + +// CHECK JVM_IR: +// Mangled name: #useTAny(kotlin.Function0<0:0>){0§}0:0 +// Public signature: /useTAny|-857588679383677873[0] +fun useTAny(fn: Function0): T + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTConstrained.kt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTConstrained.kt index b9573300c49..f5ca27f5fc1 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTConstrained.kt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTConstrained.kt @@ -1,5 +1,6 @@ // FIR_IDENTICAL // TARGET_BACKEND: JVM + // FILE: stringVsTConstrained.kt fun useTConstrained(xs: Array, fn: () -> T) = fn() diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTConstrained.sig.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTConstrained.sig.kt.txt new file mode 100644 index 00000000000..5ec23266da5 --- /dev/null +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTConstrained.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #testWithNullCheck(kotlin.Array){} +// Public signature: /testWithNullCheck|7420857220126640924[0] +fun testWithNullCheck(xs: Array): Unit + +// CHECK JVM_IR: +// Mangled name: #useTConstrained(kotlin.Array<0:0>;kotlin.Function0<0:0>){0§}0:0 +// Public signature: /useTConstrained|-7115678268313457255[0] +fun useTConstrained(xs: Array, fn: Function0): T + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXArray.kt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXArray.kt index 4eb430aff41..5fcbc565a31 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXArray.kt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXArray.kt @@ -1,5 +1,6 @@ // TARGET_BACKEND: JVM // FIR_IDENTICAL + // FILE: stringVsTXArray.kt fun useTX(x: T, fn: () -> T) = fn() diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXArray.sig.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXArray.sig.kt.txt new file mode 100644 index 00000000000..9e67c88a0b0 --- /dev/null +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXArray.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #testNoNullCheck(kotlin.Array){} +// Public signature: /testNoNullCheck|2656035610375474723[0] +fun testNoNullCheck(xs: Array): Unit + +// CHECK JVM_IR: +// Mangled name: #useTX(0:0;kotlin.Function0<0:0>){0§}0:0 +// Public signature: /useTX|-6964391636652065512[0] +fun useTX(x: T, fn: Function0): T + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXString.kt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXString.kt index 2d4633b6231..1cf096dbbc0 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXString.kt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXString.kt @@ -1,5 +1,6 @@ // TARGET_BACKEND: JVM // FIR_IDENTICAL + // FILE: stringVsTXString.kt fun useTX(x: T, fn: () -> T) = fn() diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXString.sig.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXString.sig.kt.txt new file mode 100644 index 00000000000..f5026c0f68b --- /dev/null +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnLambdaResult/stringVsTXString.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK: +// Mangled name: #testNoNullCheck(){} +// Public signature: /testNoNullCheck|6855631801773553469[0] +fun testNoNullCheck(): Unit + +// CHECK JVM_IR: +// Mangled name: #useTX(0:0;kotlin.Function0<0:0>){0§}0:0 +// Public signature: /useTX|-6964391636652065512[0] +fun useTX(x: T, fn: Function0): T + diff --git a/compiler/testData/ir/irText/types/nullChecks/nullabilityAssertionOnExtensionReceiver.sig.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullabilityAssertionOnExtensionReceiver.sig.kt.txt new file mode 100644 index 00000000000..475fac744f4 --- /dev/null +++ b/compiler/testData/ir/irText/types/nullChecks/nullabilityAssertionOnExtensionReceiver.sig.kt.txt @@ -0,0 +1,31 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C { + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: C#memberExtension@kotlin.String(){} + // Public signature: /C.memberExtension|8931694524537611772[0] + fun String.memberExtension(): Unit + +} + +// CHECK: +// Mangled name: #extension@kotlin.String(){} +// Public signature: /extension|1223747003631847513[0] +fun String.extension(): Unit + +// CHECK: +// Mangled name: #testExt(){} +// Public signature: /testExt|4821959581718730803[0] +fun testExt(): Unit + +// CHECK: +// Mangled name: #testMemberExt@C(){} +// Public signature: /testMemberExt|-3552184253632349646[0] +fun C.testMemberExt(): Unit + diff --git a/compiler/testData/ir/irText/types/nullChecks/platformTypeReceiver.sig.kt.txt b/compiler/testData/ir/irText/types/nullChecks/platformTypeReceiver.sig.kt.txt new file mode 100644 index 00000000000..8bb530379ed --- /dev/null +++ b/compiler/testData/ir/irText/types/nullChecks/platformTypeReceiver.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK JVM_IR: +// Mangled name: #test1(){}kotlin.Boolean +// Public signature: /test1|6066090347244057212[0] +fun test1(): Boolean + +// CHECK JVM_IR: +// Mangled name: #test2(){}kotlin.Boolean +// Public signature: /test2|-8502648892389047755[0] +fun test2(): Boolean + diff --git a/compiler/testData/ir/irText/types/nullChecks/typeParameterWithMixedNullableAndNotNullableBounds.sig.kt.txt b/compiler/testData/ir/irText/types/nullChecks/typeParameterWithMixedNullableAndNotNullableBounds.sig.kt.txt new file mode 100644 index 00000000000..74e6cf86b68 --- /dev/null +++ b/compiler/testData/ir/irText/types/nullChecks/typeParameterWithMixedNullableAndNotNullableBounds.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK JVM_IR: +// Mangled name: #f(0:0){0§>}kotlin.Int +// Public signature: /f|-3526152195410076712[0] +fun f(x: T): Int where T : CharSequence?, T : Comparable + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + diff --git a/compiler/testData/ir/irText/types/nullChecks/typeParameterWithMultipleNotNullableBounds.sig.kt.txt b/compiler/testData/ir/irText/types/nullChecks/typeParameterWithMultipleNotNullableBounds.sig.kt.txt new file mode 100644 index 00000000000..2d1b7f0649b --- /dev/null +++ b/compiler/testData/ir/irText/types/nullChecks/typeParameterWithMultipleNotNullableBounds.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK JVM_IR: +// Mangled name: #f(0:0){0§>}kotlin.Int +// Public signature: /f|-4492268702610714557[0] +fun f(x: T): Int where T : CharSequence, T : Comparable + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + diff --git a/compiler/testData/ir/irText/types/nullChecks/typeParameterWithMultipleNullableBounds.sig.kt.txt b/compiler/testData/ir/irText/types/nullChecks/typeParameterWithMultipleNullableBounds.sig.kt.txt new file mode 100644 index 00000000000..e1e9b2474cc --- /dev/null +++ b/compiler/testData/ir/irText/types/nullChecks/typeParameterWithMultipleNullableBounds.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK JVM_IR: +// Mangled name: #f(0:0){0§?>}kotlin.Int? +// Public signature: /f|-5500886294888424567[0] +fun f(x: T): Int? where T : CharSequence?, T : Comparable? + +// CHECK: +// Mangled name: #test(){} +// Public signature: /test|6620506149988718649[0] +fun test(): Unit + diff --git a/compiler/testData/ir/irText/types/rawTypeInSignature.kt b/compiler/testData/ir/irText/types/rawTypeInSignature.kt index 5719a8c2884..0c45e50b33f 100644 --- a/compiler/testData/ir/irText/types/rawTypeInSignature.kt +++ b/compiler/testData/ir/irText/types/rawTypeInSignature.kt @@ -1,4 +1,8 @@ // TARGET_BACKEND: JVM + +// SKIP_SIGNATURE_DUMP +// ^ Nullability is different for raw types in K1 and K2 + // FILE: rawTypeInSignature.kt class GenericInv @@ -26,4 +30,4 @@ public interface JRaw { GenericIn returnsRawGenericIn(); void takesRawGenericOut(GenericOut g); GenericOut returnsRawGenericOut(); -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/types/receiverOfIntersectionType.sig.kt.txt b/compiler/testData/ir/irText/types/receiverOfIntersectionType.sig.kt.txt new file mode 100644 index 00000000000..c535c7a90b9 --- /dev/null +++ b/compiler/testData/ir/irText/types/receiverOfIntersectionType.sig.kt.txt @@ -0,0 +1,73 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A : I, J { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: A#ff(){} + // Public signature: /A.ff|-487791955964352654[0] + override fun ff(): Unit + +} + +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +class B : I, J { + // CHECK: + // Mangled name: B#(){} + // Public signature: /B.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: B#ff(){} + // Public signature: /B.ff|-487791955964352654[0] + override fun ff(): Unit + +} + +// CHECK: +// Mangled name: I +// Public signature: /I|null[0] +interface I : K { + + // CHECK: + // Mangled name: I#ff(){} + // Public signature: /I.ff|-487791955964352654[0] + abstract fun ff(): Unit + +} + +// CHECK: +// Mangled name: J +// Public signature: /J|null[0] +interface J : K { + +} + +// CHECK: +// Mangled name: K +// Public signature: /K|null[0] +interface K { + +} + +// CHECK: +// Mangled name: #testFlexible1(){} +// Public signature: /testFlexible1|-251385018763070170[0] +fun testFlexible1(): Unit + +// CHECK: +// Mangled name: #testFlexible2(A;B){} +// Public signature: /testFlexible2|6106734588254663931[0] +fun testFlexible2(a: A, b: B): Unit + +// CHECK: +// Mangled name: #testIntersection(A;B){} +// Public signature: /testIntersection|-5543165898053334735[0] +fun testIntersection(a: A, b: B): Unit + diff --git a/compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.sig.kt.txt b/compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.sig.kt.txt new file mode 100644 index 00000000000..ecf09e82a84 --- /dev/null +++ b/compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.sig.kt.txt @@ -0,0 +1,177 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +open class A { + // CHECK: + // Mangled name: A{}aVal + // Public signature: /A.aVal|-4026160909590410018[0] + val aVal: Int + // CHECK JVM_IR: + // Mangled name: A#(){}kotlin.Int + // Public signature: /A.aVal.|-1703021672602726383[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#(){} + // Public signature: /A.aVal.|1133261762939420636[0] + get + + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: A#f(){}kotlin.Int + // Public signature: /A.f|-2854658745315648608[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#f(){} + // Public signature: /A.f|5316533450599009716[0] + fun f(): Int + + // CHECK JVM_IR: + // Mangled name: A#testA1(kotlin.Any){}kotlin.Int? + // Public signature: /A.testA1|2875421029417429294[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#testA1(kotlin.Any){} + // Public signature: /A.testA1|8315841731790135220[0] + fun testA1(x: Any): Int? + + // CHECK JVM_IR: + // Mangled name: A#testA2(kotlin.Any){}kotlin.Int? + // Public signature: /A.testA2|-4968448057047160096[0] + // CHECK JS_IR NATIVE: + // Mangled name: A#testA2(kotlin.Any){} + // Public signature: /A.testA2|7321153466955297562[0] + fun testA2(x: Any): Int? + +} + +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +class B : A { + // CHECK: + // Mangled name: B#(){} + // Public signature: /B.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: B#f(){}kotlin.Int + // Public signature: /B.f|-2854658745315648608[0] + // CHECK JS_IR NATIVE: + // Mangled name: B#f(){} + // Public signature: /B.f|5316533450599009716[0] + /* fake */ override fun f(): Int + + // CHECK JVM_IR: + // Mangled name: B#testA1(kotlin.Any){}kotlin.Int? + // Public signature: /B.testA1|2875421029417429294[0] + // CHECK JS_IR NATIVE: + // Mangled name: B#testA1(kotlin.Any){} + // Public signature: /B.testA1|8315841731790135220[0] + /* fake */ override fun testA1(x: Any): Int? + + // CHECK JVM_IR: + // Mangled name: B#testA2(kotlin.Any){}kotlin.Int? + // Public signature: /B.testA2|-4968448057047160096[0] + // CHECK JS_IR NATIVE: + // Mangled name: B#testA2(kotlin.Any){} + // Public signature: /B.testA2|7321153466955297562[0] + /* fake */ override fun testA2(x: Any): Int? + + // CHECK JVM_IR: + // Mangled name: B#testB1(kotlin.Any){}kotlin.Int? + // Public signature: /B.testB1|3289472249587789251[0] + // CHECK JS_IR NATIVE: + // Mangled name: B#testB1(kotlin.Any){} + // Public signature: /B.testB1|-8016237152028222856[0] + fun testB1(x: Any): Int? + + // CHECK JVM_IR: + // Mangled name: B#testB2(kotlin.Any){}kotlin.Int? + // Public signature: /B.testB2|-6423506669184631110[0] + // CHECK JS_IR NATIVE: + // Mangled name: B#testB2(kotlin.Any){} + // Public signature: /B.testB2|-6848848121088735860[0] + fun testB2(x: Any): Int? + + // CHECK: + // Mangled name: B{}aVal + // Public signature: /B.aVal|-4026160909590410018[0] + /* fake */ override val aVal: Int + // CHECK JVM_IR: + // Mangled name: B#(){}kotlin.Int + // Public signature: /B.aVal.|-1703021672602726383[0] + // CHECK JS_IR NATIVE: + // Mangled name: B#(){} + // Public signature: /B.aVal.|1133261762939420636[0] + /* fake */ override get(): Int + +} + +// CHECK: +// Mangled name: GA +// Public signature: /GA|null[0] +open class GA { + // CHECK: + // Mangled name: GA{}aVal + // Public signature: /GA.aVal|-4026160909590410018[0] + val aVal: Int + // CHECK JVM_IR: + // Mangled name: GA#(){}kotlin.Int + // Public signature: /GA.aVal.|-1703021672602726383[0] + // CHECK JS_IR NATIVE: + // Mangled name: GA#(){} + // Public signature: /GA.aVal.|1133261762939420636[0] + get + + // CHECK: + // Mangled name: GA#(){} + // Public signature: /GA.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: GA#f(){}kotlin.Int + // Public signature: /GA.f|-2854658745315648608[0] + // CHECK JS_IR NATIVE: + // Mangled name: GA#f(){} + // Public signature: /GA.f|5316533450599009716[0] + fun f(): Int + +} + +// CHECK: +// Mangled name: GB +// Public signature: /GB|null[0] +class GB : GA { + // CHECK: + // Mangled name: GB#(){} + // Public signature: /GB.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: GB#f(){}kotlin.Int + // Public signature: /GB.f|-2854658745315648608[0] + // CHECK JS_IR NATIVE: + // Mangled name: GB#f(){} + // Public signature: /GB.f|5316533450599009716[0] + /* fake */ override fun f(): Int + + // CHECK: + // Mangled name: GB#testGB1(kotlin.Any){} + // Public signature: /GB.testGB1|-7751162722819007112[0] + fun testGB1(a: Any): Unit + + // CHECK: + // Mangled name: GB{}aVal + // Public signature: /GB.aVal|-4026160909590410018[0] + /* fake */ override val aVal: Int + // CHECK JVM_IR: + // Mangled name: GB#(){}kotlin.Int + // Public signature: /GB.aVal.|-1703021672602726383[0] + // CHECK JS_IR NATIVE: + // Mangled name: GB#(){} + // Public signature: /GB.aVal.|1133261762939420636[0] + /* fake */ override get(): Int + +} + diff --git a/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.sig.kt.txt b/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.sig.kt.txt new file mode 100644 index 00000000000..87302bb9df1 --- /dev/null +++ b/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.sig.kt.txt @@ -0,0 +1,10 @@ +// CHECK JVM_IR: +// Mangled name: #testGetField(kotlin.Any){}kotlin.String +// Public signature: /testGetField|1503752848353622726[0] +fun testGetField(a: Any): String + +// CHECK: +// Mangled name: #testSetField(kotlin.Any;kotlin.Any){} +// Public signature: /testSetField|-8372089981302935899[0] +fun testSetField(a: Any, b: Any): Unit + diff --git a/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.kt b/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.kt index 8638ac47750..71b87d1dcb6 100644 --- a/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.kt +++ b/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.kt @@ -1,4 +1,8 @@ // FIR_IDENTICAL + +// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR +// ^ KT-57429 + fun testFunction(a: Any, b: Any) { a as MutableList b as String diff --git a/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.sig.kt.txt b/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.sig.kt.txt new file mode 100644 index 00000000000..e2b7546a560 --- /dev/null +++ b/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.sig.kt.txt @@ -0,0 +1,74 @@ +// CHECK: +// Mangled name: Cell +// Public signature: /Cell|null[0] +class Cell { + // CHECK: + // Mangled name: Cell{}value + // Public signature: /Cell.value|1987073854177347439[0] + var value: T + // CHECK JVM_IR: + // Mangled name: Cell#(){}1:0 + // Public signature: /Cell.value.|3167862337988859752[0] + // CHECK JS_IR NATIVE: + // Mangled name: Cell#(){} + // Public signature: /Cell.value.|3260093555963109437[0] + get + // CHECK: + // Mangled name: Cell#(1:0){} + // Public signature: /Cell.value.|-5529925203468114125[0] + set + + // CHECK: + // Mangled name: Cell#(1:0){} + // Public signature: /Cell.|-8731461708390519279[0] + constructor(value: T) /* primary */ + +} + +// CHECK: +// Mangled name: Outer +// Public signature: /Outer|null[0] +class Outer { + // CHECK: + // Mangled name: Outer.Inner + // Public signature: /Outer.Inner|null[0] + inner class Inner { + // CHECK: + // Mangled name: Outer.Inner#(){} + // Public signature: /Outer.Inner.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK: + // Mangled name: Outer.Inner#use(2:0;1:0){} + // Public signature: /Outer.Inner.use|-2113682455784255522[0] + fun use(x1: T1, x2: T2): Unit + + } + + // CHECK: + // Mangled name: Outer#(){} + // Public signature: /Outer.|-5645683436151566731[0] + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: #testFunction(kotlin.Any;kotlin.Any){} +// Public signature: /testFunction|1721354410514870848[0] +fun testFunction(a: Any, b: Any): Unit + +// CHECK: +// Mangled name: #testInnerClass(kotlin.Any;kotlin.Any;kotlin.Any){} +// Public signature: /testInnerClass|-18420625986104617[0] +fun testInnerClass(a: Any, b: Any, c: Any): Unit + +// CHECK: +// Mangled name: #testNonSubstitutedTypeParameter(kotlin.Any;kotlin.Any){0§} +// Public signature: /testNonSubstitutedTypeParameter|-8973853282846964778[0] +fun testNonSubstitutedTypeParameter(a: Any, b: Any): Unit + +// CHECK: +// Mangled name: #testProperty(kotlin.Any;kotlin.Any){} +// Public signature: /testProperty|7115185479066573300[0] +fun testProperty(a: Any, b: Any): Unit + diff --git a/compiler/testData/ir/irText/types/starProjection.sig.kt.txt b/compiler/testData/ir/irText/types/starProjection.sig.kt.txt new file mode 100644 index 00000000000..4f9cadb0a41 --- /dev/null +++ b/compiler/testData/ir/irText/types/starProjection.sig.kt.txt @@ -0,0 +1,26 @@ +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +abstract class C { + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: C#dispatchResumeWithException(kotlin.Throwable;Continuation<*>){}kotlin.Boolean + // Public signature: /C.dispatchResumeWithException|4528907504622041214[0] + // CHECK JS_IR NATIVE: + // Mangled name: C#dispatchResumeWithException(kotlin.Throwable;Continuation<*>){} + // Public signature: /C.dispatchResumeWithException|-2529565672521727710[0] + abstract fun dispatchResumeWithException(exception: Throwable, continuation: Continuation<*>): Boolean + +} + +// CHECK: +// Mangled name: Continuation +// Public signature: /Continuation|null[0] +interface Continuation { + +} + diff --git a/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.kt b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.kt index d7c7b42ccf7..838019cd272 100644 --- a/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.kt +++ b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.kt @@ -1,6 +1,9 @@ // KT-42036 // IGNORE_BACKEND: JS_IR +// MUTE_SIGNATURE_COMPARISON_K2: ANY +// ^ KT-57429 + typealias Action = (@UnsafeVariance RenderingT) -> Unit data class Tag(val action: Action) diff --git a/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.sig.kt.txt b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.sig.kt.txt new file mode 100644 index 00000000000..1a145fadb57 --- /dev/null +++ b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.sig.kt.txt @@ -0,0 +1,79 @@ +// CHECK: +// Mangled name: Tag +// Public signature: /Tag|null[0] +data class Tag { + // CHECK: + // Mangled name: Tag{}action + // Public signature: /Tag.action|4099104176676099950[0] + val action: Function1 + // CHECK JVM_IR: + // Mangled name: Tag#(){}kotlin.Function1<1:0,kotlin.Unit> + // Public signature: /Tag.action.|8009562688035104366[0] + // CHECK JS_IR NATIVE: + // Mangled name: Tag#(){} + // Public signature: /Tag.action.|-746708740124539440[0] + get + + // CHECK: + // Mangled name: Tag#(kotlin.Function1<1:0,kotlin.Unit>){} + // Public signature: /Tag.|5347267751589030160[0] + constructor(action: Function1) /* primary */ + // CHECK JVM_IR: + // Mangled name: Tag#component1(){}kotlin.Function1<1:0,kotlin.Unit> + // Public signature: /Tag.component1|8111540572719988721[0] + // CHECK JS_IR NATIVE: + // Mangled name: Tag#component1(){} + // Public signature: /Tag.component1|162597135895221648[0] + operator fun component1(): Function1 + + // CHECK JVM_IR: + // Mangled name: Tag#copy(kotlin.Function1<1:0,kotlin.Unit>){}Tag<1:0> + // Public signature: /Tag.copy|3977576146240089732[0] + // CHECK JS_IR NATIVE: + // Mangled name: Tag#copy(kotlin.Function1<1:0,kotlin.Unit>){} + // Public signature: /Tag.copy|-2212065741790204544[0] + fun copy(action: Function1): Tag + + // CHECK JVM_IR: + // Mangled name: Tag#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Tag.equals|722809408929142791[0] + // CHECK JS_IR NATIVE: + // Mangled name: Tag#equals(kotlin.Any?){} + // Public signature: /Tag.equals|4638265728071529943[0] + override operator fun equals(other: Any?): Boolean + + // CHECK JVM_IR: + // Mangled name: Tag#hashCode(){}kotlin.Int + // Public signature: /Tag.hashCode|-8048879360829830756[0] + // CHECK JS_IR NATIVE: + // Mangled name: Tag#hashCode(){} + // Public signature: /Tag.hashCode|3409210261493131192[0] + override fun hashCode(): Int + + // CHECK JVM_IR: + // Mangled name: Tag#toString(){}kotlin.String + // Public signature: /Tag.toString|6958853723545266802[0] + // CHECK JS_IR NATIVE: + // Mangled name: Tag#toString(){} + // Public signature: /Tag.toString|-1522858123163872138[0] + override fun toString(): String + +} + +// CHECK: +// Mangled name: #doAction(){} +// Public signature: /doAction|7630529100125907322[0] +fun doAction(): Unit + +// CHECK JVM_IR: +// Mangled name: #getTag(){}Tag<*> +// Public signature: /getTag|-5296435485745699550[0] +// CHECK JS_IR NATIVE: +// Mangled name: #getTag(){} +// Public signature: /getTag|-1598249619396187222[0] +fun getTag(): Tag<*> + +// CHECK: +// Mangled name: Action +// Public signature: /Action|null[0] +typealias Action = Function1 diff --git a/compiler/testData/ir/irText/types/typeCheckOnDefinitelyNotNull.sig.kt.txt b/compiler/testData/ir/irText/types/typeCheckOnDefinitelyNotNull.sig.kt.txt new file mode 100644 index 00000000000..0b216ca5948 --- /dev/null +++ b/compiler/testData/ir/irText/types/typeCheckOnDefinitelyNotNull.sig.kt.txt @@ -0,0 +1,24 @@ +// CHECK JVM_IR: +// Mangled name: #asFoo(0:0){0§}0:0 +// Public signature: /asFoo|443034924888332617[0] +// CHECK JS_IR NATIVE: +// Mangled name: #asFoo(0:0){0§} +// Public signature: /asFoo|4722089382470966383[0] +fun asFoo(t: T): (T & Any) + +// CHECK JVM_IR: +// Mangled name: #implicitAsFoo(kotlin.Any){0§}kotlin.Int +// Public signature: /implicitAsFoo|4739175697127707782[0] +// CHECK JS_IR NATIVE: +// Mangled name: #implicitAsFoo(kotlin.Any){0§} +// Public signature: /implicitAsFoo|3965996438260583195[0] +inline fun implicitAsFoo(x: Any): Int + +// CHECK JVM_IR: +// Mangled name: #safeAsFoo(0:0){0§}0:0? +// Public signature: /safeAsFoo|8056934357621197545[0] +// CHECK JS_IR NATIVE: +// Mangled name: #safeAsFoo(0:0){0§} +// Public signature: /safeAsFoo|5988285743365042743[0] +fun safeAsFoo(t: T): T? + diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrMangledNameAndSignatureDumpHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrMangledNameAndSignatureDumpHandler.kt new file mode 100644 index 00000000000..dfc90b9f100 --- /dev/null +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrMangledNameAndSignatureDumpHandler.kt @@ -0,0 +1,516 @@ +/* + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.test.backend.handlers + +import com.intellij.rt.execution.junit.FileComparisonFailure +import org.jetbrains.kotlin.backend.common.lower.parents +import org.jetbrains.kotlin.backend.jvm.JvmSymbols +import org.jetbrains.kotlin.backend.jvm.ir.hasPlatformDependent +import org.jetbrains.kotlin.builtins.StandardNames +import org.jetbrains.kotlin.descriptors.DescriptorVisibilities +import org.jetbrains.kotlin.fir.backend.FirMetadataSource +import org.jetbrains.kotlin.fir.signaturer.FirMangler +import org.jetbrains.kotlin.ir.IrBuiltIns +import org.jetbrains.kotlin.ir.IrElement +import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI +import org.jetbrains.kotlin.ir.backend.js.utils.isEqualsInheritedFromAny +import org.jetbrains.kotlin.ir.declarations.* +import org.jetbrains.kotlin.ir.expressions.IrConstructorCall +import org.jetbrains.kotlin.ir.interpreter.intrinsicConstEvaluationAnnotation +import org.jetbrains.kotlin.ir.types.classOrNull +import org.jetbrains.kotlin.ir.types.isUnit +import org.jetbrains.kotlin.ir.util.* +import org.jetbrains.kotlin.load.java.JvmAnnotationNames +import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.name.StandardClassIds +import org.jetbrains.kotlin.test.TargetBackend +import org.jetbrains.kotlin.test.backend.codegenSuppressionChecker +import org.jetbrains.kotlin.test.backend.ir.IrBackendInput +import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.DUMP_LOCAL_DECLARATION_SIGNATURES +import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.DUMP_SIGNATURES +import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.MUTE_SIGNATURE_COMPARISON_K2 +import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.SKIP_SIGNATURE_DUMP +import org.jetbrains.kotlin.test.model.FrontendKinds +import org.jetbrains.kotlin.test.model.TestModule +import org.jetbrains.kotlin.test.services.TestServices +import org.jetbrains.kotlin.test.services.defaultsProvider +import org.jetbrains.kotlin.test.services.moduleStructure +import org.jetbrains.kotlin.test.utils.MultiModuleInfoDumper +import org.jetbrains.kotlin.test.utils.withExtension +import org.jetbrains.kotlin.utils.Printer +import org.jetbrains.kotlin.utils.addToStdlib.same +import java.io.File +import java.io.FileNotFoundException + +private const val CHECK_MARKER = "// CHECK" + +/** + * Prints a mangled name and an [IdSignature] for each declaration and compares the result with + * an expected output in a `*.sig.kt.txt` file located next to the test file. + * + * Can be enabled by specifying the [DUMP_SIGNATURES] directive, and disabled with the [SKIP_SIGNATURE_DUMP] test directive. + * + * Other useful directives: + * - [MUTE_SIGNATURE_COMPARISON_K2] can be used for muting the comparison result on the K2 frontend. The comparison will + * still be performed, and if it succeeds, the test will fail with a message reminding you to unmute it. + * - [DUMP_LOCAL_DECLARATION_SIGNATURES] enables printing signatures for local functions and classes. + * + * Since mangled names and signatures may be different depending on the backend, in order to reduce the number + * of expectation files, this handler uses `// CHECK` blocks to compare the dump with an expectation in a smarter way than + * just character by character. + * + * For example, the expectation file may look like this: + * + * ```kotlin + * // CHECK JVM_IR: + * // Mangled name: #test(){}kotlin.Int + * // Public signature: /test|4216975235718029399[0] + * // CHECK JS_IR NATIVE: + * // Mangled name: #test(){} + * // Public signature: /test|6620506149988718649[0] + * fun test(): Int + * ``` + * + * Here, on the JVM backend the mangled names include the return value, while on the JS and Native backends + * this is not the case, so we use two `// CHECK` blocks to reflect that fact. + * + * When running a test against some backend, we do the following. + * + * 1. In order to compare this expectation with the actual output, we first parse all the `// CHECK` block groups in + * the `*.sig.kt.txt` file. + * + * 2. While dumping the declarations, for each declaration that we want to print the mangled name and + * the signature for, we take the next parsed group, and iterate over `// CHECK` blocks in that group. + * + * 3. For each parsed `// CHECK` block the following logic is applied: + * - If the current `// CHECK` block includes the backend that we're running this test against, or doesn't include + * any backends, we print the actual mangled name and signature for this declaration. + * - Otherwise, we print the parsed `// CHECK` block as is. + */ +class IrMangledNameAndSignatureDumpHandler(testServices: TestServices) : AbstractIrHandler(testServices) { + + companion object { + const val DUMP_EXTENSION = "sig.kt.txt" + } + + private val dumper = MultiModuleInfoDumper("// MODULE: %s") + + /** + * The file that stores the expected signatures of the test file. + */ + private val expectedFile: File by lazy { + testServices.moduleStructure.originalTestDataFiles.first().withExtension(DUMP_EXTENSION) + } + + /** + * Iterates over parsed `// CHECK` block groups in [expectedFile]. + * + * Each element is a list of `// CHECK` blocks for a single declaration. + */ + private val checkBlockGroupIterator: Iterator by lazy { + try { + parseAllCheckBlocks(expectedFile.readText()) + } catch (e: FileNotFoundException) { + emptyList() + }.iterator() + } + + override fun processModule(module: TestModule, info: IrBackendInput) { + if (DUMP_SIGNATURES !in module.directives || SKIP_SIGNATURE_DUMP in module.directives) return + + dumpModuleKotlinLike( + module, + testServices.moduleStructure.modules, + info, + dumper, + KotlinLikeDumpOptions( + customDumpStrategy = DumpStrategy( + module, + info.irMangler, + info.descriptorMangler, + info.firMangler, + info.irModuleFragment.irBuiltins, + ), + printFilePath = false, + printFakeOverridesStrategy = FakeOverridesStrategy.ALL_EXCEPT_ANY, + bodyPrintingStrategy = if (DUMP_LOCAL_DECLARATION_SIGNATURES in module.directives) + BodyPrintingStrategy.PRINT_ONLY_LOCAL_CLASSES_AND_FUNCTIONS + else + BodyPrintingStrategy.NO_BODIES, + printUnitReturnType = true, + stableOrder = true, + ), + ) + } + + override fun processAfterAllModules(someAssertionWasFailed: Boolean) { + if (dumper.isEmpty()) return + val frontendKind = testServices.defaultsProvider.defaultFrontend + val muteDirectives = listOfNotNull( + MUTE_SIGNATURE_COMPARISON_K2.takeIf { frontendKind == FrontendKinds.FIR }, + ) + testServices.codegenSuppressionChecker.checkMuted(muteDirectives) { + assertions.assertEqualsToFile(expectedFile, dumper.generateResultingDump()) + } + } + + private inner class DumpStrategy( + val module: TestModule, + val irMangler: KotlinMangler.IrMangler, + val descriptorMangler: KotlinMangler.DescriptorMangler, + val firMangler: FirMangler?, + val irBuiltIns: IrBuiltIns, + ) : CustomKotlinLikeDumpStrategy { + + private val targetBackend: TargetBackend + get() = module.targetBackend!! + + private val IrDeclaration.isFunctionWithNonUnitReturnType: Boolean + get() = this is IrSimpleFunction && !returnType.isUnit() + + private val IrDeclaration.isMainFunction: Boolean + get() = isTopLevel && this is IrSimpleFunction && name.asString() == "main" + + private val IrDeclaration.potentiallyHasDifferentMangledNamesDependingOnBackend: Boolean + get() = isMainFunction || + isFunctionWithNonUnitReturnType || + parent.let { it is IrDeclaration && it.potentiallyHasDifferentMangledNamesDependingOnBackend } + + private fun IrSimpleFunction.isHiddenEnumMethod() = allOverridden(includeSelf = true).any { + it.dispatchReceiverParameter?.type?.classOrNull == irBuiltIns.enumClass && it.name in HIDDEN_ENUM_METHOD_NAMES + } + + @OptIn(ObsoleteDescriptorBasedAPI::class) + private fun Printer.printSignatureAndMangledName(declaration: IrDeclaration) { + + val symbol = declaration.symbol + + val computedMangledNames = mutableListOf() + + irMangler.addMangledNameTo(computedMangledNames, declaration) + descriptorMangler.addMangledNameTo(computedMangledNames, symbol.descriptor) + ((declaration as? IrMetadataSourceOwner)?.metadata as? FirMetadataSource)?.fir?.let { + firMangler?.addMangledNameTo( + computedMangledNames, + it + ) + } + + fun printActualMangledNamesAndSignatures() { + printMangledNames(computedMangledNames) + + symbol.signature?.let { + println("// Public signature: ${it.render()}") + } + symbol.privateSignature?.let { + println("// Private signature: ${it.render()}") + } + } + + var printedActualMangledNameAndSignature = false + if (checkBlockGroupIterator.hasNext()) { + val checkBlockGroupForDeclaration = checkBlockGroupIterator.next() + for (checkBlock in checkBlockGroupForDeclaration) { + printlnCheckMarker(checkBlock.backends) + if (checkBlock.backends.isEmpty() || TargetBackend.ANY in checkBlock.backends || targetBackend in checkBlock.backends) { + // If this // CHECK block corresponds to the current target backend, print the actual values + printActualMangledNamesAndSignatures() + printedActualMangledNameAndSignature = true + } else { + // Otherwise, print the // CHECK block from the expectation file as is + checkBlock.expectations.forEach(this::println) + } + } + if (!printedActualMangledNameAndSignature) { + printlnCheckMarker(listOf(targetBackend)) + printActualMangledNamesAndSignatures() + } + } else { + if (declaration.potentiallyHasDifferentMangledNamesDependingOnBackend) { + // This is a heuristic to print `// CHECK :` instead of just `// CHECK:` for new declarations + // for which the difference between backend-specific manglers is known to take place. + // This is purely for convenience when adding a new test. + printlnCheckMarker(listOf(targetBackend)) + } else { + printlnCheckMarker(emptyList()) + } + printActualMangledNamesAndSignatures() + } + } + + override fun willPrintElement(element: IrElement, container: IrDeclaration?, printer: Printer): Boolean { + if (element !is IrDeclaration) return true + if (element is IrAnonymousInitializer) return false + + // Don't print fake overrides of Java fields + if (element is IrProperty && + element.isFakeOverride && + element + .collectRealOverrides() + .all { it.origin == IrDeclarationOrigin.IR_EXTERNAL_JAVA_DECLARATION_STUB && it.backingField != null } + ) { + return false + } + + // Don't print certain fake overrides coming from Java classes + if (element is IrSimpleFunction && + element.isFakeOverride && + (element.isStatic || element.hasPlatformDependent() || element.isHiddenEnumMethod()) + ) { + return false + } + + printer.printSignatureAndMangledName(element) + + return true + } + + override fun shouldPrintAnnotation(annotation: IrConstructorCall, container: IrAnnotationContainer): Boolean = + annotation.symbol.owner.constructedClass.kotlinFqName !in EXCLUDED_ANNOTATIONS + + override fun transformModifiersForDeclaration( + declaration: IrDeclaration, + modifiers: CustomKotlinLikeDumpStrategy.Modifiers + ) = modifiers.copy( + // Inner classes inside enum entries have local visibility on K2, but not on K1. Unify. + visibility = if (declaration is IrClass && declaration.isInner && declaration.parent.let { it is IrClass && it.isEnumEntry }) { + DescriptorVisibilities.LOCAL + } else modifiers.visibility, + // K2 doesn't always print 'external' modifier, unlike K1. Unify. + isExternal = if (declaration is IrPossiblyExternalDeclaration) { + declaration.isExternal || declaration.parents.any { it is IrPossiblyExternalDeclaration && it.isExternal } + } else modifiers.isExternal, + ) + } +} + +/** + * The annotations that are known not to affect signature computation but that may be generated inconsistently on K1 and K2. + */ +private val EXCLUDED_ANNOTATIONS = setOf( + StandardNames.FqNames.deprecated, + StandardNames.FqNames.unsafeVariance, + StandardNames.FqNames.suppress, + StandardNames.FqNames.parameterName, + JvmSymbols.FLEXIBLE_MUTABILITY_ANNOTATION_FQ_NAME, + JvmSymbols.FLEXIBLE_NULLABILITY_ANNOTATION_FQ_NAME, + JvmSymbols.RAW_TYPE_ANNOTATION_FQ_NAME, + StandardClassIds.Annotations.ContextFunctionTypeParams.asSingleFqName(), + JvmAnnotationNames.JETBRAINS_NOT_NULL_ANNOTATION, + JvmAnnotationNames.JETBRAINS_NULLABLE_ANNOTATION, + intrinsicConstEvaluationAnnotation, +) + +private val HIDDEN_ENUM_METHOD_NAMES = setOf(Name.identifier("finalize"), Name.identifier("getDeclaringClass")) + +private data class ComputedMangledName( + val manglerName: String, + val compatibleMode: Boolean, + val value: String, +) + +/** + * For each pair in the list, pads its first element with a number of spaces and concatenates it with the second element in such a way + * that the second elements of each pair are vertically aligned in concatenated strings. + * + * In other words, transforms this list: + * + * ```kotlin + * listOf( + * Pair("Capacity: ", "normal"), + * Pair("Usability: ", "very good"), + * Pair("Magic: ", "minimal"), + * ) + * ``` + * + * to this: + * + * ```kotlin + * listOf( + * "Capacity: normal", + * "Usability: very good", + * "Magic: minimal", + * ) + * ``` + */ +private fun Iterable>.aligned(): List { + val maxPrefixLength = maxOf { it.first.length } + return map { (prefix, suffix) -> prefix.padEnd(maxPrefixLength) + suffix } +} + +private inline fun Iterable.printAligned(printer: Printer, prefix: (ComputedMangledName) -> String) { + map { prefix(it) to it.value }.aligned().forEach(printer::println) +} + +private fun Printer.printMangledNames(computedMangledNames: List) { + val distinctNames = computedMangledNames.distinctBy { it.value } + + // If mangled names computed from all three representations (descriptors, IR, FIR) and modes match, + // print just one mangled name. + distinctNames.singleOrNull()?.let { + println("// Mangled name: ${it.value}") + return + } + + if (distinctNames.same { it.compatibleMode }) { + // If the mangled names differ only by the mangler used (but not the compatibility mode), print + // only mangled names from each mangler. + computedMangledNames + .distinctBy { it.manglerName } + .printAligned(this) { "// Mangled name computed from ${it.manglerName}: " } + } else if (distinctNames.same { it.manglerName }) { + // If the mangled names differ only by the compatibility mode used (but not the mangler), print + // only mangled names for each compatibility mode. + computedMangledNames + .distinctBy { it.compatibleMode } + .printAligned(this) { "// Mangled name (compatible mode: ${it.compatibleMode}): " } + } else { + // Otherwise, print the whole matrix. + computedMangledNames + .printAligned(this) { "// Mangled name computed from ${it.manglerName} (compatible mode: ${it.compatibleMode}): " } + } +} + +private fun Printer.printlnCheckMarker(backends: List) { + print(CHECK_MARKER) + for (backend in backends) { + printWithNoIndent(" ") + printWithNoIndent(backend.name) + } + printlnWithNoIndent(":") +} + +private fun > Mangler.addMangledNameTo( + collector: MutableList, + declaration: Declaration +) { + listOf(false, true).mapTo(collector) { compatibleMode -> + val mangledName = try { + declaration.mangleString(compatibleMode) + } catch (e: Throwable) { + // Kotlin-like IR renderer suppresses exceptions thrown during rendering, which leads to missing renders that are hard to debug. + // Because this routine is executed during rendering, we print the exception description instead of a proper mangled name. + val message = e.toString() + buildString { + append("could not compute mangled name: ") + when (val newlineIndex = message.indexOf('\n')) { + -1 -> append(message) + else -> { + append(message.substring(0, newlineIndex)) + append("... (truncated)") + } + } + } + } + ComputedMangledName(manglerName, compatibleMode, mangledName) + } +} + +/** + * Represents a single `// CHECK` block. + * + * @property backends The backends this `// CHECK` block is for. + * @property expectations The list of expectation lines in this `// CHECK` block. + */ +private data class CheckBlock(val backends: List, val expectations: List) + +/** + * A list of `// CHECK` blocks for a single declaration. + */ +private typealias CheckBlockGroup = List + +private fun parseAllCheckBlocks(input: String): List { + val result = mutableListOf() + val lineIterator = input.lines().iterator() + + var currentCheckBlockGroup = mutableListOf() // CHECK blocks for a single declaration + + var line = if (lineIterator.hasNext()) lineIterator.next() else return emptyList() + + while (true) { + val trimmed = line.trim() + if (trimmed.startsWith(CHECK_MARKER)) { + val (nextCheckMarker, checkBlock) = parseSingleCheckBlock(trimmed, lineIterator) + currentCheckBlockGroup.add(checkBlock) + if (nextCheckMarker != null) { + line = nextCheckMarker + continue + } + + result.add(currentCheckBlockGroup) + } + if (lineIterator.hasNext()) { + line = lineIterator.next() + currentCheckBlockGroup = mutableListOf() + } else { + break + } + } + return result +} + +private val whitespaceRegex = "\\s+".toRegex() + +/** + * Parses a single check block. + * + * The valid `// CHECK` block is multiline string that starts with the `// CHECK` comment optionally followed by a whitespace-separated list + * of [TargetBackend] names, and ending with a colon. After that, an arbitrary number of single-line comments may follow. The `// CHECK` block + * ends with the first non-comment line. + * + * For example, this text + * ```kotlin + * // CHECK JS_IR NATIVE: + * // Mangled name: #test(){} + * // Public signature: /test|6620506149988718649[0] + * fun test(): Int { + * return 42 + * } + * ``` + * will be parsed into: + * ```kotlin + * CheckBlock( + * backends = listOf(TargetBackend.JS_IR, TargetBackend.NATIVE), + * expectations = listOf( + * "// Mangled name: #test(){}", + * "// Public signature: /test|6620506149988718649[0]" + * ) + * ) + * ``` + * + * @param trimmedCheckLine The line that starts with `// CHECK *:` + * @param lineIterator The iterator over lines in the expectation file. + * @return The line representing the beginning of the next `// CHECK` block (if there is one), and the parsed `// CHECK` block. + */ +private fun parseSingleCheckBlock(trimmedCheckLine: String, lineIterator: Iterator): Pair { + assert(trimmedCheckLine.startsWith(CHECK_MARKER)) + val colonIndex = trimmedCheckLine.indexOf(':') + if (colonIndex < 0) { + error("Expected colon after '$CHECK_MARKER' in '$trimmedCheckLine'") + } + val backends = trimmedCheckLine + .substring(CHECK_MARKER.length, colonIndex) + .splitToSequence(whitespaceRegex) + .filter { it.isNotEmpty() } + .map { enumValueOf(it) } + .toList() + val expectations = mutableListOf() + for (line in lineIterator) { + val trimmed = line.trim() + if (trimmed.startsWith(CHECK_MARKER)) { + // Encountered the next // CHECK block + return trimmed to CheckBlock(backends, expectations) + } + if (trimmed.startsWith("//")) { + expectations.add(trimmed) + } else { + // The // CHECK block has ended, no more // CHECK blocks ahead in this group. + break + } + } + // Either we have no more lines, or the next line is not valid beginning of a `// CHECK` block. + return null to CheckBlock(backends, expectations) +} diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrPrettyKotlinDumpHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrPrettyKotlinDumpHandler.kt index ac9dd3a8a8c..13cc46b2d88 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrPrettyKotlinDumpHandler.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/IrPrettyKotlinDumpHandler.kt @@ -23,6 +23,13 @@ import org.jetbrains.kotlin.test.services.moduleStructure import org.jetbrains.kotlin.test.utils.MultiModuleInfoDumper import org.jetbrains.kotlin.test.utils.withExtension +/** + * Uses [dumpKotlinLike] to compare the human-readable representation of an IR tree with + * an expected output in a `*.kt.txt` file located next to the test file. + * + * This handler can be enabled by specifying the [DUMP_KT_IR] test directive, + * or disabled with the [SKIP_KT_DUMP] directive. + */ class IrPrettyKotlinDumpHandler(testServices: TestServices) : AbstractIrHandler(testServices) { companion object { const val DUMP_EXTENSION = "kt.txt" @@ -35,25 +42,13 @@ class IrPrettyKotlinDumpHandler(testServices: TestServices) : AbstractIrHandler( override fun processModule(module: TestModule, info: IrBackendInput) { if (DUMP_KT_IR !in module.directives || SKIP_KT_DUMP in module.directives) return - - info.processAllIrModuleFragments(module) { irModuleFragment, moduleName -> - val irFiles = irModuleFragment.files - val builder = dumper.builderForModule(moduleName) - val filteredIrFiles = irFiles.groupWithTestFiles(module).filterNot { - it.first?.directives?.contains(EXTERNAL_FILE) == true - }.map { it.second } - val printFileName = filteredIrFiles.size > 1 || testServices.moduleStructure.modules.size > 1 - for (irFile in filteredIrFiles) { - val dump = irFile.dumpKotlinLike( - KotlinLikeDumpOptions( - printFileName = printFileName, - printFilePath = false, - printFakeOverridesStrategy = FakeOverridesStrategy.NONE - ) - ) - builder.append(dump) - } - } + dumpModuleKotlinLike( + module, testServices.moduleStructure.modules, info, dumper, + KotlinLikeDumpOptions( + printFilePath = false, + printFakeOverridesStrategy = FakeOverridesStrategy.NONE, + ), + ) } override fun processAfterAllModules(someAssertionWasFailed: Boolean) { @@ -64,3 +59,24 @@ class IrPrettyKotlinDumpHandler(testServices: TestServices) : AbstractIrHandler( assertions.assertEqualsToFile(expectedFile, dumper.generateResultingDump()) } } + +internal fun dumpModuleKotlinLike( + module: TestModule, + allModules: List, + info: IrBackendInput, + multiModuleInfoDumper: MultiModuleInfoDumper, + options: KotlinLikeDumpOptions, +) { + info.processAllIrModuleFragments(module) { irModuleFragment, moduleName -> + val irFiles = irModuleFragment.files + val builder = multiModuleInfoDumper.builderForModule(moduleName) + val filteredIrFiles = irFiles.groupWithTestFiles(module).filterNot { + it.first?.directives?.contains(EXTERNAL_FILE) == true + }.map { it.second } + val printFileName = filteredIrFiles.size > 1 || allModules.size > 1 + val modifiedOptions = options.copy(printFileName = printFileName) + for (irFile in filteredIrFiles) { + builder.append(irFile.dumpKotlinLike(modifiedOptions)) + } + } +} diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/CodegenTestDirectives.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/CodegenTestDirectives.kt index a64f9713752..564a4c05cb8 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/CodegenTestDirectives.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/CodegenTestDirectives.kt @@ -158,6 +158,25 @@ object CodegenTestDirectives : SimpleDirectivesContainer() { description = "Skips check pretty kt IR dump (disables ${IrPrettyKotlinDumpHandler::class})" ) + val DUMP_SIGNATURES by directive( + description = """ + Like $DUMP_KT_IR, but does not dump function bodies, and prints a rendered binary signature and a mangled name for each declaration + (enables ${IrMangledNameAndSignatureDumpHandler::class}) + """.trimIndent() + ) + + val DUMP_LOCAL_DECLARATION_SIGNATURES by directive( + description = "For tests with $DUMP_SIGNATURES, also dumps signatures and mangled names for local functions and classes" + ) + + val SKIP_SIGNATURE_DUMP by directive( + description = "Disables dumping signatures and mangled names of declarations to the ${IrMangledNameAndSignatureDumpHandler.DUMP_EXTENSION} file" + ) + + val MUTE_SIGNATURE_COMPARISON_K2 by enumDirective( + description = "Ignores failures of signature dump comparison for tests with the $DUMP_SIGNATURES directive if the test uses the K2 frontend and the specified backend." + ) + val DUMP_IR_FOR_GIVEN_PHASES by valueDirective( description = "Dumps backend IR after given lowerings (enables ${PhasedIrDumpHandler::class})", parser = { error("Cannot parse value $it for \"DUMP_IR_FOR_GIVEN_PHASES\" directive. All arguments must be specified via code in test system") } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/ir/AbstractIrTextTest.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/ir/AbstractIrTextTest.kt index 9b4760f2acc..8e1f9d5fc93 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/ir/AbstractIrTextTest.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/ir/AbstractIrTextTest.kt @@ -18,7 +18,9 @@ import org.jetbrains.kotlin.test.builders.irHandlersStep import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.DUMP_IR import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.DUMP_KT_IR import org.jetbrains.kotlin.test.FirParser +import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.DUMP_SIGNATURES import org.jetbrains.kotlin.test.directives.LanguageSettingsDirectives +import org.jetbrains.kotlin.test.directives.LanguageSettingsDirectives.LINK_VIA_SIGNATURES import org.jetbrains.kotlin.test.directives.configureFirParser import org.jetbrains.kotlin.test.model.* import org.jetbrains.kotlin.test.runners.AbstractKotlinCompilerWithTargetBackendTest @@ -48,6 +50,8 @@ abstract class AbstractIrTextTest