From 2423b7b62f7af81a0d21df6382321c4724e3ac7e Mon Sep 17 00:00:00 2001 From: strangepleasures Date: Mon, 31 Jul 2023 23:09:08 +0200 Subject: [PATCH] [KAPT4] KT-51982 Implement generation of @Metadata annotations in Java stubs Also adds rendering of @Metadata annotations in Kapt3 and Kapt4 tests (currently disabled for a few tests). Co-authored-by: Alexander Udalov --- .../api/descriptors/KtFe10AnalysisSession.kt | 6 +- analysis/analysis-api-fir/build.gradle.kts | 2 + .../analysis/api/fir/KtFirAnalysisSession.kt | 7 +- .../fir/components/KtFirMetadataCalculator.kt | 206 +++++++++++++ .../kotlin/analysis/api/KtAnalysisSession.kt | 9 +- .../kotlin/analysis/api/annnotations.kt | 3 + .../api/components/KtMetadataCalculator.kt | 40 +++ .../kotlin/codegen/writeAnnotationUtil.kt | 20 +- .../fir/backend/jvm/FirJvmBackendExtension.kt | 11 +- .../org/jetbrains/kotlin/kotlinp/Kotlinp.kt | 2 +- plugins/kapt3/kapt3-compiler/build.gradle.kts | 3 + .../jetbrains/kotlin/kapt3/Kapt3Extension.kt | 4 +- .../kapt3/util/PrettyWithWorkarounds.kt | 24 +- .../ClassFileToSourceKaptStubHandler.kt | 2 +- .../kotlin/kapt3/test/handlers/utils.kt | 40 ++- .../testData/converter/abstractEnum.fir.txt | 117 ++++++++ .../testData/converter/abstractEnum.ir.txt | 117 ++++++++ .../testData/converter/abstractEnum.txt | 117 ++++++++ .../testData/converter/abstractMethods.txt | 30 ++ .../testData/converter/aliasedImports.fir.txt | 71 +++++ .../testData/converter/aliasedImports.txt | 71 +++++ .../converter/annotationWithFqNames.fir.txt | 35 +++ .../converter/annotationWithFqNames.txt | 35 +++ .../testData/converter/annotations.fir.txt | 126 ++++++++ .../testData/converter/annotations.ir.txt | 126 ++++++++ .../testData/converter/annotations.txt | 126 ++++++++ .../testData/converter/annotations2.fir.txt | 72 +++++ .../testData/converter/annotations2.ir.txt | 72 +++++ .../testData/converter/annotations2.txt | 72 +++++ .../testData/converter/annotations3.fir.txt | 69 +++++ .../testData/converter/annotations3.ir.txt | 63 ++++ .../testData/converter/annotations3.txt | 60 ++++ .../annotationsWithConstants.fir.txt | 244 ++++++++++++++++ .../converter/annotationsWithConstants.ir.txt | 244 ++++++++++++++++ .../converter/annotationsWithConstants.txt | 244 ++++++++++++++++ .../converter/annotationsWithTargets.fir.txt | 80 +++++ .../converter/annotationsWithTargets.txt | 80 +++++ .../converter/anonymousDelegate.fir.txt | 58 ++++ .../converter/anonymousDelegate.ir.txt | 58 ++++ .../testData/converter/anonymousDelegate.txt | 58 ++++ .../converter/anonymousInitializer.txt | 12 + ...onymousObjectInEnumSuperConstructor.ir.txt | 27 ++ .../anonymousObjectInEnumSuperConstructor.txt | 27 ++ .../testData/converter/comments.fir.txt | 113 ++++++- .../testData/converter/comments.ir.txt | 116 ++++++++ .../testData/converter/comments.txt | 116 ++++++++ .../testData/converter/commentsRemoved.ir.txt | 116 ++++++++ .../testData/converter/commentsRemoved.txt | 116 ++++++++ .../testData/converter/cyrillicClassName.txt | 18 ++ .../testData/converter/dataClass.fir.txt | 45 +++ .../testData/converter/dataClass.ir.txt | 48 +++ .../testData/converter/dataClass.txt | 48 +++ .../testData/converter/defaultImpls.fir.txt | 47 +++ .../testData/converter/defaultImpls.ir.txt | 53 ++++ .../testData/converter/defaultImpls.txt | 53 ++++ .../defaultImplsWithTypeParameters.fir.txt | 13 + .../defaultImplsWithTypeParameters.txt | 16 + .../testData/converter/defaultPackage.fir.txt | 42 +++ .../testData/converter/defaultPackage.txt | 42 +++ .../defaultPackageCorrectErrorTypes.fir.txt | 42 +++ .../defaultPackageCorrectErrorTypes.txt | 42 +++ .../defaultParameterValueOff.fir.txt | 117 ++++++++ .../converter/defaultParameterValueOff.ir.txt | 117 ++++++++ .../converter/defaultParameterValueOff.txt | 117 ++++++++ .../converter/defaultParameterValueOn.fir.txt | 117 ++++++++ .../converter/defaultParameterValueOn.ir.txt | 117 ++++++++ .../converter/defaultParameterValueOn.txt | 117 ++++++++ .../delegateCorrectErrorTypes.ir.txt | 26 ++ .../converter/delegateCorrectErrorTypes.txt | 26 ++ .../testData/converter/delegateToList.ir.txt | 47 +++ .../testData/converter/delegateToList.txt | 47 +++ .../converter/delegatedProperties.fir.txt | 47 +++ .../converter/delegatedProperties.ir.txt | 114 ++++++++ .../converter/delegatedProperties.txt | 47 +++ .../delegationAndCompanionObject.ir.txt | 44 +++ .../delegationAndCompanionObject.txt | 44 +++ .../converter/delegationToAnonymousObject.txt | 15 + .../testData/converter/deprecated.txt | 33 +++ .../testData/converter/enumImports.fir.txt | 17 ++ .../testData/converter/enumImports.ir.txt | 17 ++ .../testData/converter/enumImports.txt | 17 ++ .../converter/enumInCompanion.fir.txt | 225 ++++++++++++++ .../testData/converter/enumInCompanion.ir.txt | 225 ++++++++++++++ .../testData/converter/enumInCompanion.txt | 225 ++++++++++++++ .../converter/enumSecondaryConstructor.ir.txt | 1 - .../converter/enumSecondaryConstructor.kt | 2 + .../converter/enumSecondaryConstructor.txt | 1 - .../testData/converter/enums.fir.txt | 96 ++++++ .../testData/converter/enums.ir.txt | 96 ++++++ .../testData/converter/enums.txt | 96 ++++++ .../converter/errorExtensionReceiver.txt | 43 +++ .../converter/errorLocationMapping.fir.txt | 112 +++++++ .../converter/errorLocationMapping.txt | 112 +++++++ .../converter/errorSuperclass.fir.txt | 18 ++ .../testData/converter/errorSuperclass.ir.txt | 18 ++ .../testData/converter/errorSuperclass.txt | 18 ++ .../errorSuperclassCorrectErrorTypes.fir.txt | 194 ++++++++++++ .../errorSuperclassCorrectErrorTypes.txt | 194 ++++++++++++ .../testData/converter/fileFacadeJvmName.txt | 13 + .../testData/converter/functions.txt | 21 ++ .../converter/genericParameters.fir.txt | 25 ++ .../converter/genericParameters.ir.txt | 25 ++ .../testData/converter/genericParameters.txt | 25 ++ .../converter/genericRawSignatures.txt | 15 + .../testData/converter/genericSimple.txt | 53 ++++ .../testData/converter/ignoredMembers.kt | 2 + .../testData/converter/ignoredMembers.txt | 1 - .../converter/implicitReturnTypes.fir.txt | 37 +++ .../converter/implicitReturnTypes.txt | 37 +++ .../converter/importsForErrorTypes.fir.txt | 9 + .../converter/importsForErrorTypes.txt | 9 + .../testData/converter/importsKt22083.fir.txt | 48 +++ .../testData/converter/importsKt22083.txt | 48 +++ .../converter/incorrectDelegate.fir.txt | 38 +++ .../converter/incorrectDelegate.ir.txt | 38 +++ .../testData/converter/incorrectDelegate.txt | 38 +++ .../converter/inheritanceSimple.fir.txt | 4 - .../converter/inheritanceSimple.ir.txt | 4 - .../testData/converter/inheritanceSimple.kt | 3 + .../testData/converter/inheritanceSimple.txt | 4 - .../testData/converter/inlineClasses.fir.txt | 27 ++ .../testData/converter/inlineClasses.ir.txt | 27 ++ .../testData/converter/inlineClasses.txt | 27 ++ .../innerClassesWithTypeParameters.fir.txt | 86 ++++++ .../innerClassesWithTypeParameters.ir.txt | 86 ++++++ .../innerClassesWithTypeParameters.txt | 86 ++++++ .../converter/interfaceImplementation.fir.txt | 26 ++ .../converter/interfaceImplementation.txt | 26 ++ .../converter/invalidFieldName.ir.txt | 28 ++ .../testData/converter/invalidFieldName.txt | 28 ++ .../converter/javaKeywordsInPackageNames.txt | 18 ++ .../testData/converter/javadoc.fir.txt | 64 +++- .../testData/converter/javadoc.ir.txt | 64 ++++ .../testData/converter/javadoc.txt | 64 ++++ .../testData/converter/jvmDefaultAll.txt | 21 ++ .../converter/jvmDefaultAllCompatibility.txt | 25 ++ .../testData/converter/jvmOverloads.ir.txt | 54 ++++ .../testData/converter/jvmOverloads.txt | 54 ++++ .../converter/jvmRepeatableAnnotation.fir.txt | 22 ++ .../converter/jvmRepeatableAnnotation.txt | 22 ++ .../testData/converter/jvmStatic.fir.txt | 63 ++++ .../testData/converter/jvmStatic.ir.txt | 66 +++++ .../testData/converter/jvmStatic.txt | 66 +++++ .../converter/jvmStaticFieldInParent.fir.txt | 27 ++ .../converter/jvmStaticFieldInParent.ir.txt | 28 ++ .../converter/jvmStaticFieldInParent.txt | 28 ++ .../testData/converter/kt14996.fir.txt | 12 + .../testData/converter/kt14996.txt | 12 + .../testData/converter/kt14997.fir.txt | 46 +++ .../testData/converter/kt14997.ir.txt | 46 +++ .../testData/converter/kt14997.txt | 46 +++ .../testData/converter/kt14998.fir.txt | 57 ++++ .../testData/converter/kt14998.txt | 57 ++++ .../testData/converter/kt15145.txt | 20 ++ .../testData/converter/kt17567.ir.txt | 18 ++ .../testData/converter/kt17567.txt | 18 ++ .../testData/converter/kt18377.txt | 9 + .../testData/converter/kt18682.fir.txt | 27 ++ .../testData/converter/kt18682.txt | 27 ++ .../testData/converter/kt19700.ir.txt | 2 - .../testData/converter/kt19700.kt | 3 + .../testData/converter/kt19700.txt | 2 - .../testData/converter/kt19750.ir.txt | 2 - .../testData/converter/kt19750.kt | 3 + .../testData/converter/kt19750.txt | 2 - .../testData/converter/kt24272.ir.txt | 41 +++ .../testData/converter/kt24272.txt | 41 +++ .../testData/converter/kt25071.txt | 38 +++ .../testData/converter/kt27126.fir.txt | 58 ++++ .../testData/converter/kt27126.ir.txt | 58 ++++ .../testData/converter/kt27126.txt | 58 ++++ .../testData/converter/kt28306.fir.txt | 15 + .../testData/converter/kt28306.ir.txt | 21 ++ .../testData/converter/kt28306.txt | 21 ++ .../testData/converter/kt32596.txt | 40 +++ .../testData/converter/kt34569.txt | 12 + .../testData/converter/kt43786.fir.txt | 35 +++ .../testData/converter/kt43786.txt | 35 +++ .../testData/converter/lazyProperty.fir.txt | 41 +++ .../testData/converter/lazyProperty.ir.txt | 41 +++ .../testData/converter/lazyProperty.txt | 41 +++ .../testData/converter/leadingDollars.txt | 12 + .../testData/converter/leadingDollars2.txt | 9 + .../testData/converter/mapEntry.txt | 13 + .../testData/converter/maxErrorCount.fir.txt | 12 + .../testData/converter/maxErrorCount.txt | 12 + .../converter/methodParameterNames.fir.txt | 27 ++ .../converter/methodParameterNames.txt | 30 ++ .../methodPropertySignatureClash.txt | 17 ++ .../testData/converter/modifiers.fir.txt | 159 ++++++++++ .../testData/converter/modifiers.ir.txt | 163 +++++++++++ .../testData/converter/modifiers.txt | 163 +++++++++++ .../testData/converter/multifileClass.ir.txt | 11 + .../testData/converter/multifileClass.txt | 11 + .../multifileClassDefaultPackage.ir.txt | 24 ++ .../multifileClassDefaultPackage.txt | 24 ++ .../testData/converter/nestedClasses.fir.txt | 208 +++++++++++++ .../testData/converter/nestedClasses.ir.txt | 211 +++++++++++++ .../testData/converter/nestedClasses.txt | 211 +++++++++++++ .../testData/converter/nestedClasses2.ir.txt | 276 ++++++++++++++++++ .../testData/converter/nestedClasses2.txt | 276 ++++++++++++++++++ .../nestedClassesNonRootPackage.ir.txt | 274 +++++++++++++++++ .../converter/nestedClassesNonRootPackage.txt | 274 +++++++++++++++++ .../converter/nonExistentClass.fir.txt | 39 +++ .../converter/nonExistentClass.ir.txt | 39 +++ .../testData/converter/nonExistentClass.txt | 39 +++ .../nonExistentClassTypesConversion.ir.txt | 225 ++++++++++++++ .../nonExistentClassTypesConversion.txt | 225 ++++++++++++++ .../nonExistentClassWIthoutCorrection.fir.txt | 91 ++++++ .../nonExistentClassWIthoutCorrection.ir.txt | 91 ++++++ .../nonExistentClassWIthoutCorrection.txt | 91 ++++++ .../testData/converter/primitiveTypes.fir.txt | 141 +++++++++ .../testData/converter/primitiveTypes.ir.txt | 141 +++++++++ .../testData/converter/primitiveTypes.txt | 141 +++++++++ .../testData/converter/properties.kt | 3 + .../testData/converter/properties.txt | 1 - .../converter/propertyAnnotations.fir.txt | 33 +++ .../converter/propertyAnnotations.txt | 33 +++ .../converter/recentlyNullable.fir.txt | 17 ++ .../testData/converter/recentlyNullable.txt | 17 ++ .../converter/repeatableAnnotations.fir.txt | 241 +++++++++++++++ .../converter/repeatableAnnotations.ir.txt | 241 +++++++++++++++ .../converter/repeatableAnnotations.txt | 241 +++++++++++++++ .../converter/secondaryConstructor.fir.txt | 26 ++ .../converter/secondaryConstructor.txt | 26 ++ .../converter/severalPackageParts.txt | 18 ++ .../testData/converter/starImports.fir.txt | 26 ++ .../testData/converter/starImports.txt | 26 ++ .../converter/strangeIdentifiers.fir.txt | 78 +++++ .../converter/strangeIdentifiers.ir.txt | 78 +++++ .../testData/converter/strangeIdentifiers.txt | 78 +++++ .../converter/superConstructorCall.txt | 23 ++ .../testData/converter/suspendArgName.ir.txt | 21 ++ .../testData/converter/suspendArgName.txt | 21 ++ .../converter/suspendErrorTypes.fir.txt | 15 + .../converter/suspendErrorTypes.ir.txt | 17 ++ .../testData/converter/suspendErrorTypes.txt | 17 ++ .../converter/suspendFunctionSupertype.txt | 6 + .../suspendFunctionWithBigArity.ir.txt | 15 + .../converter/suspendFunctionWithBigArity.txt | 15 + .../testData/converter/topLevel.fir.txt | 48 +++ .../testData/converter/topLevel.txt | 48 +++ .../unresolvedDelegateExpression.fir.txt | 132 +++++++++ .../unresolvedDelegateExpression.ir.txt | 57 ++++ .../unresolvedDelegateExpression.txt | 57 ++++ .../unsafePropertyInitializers.fir.txt | 187 ++++++++++++ .../unsafePropertyInitializers.ir.txt | 189 ++++++++++++ .../converter/unsafePropertyInitializers.txt | 189 ++++++++++++ .../kotlin/kapt4/Kapt4StubGenerator.kt | 66 +++-- .../jetbrains/kotlin/kapt4/Kapt4Handler.kt | 3 +- 250 files changed, 15438 insertions(+), 81 deletions(-) create mode 100644 analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KtFirMetadataCalculator.kt create mode 100644 analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/components/KtMetadataCalculator.kt create mode 100644 plugins/kapt3/kapt3-compiler/testData/converter/delegatedProperties.ir.txt create mode 100644 plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.fir.txt diff --git a/analysis/analysis-api-fe10/src/org/jetbrains/kotlin/analysis/api/descriptors/KtFe10AnalysisSession.kt b/analysis/analysis-api-fe10/src/org/jetbrains/kotlin/analysis/api/descriptors/KtFe10AnalysisSession.kt index b115baa479e..cb59973a00f 100644 --- a/analysis/analysis-api-fe10/src/org/jetbrains/kotlin/analysis/api/descriptors/KtFe10AnalysisSession.kt +++ b/analysis/analysis-api-fe10/src/org/jetbrains/kotlin/analysis/api/descriptors/KtFe10AnalysisSession.kt @@ -8,6 +8,7 @@ package org.jetbrains.kotlin.analysis.api.descriptors import com.intellij.openapi.project.Project import com.intellij.psi.search.GlobalSearchScope import org.jetbrains.kotlin.analysis.api.KtAnalysisApiInternals +import org.jetbrains.kotlin.analysis.api.KtAnalysisNonPublicApi import org.jetbrains.kotlin.analysis.api.KtAnalysisSession import org.jetbrains.kotlin.analysis.api.components.* import org.jetbrains.kotlin.analysis.api.descriptors.components.* @@ -22,7 +23,7 @@ import org.jetbrains.kotlin.analysis.project.structure.ProjectStructureProvider import org.jetbrains.kotlin.psi.KtElement import org.jetbrains.kotlin.psi.KtFile -@OptIn(KtAnalysisApiInternals::class) +@OptIn(KtAnalysisApiInternals::class, KtAnalysisNonPublicApi::class) @Suppress("LeakingThis") class KtFe10AnalysisSession( val analysisContext: Fe10AnalysisContext, @@ -72,6 +73,9 @@ class KtFe10AnalysisSession( override val resolveExtensionInfoProviderImpl: KtResolveExtensionInfoProvider = KtFe10ResolveExtensionInfoProvider(this) override val compilerFacilityImpl: KtCompilerFacility = KtFe10CompilerFacility(this) + override val metadataCalculatorImpl: KtMetadataCalculator + get() = throw UnsupportedOperationException() + override fun createContextDependentCopy(originalKtFile: KtFile, elementToReanalyze: KtElement): KtAnalysisSession = withValidityAssertion { KtFe10AnalysisSession(originalKtFile.project, elementToReanalyze, token) diff --git a/analysis/analysis-api-fir/build.gradle.kts b/analysis/analysis-api-fir/build.gradle.kts index 2f1eab28818..703250f985d 100644 --- a/analysis/analysis-api-fir/build.gradle.kts +++ b/analysis/analysis-api-fir/build.gradle.kts @@ -79,6 +79,8 @@ allprojects { val generatorClasspath by configurations.creating dependencies { + implementation(project(":compiler:fir:fir-serialization")) + implementation(project(":compiler:backend")) generatorClasspath(project(":analysis:analysis-api-fir:analysis-api-fir-generator")) } diff --git a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/KtFirAnalysisSession.kt b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/KtFirAnalysisSession.kt index 7c4ae8fd042..47e25f1d606 100644 --- a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/KtFirAnalysisSession.kt +++ b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/KtFirAnalysisSession.kt @@ -8,6 +8,7 @@ package org.jetbrains.kotlin.analysis.api.fir import com.intellij.openapi.project.Project import com.intellij.psi.search.GlobalSearchScope import org.jetbrains.kotlin.analysis.api.KtAnalysisApiInternals +import org.jetbrains.kotlin.analysis.api.KtAnalysisNonPublicApi import org.jetbrains.kotlin.analysis.api.KtAnalysisSession import org.jetbrains.kotlin.analysis.api.components.* import org.jetbrains.kotlin.analysis.api.fir.components.* @@ -18,7 +19,6 @@ import org.jetbrains.kotlin.analysis.api.lifetime.KtLifetimeToken import org.jetbrains.kotlin.analysis.api.lifetime.withValidityAssertion import org.jetbrains.kotlin.analysis.low.level.api.fir.api.LLFirResolveSession import org.jetbrains.kotlin.analysis.low.level.api.fir.api.LowLevelFirApiFacadeForResolveOnAir -import org.jetbrains.kotlin.analysis.providers.impl.declarationProviders.CompositeKotlinDeclarationProvider import org.jetbrains.kotlin.analysis.low.level.api.fir.project.structure.CompositeKotlinPackageProvider import org.jetbrains.kotlin.analysis.low.level.api.fir.resolve.extensions.LLFirResolveExtensionTool import org.jetbrains.kotlin.analysis.low.level.api.fir.resolve.extensions.llResolveExtensionTool @@ -28,6 +28,7 @@ import org.jetbrains.kotlin.analysis.providers.KotlinDeclarationProvider import org.jetbrains.kotlin.analysis.providers.KotlinPackageProvider import org.jetbrains.kotlin.analysis.providers.createDeclarationProvider import org.jetbrains.kotlin.analysis.providers.createPackageProvider +import org.jetbrains.kotlin.analysis.providers.impl.declarationProviders.CompositeKotlinDeclarationProvider import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.moduleData import org.jetbrains.kotlin.fir.resolve.ScopeSession @@ -38,7 +39,7 @@ import org.jetbrains.kotlin.psi.KtElement import org.jetbrains.kotlin.psi.KtFile import org.jetbrains.kotlin.utils.addIfNotNull -@OptIn(KtAnalysisApiInternals::class) +@OptIn(KtAnalysisApiInternals::class, KtAnalysisNonPublicApi::class) @Suppress("AnalysisApiMissingLifetimeCheck") internal class KtFirAnalysisSession private constructor( @@ -130,6 +131,8 @@ private constructor( override val compilerFacilityImpl: KtCompilerFacility = KtFirCompilerFacility(this) + override val metadataCalculatorImpl: KtMetadataCalculator = KtFirMetadataCalculator(this) + @Suppress("AnalysisApiMissingLifetimeCheck") override fun createContextDependentCopy(originalKtFile: KtFile, elementToReanalyze: KtElement): KtAnalysisSession { check(mode == AnalysisSessionMode.REGULAR) { diff --git a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KtFirMetadataCalculator.kt b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KtFirMetadataCalculator.kt new file mode 100644 index 00000000000..048ec44ca2a --- /dev/null +++ b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KtFirMetadataCalculator.kt @@ -0,0 +1,206 @@ +/* + * 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.analysis.api.fir.components + +import com.google.common.collect.Multimap +import com.intellij.psi.PsiElement +import com.intellij.psi.PsiField +import com.intellij.psi.PsiMethod +import com.intellij.psi.PsiType +import com.intellij.psi.util.ClassUtil +import org.jetbrains.kotlin.analysis.api.KtAnalysisNonPublicApi +import org.jetbrains.kotlin.analysis.api.components.KtMetadataCalculator +import org.jetbrains.kotlin.analysis.api.fir.KtFirAnalysisSession +import org.jetbrains.kotlin.analysis.low.level.api.fir.api.getOrBuildFirFile +import org.jetbrains.kotlin.analysis.low.level.api.fir.api.getOrBuildFirOfType +import org.jetbrains.kotlin.analysis.project.structure.KtSourceModule +import org.jetbrains.kotlin.codegen.ClassBuilderMode +import org.jetbrains.kotlin.codegen.generateLanguageVersionSettingsBasedMetadataFlags +import org.jetbrains.kotlin.codegen.serialization.JvmSerializationBindings +import org.jetbrains.kotlin.config.JvmAbiStability +import org.jetbrains.kotlin.config.JvmDefaultMode +import org.jetbrains.kotlin.fir.FirSession +import org.jetbrains.kotlin.fir.backend.FirMetadataSource +import org.jetbrains.kotlin.fir.backend.jvm.FirJvmBackendExtension +import org.jetbrains.kotlin.fir.backend.jvm.FirJvmSerializerExtension +import org.jetbrains.kotlin.fir.backend.jvm.FirJvmSerializerExtension.Companion.FIELD_FOR_PROPERTY +import org.jetbrains.kotlin.fir.backend.jvm.FirJvmSerializerExtension.Companion.METHOD_FOR_FIR_FUNCTION +import org.jetbrains.kotlin.fir.declarations.* +import org.jetbrains.kotlin.fir.declarations.utils.classId +import org.jetbrains.kotlin.fir.declarations.utils.hasBackingField +import org.jetbrains.kotlin.fir.languageVersionSettings +import org.jetbrains.kotlin.fir.packageFqName +import org.jetbrains.kotlin.fir.psi +import org.jetbrains.kotlin.fir.resolve.ScopeSession +import org.jetbrains.kotlin.fir.serialization.FirElementAwareStringTable +import org.jetbrains.kotlin.fir.serialization.FirElementSerializer +import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase +import org.jetbrains.kotlin.fir.types.typeApproximator +import org.jetbrains.kotlin.load.java.JvmAbi +import org.jetbrains.kotlin.load.kotlin.NON_EXISTENT_CLASS_NAME +import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader +import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil +import org.jetbrains.kotlin.metadata.jvm.serialization.JvmStringTable +import org.jetbrains.kotlin.name.ClassId +import org.jetbrains.kotlin.name.SpecialNames +import org.jetbrains.kotlin.protobuf.GeneratedMessageLite +import org.jetbrains.kotlin.psi.KtClassOrObject +import org.jetbrains.kotlin.psi.KtElement +import org.jetbrains.kotlin.psi.KtFile +import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull +import org.jetbrains.kotlin.utils.toMetadataVersion +import org.jetbrains.org.objectweb.asm.Type +import org.jetbrains.org.objectweb.asm.commons.Method +import java.util.* + +@OptIn(KtAnalysisNonPublicApi::class) +internal class KtFirMetadataCalculator(override val analysisSession: KtFirAnalysisSession) : KtMetadataCalculator(), + KtFirAnalysisSessionComponent { + private val firSession: FirSession + get() = rootModuleSession + + private val scopeSession: ScopeSession + get() = firResolveSession.getScopeSessionFor(firSession) + + private val metadataVersion = firSession.languageVersionSettings.languageVersion.toMetadataVersion() + + override fun calculateMetadata(ktClass: KtClassOrObject, mapping: Multimap): Metadata { + val firClass = ktClass.getOrBuildFirOfType(firResolveSession) + + val bindings = JvmSerializationBindings().also { collectBindings(firClass.declarations, mapping, it) } + val (serializer, stringTable) = createTopLevelSerializer(FirMetadataSource.Class(firClass), bindings) + val classProto = serializer.classProto(firClass) + return generateAnnotation(classProto.build(), stringTable, KotlinClassHeader.Kind.CLASS) + } + + override fun calculateMetadata(ktFile: KtFile, mapping: Multimap): Metadata { + val firFile = ktFile.getOrBuildFirFile(firResolveSession) + val bindings = JvmSerializationBindings().also { collectBindings(firFile.declarations, mapping, it) } + val fileList = listOf(firFile) + val (serializer, stringTable) = createTopLevelSerializer(FirMetadataSource.File(fileList), bindings) + val fileProto = serializer.packagePartProto(firFile.packageFqName, fileList, null) + return generateAnnotation(fileProto.build(), stringTable, KotlinClassHeader.Kind.FILE_FACADE) + } + + private fun collectBindings( + declarations: List, + mapping: Multimap, + bindings: JvmSerializationBindings, + ) { + for (fir in declarations) { + if (fir !is FirFunction && fir !is FirProperty && fir !is FirTypeAlias) continue + + fir.symbol.lazyResolveToPhase(FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE) + + val psiElements = mapping[fir.psi as KtElement] + val methods = psiElements.filterIsInstance() + when (fir) { + is FirFunction -> methods.singleOrNull { it.isConstructor == fir is FirConstructor }?.let { + bindings.put( + METHOD_FOR_FIR_FUNCTION, + fir, + Method(if (it.isConstructor) SpecialNames.INIT.asString() else it.name, getAsmMethodSignatureWithCorrection(it)) + ) + } + is FirProperty -> { + if (fir.hasBackingField || fir.delegateFieldSymbol != null) { + psiElements.firstIsInstanceOrNull()?.let { + bindings.put(FIELD_FOR_PROPERTY, fir, Type.getType(getBinaryPresentationWithCorrection(it.type)) to it.name) + } + } + fir.getter?.let { getter -> + methods.singleOrNull { it.returnType != PsiType.VOID }?.let { + bindings.put(METHOD_FOR_FIR_FUNCTION, getter, Method(it.name, getAsmMethodSignatureWithCorrection(it))) + } + } + fir.setter?.let { setter -> + methods.singleOrNull { it.name.startsWith("set") }?.let { + bindings.put(METHOD_FOR_FIR_FUNCTION, setter, Method(it.name, getAsmMethodSignatureWithCorrection(it))) + } + } + methods.singleOrNull { it.name.endsWith(JvmAbi.ANNOTATED_PROPERTY_METHOD_NAME_SUFFIX) }?.let { + bindings.put( + FirJvmSerializerExtension.SYNTHETIC_METHOD_FOR_FIR_VARIABLE, + fir, + Method(it.name, getAsmMethodSignatureWithCorrection(it)) + ) + } + } + else -> {} + } + } + } + + private fun createTopLevelSerializer( + metadataSource: FirMetadataSource, + bindings: JvmSerializationBindings, + ): Pair { + val stringTable = FirJvmElementAwareStringTableForLightClasses() + val jvmSerializerExtension = FirJvmSerializerExtension( + firSession, + bindings, + metadataSource, + localDelegatedProperties = emptyList(), + firSession.typeApproximator, + scopeSession, + JvmSerializationBindings(), + useTypeTable = true, + moduleName = (analysisSession.useSiteModule as KtSourceModule).run { stableModuleName ?: moduleName }, + classBuilderMode = ClassBuilderMode.KAPT3, + isParamAssertionsDisabled = false, + unifiedNullChecks = true, + metadataVersion = metadataVersion, + // Technically we should use JvmDefaultMode.ALL_INCOMPATIBLE because Kapt4 always uses `-Xjvm-default=all`, but it would make + // the majority of tests fail because metadata of each interface will have a flag set, compared to Kapt3. + jvmDefaultMode = JvmDefaultMode.DEFAULT, + stringTable, + null, + null + ) + return FirElementSerializer.createTopLevel( + firSession, + scopeSession, + jvmSerializerExtension, + firSession.typeApproximator, + firSession.languageVersionSettings + ) to stringTable + } + + private fun generateAnnotation(message: GeneratedMessageLite, stringTable: JvmStringTable, kind: KotlinClassHeader.Kind): Metadata = + Metadata( + kind = kind.id, + metadataVersion = metadataVersion.toArray(), + data1 = JvmProtoBufUtil.writeData(message, stringTable), + data2 = stringTable.strings.toTypedArray(), + extraInt = FirJvmBackendExtension.generateMetadataExtraFlags(JvmAbiStability.STABLE) or + generateLanguageVersionSettingsBasedMetadataFlags(firSession.languageVersionSettings) + ) +} + +private fun getAsmMethodSignatureWithCorrection(method: PsiMethod): String = buildString { + append("(") + if (method.containingClass?.isEnum == true && method.isConstructor) { + // Enum constructors are represented without name/ordinal in light classes, which seems fine because they don't have name/ordinal + // in Java sources as well, even though the parameters are there in the bytecode. Since metadata stores JVM signatures, we're + // adding the name/ordinal parameters manually. + append("Ljava/lang/String;") + append("I") + } + for (param in method.parameterList.parameters) { + append(getBinaryPresentationWithCorrection(param.type)) + } + append(")") + append(getBinaryPresentationWithCorrection(Optional.ofNullable(method.returnType).orElse(PsiType.VOID))) +} + +private fun getBinaryPresentationWithCorrection(psiType: PsiType): String = + ClassUtil.getBinaryPresentation(psiType).takeIf { it.isNotEmpty() } ?: "L${NON_EXISTENT_CLASS_NAME};" + +private class FirJvmElementAwareStringTableForLightClasses : JvmStringTable(), FirElementAwareStringTable { + override fun getLocalClassIdReplacement(firClass: FirClass): ClassId { + return firClass.classId + } +} diff --git a/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/KtAnalysisSession.kt b/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/KtAnalysisSession.kt index 0e1d906cd62..f50d801ab07 100644 --- a/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/KtAnalysisSession.kt +++ b/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/KtAnalysisSession.kt @@ -30,7 +30,7 @@ import org.jetbrains.kotlin.psi.KtFile * * To create a [KtAnalysisSession], please use [analyze] or one of its siblings. */ -@OptIn(KtAnalysisApiInternals::class) +@OptIn(KtAnalysisApiInternals::class, KtAnalysisNonPublicApi::class) @Suppress("AnalysisApiMissingLifetimeCheck") public abstract class KtAnalysisSession(final override val token: KtLifetimeToken) : KtLifetimeOwner, KtSmartCastProviderMixIn, @@ -67,7 +67,8 @@ public abstract class KtAnalysisSession(final override val token: KtLifetimeToke KtScopeSubstitutionMixIn, KtSymbolProviderByJavaPsiMixIn, KtResolveExtensionInfoProviderMixIn, - KtCompilerFacilityMixIn { + KtCompilerFacilityMixIn, + KtMetadataCalculatorMixIn { public abstract val useSiteModule: KtModule @@ -186,6 +187,8 @@ public abstract class KtAnalysisSession(final override val token: KtLifetimeToke @KtAnalysisApiInternals protected abstract val symbolProviderByJavaPsiImpl: KtSymbolProviderByJavaPsi + internal val metadataCalculator: KtMetadataCalculator get() = metadataCalculatorImpl + protected abstract val metadataCalculatorImpl: KtMetadataCalculator @PublishedApi internal val typesCreator: KtTypeCreator @@ -195,4 +198,4 @@ public abstract class KtAnalysisSession(final override val token: KtLifetimeToke public fun KtAnalysisSession.getModule(element: PsiElement): KtModule { return ProjectStructureProvider.getModule(useSiteModule.project, element, useSiteModule) -} \ No newline at end of file +} diff --git a/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/annnotations.kt b/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/annnotations.kt index c1ccab11077..cfead206a1e 100644 --- a/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/annnotations.kt +++ b/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/annnotations.kt @@ -8,6 +8,9 @@ package org.jetbrains.kotlin.analysis.api @RequiresOptIn("Internal Analysis API component which should not be used outside the Analysis API implementation modules as it does not have any compatibility guarantees") public annotation class KtAnalysisApiInternals +@RequiresOptIn("Internal Analysis API component which is used from other modules in the Kotlin project and is not supposed to be used anywhere else since it has no compatibility guarantees") +public annotation class KtAnalysisNonPublicApi + @RequiresOptIn("Analysis should not be allowed to be ran from EDT thread, otherwise it may cause IDE freezes") public annotation class KtAllowAnalysisOnEdt diff --git a/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/components/KtMetadataCalculator.kt b/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/components/KtMetadataCalculator.kt new file mode 100644 index 00000000000..2b33dbd4dab --- /dev/null +++ b/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/components/KtMetadataCalculator.kt @@ -0,0 +1,40 @@ +/* + * 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.analysis.api.components + +import com.google.common.collect.Multimap +import com.intellij.psi.PsiElement +import org.jetbrains.kotlin.analysis.api.KtAnalysisNonPublicApi +import org.jetbrains.kotlin.analysis.api.lifetime.withValidityAssertion +import org.jetbrains.kotlin.psi.KtClassOrObject +import org.jetbrains.kotlin.psi.KtElement +import org.jetbrains.kotlin.psi.KtFile + +@KtAnalysisNonPublicApi +public abstract class KtMetadataCalculator : KtAnalysisSessionComponent() { + public abstract fun calculateMetadata(ktClass: KtClassOrObject, mapping: Multimap): Metadata + + public abstract fun calculateMetadata(ktFile: KtFile, mapping: Multimap): Metadata +} + +@KtAnalysisNonPublicApi +public interface KtMetadataCalculatorMixIn : KtAnalysisSessionMixIn { + /** + * Calculates metadata that would be generated by the compiler in case this class was compiled to the JVM class file. + * + * @param mapping map containing the light elements ([KtLightElement]) for each callable declaration in this class. + */ + public fun KtClassOrObject.calculateMetadata(mapping: Multimap): Metadata = + withValidityAssertion { analysisSession.metadataCalculator.calculateMetadata(this, mapping) } + + /** + * Calculates metadata that would be generated by the compiler in case this file was compiled to the JVM class file. + * + * @param mapping map containing the light elements ([KtLightElement]) for each callable declaration in this file. + */ + public fun KtFile.calculateMetadata(mapping: Multimap): Metadata = + withValidityAssertion { analysisSession.metadataCalculator.calculateMetadata(this, mapping) } +} diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/writeAnnotationUtil.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/writeAnnotationUtil.kt index a8635e784ea..cadf38a989a 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/writeAnnotationUtil.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/writeAnnotationUtil.kt @@ -18,6 +18,7 @@ package org.jetbrains.kotlin.codegen import org.jetbrains.kotlin.codegen.state.GenerationState import org.jetbrains.kotlin.config.JvmAnalysisFlags +import org.jetbrains.kotlin.config.LanguageVersionSettings import org.jetbrains.kotlin.load.java.JvmAnnotationNames import org.jetbrains.kotlin.load.kotlin.JvmBytecodeBinaryVersion import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader @@ -37,13 +38,7 @@ fun writeKotlinMetadata( av.visit("bv", JvmBytecodeBinaryVersion.INSTANCE.toArray()) } av.visit(JvmAnnotationNames.KIND_FIELD_NAME, kind.id) - var flags = extraFlags - if (state.languageVersionSettings.isPreRelease()) { - flags = flags or JvmAnnotationNames.METADATA_PRE_RELEASE_FLAG - } - if (state.languageVersionSettings.getFlag(JvmAnalysisFlags.strictMetadataVersionSemantics)) { - flags = flags or JvmAnnotationNames.METADATA_STRICT_VERSION_SEMANTICS_FLAG - } + var flags = extraFlags or generateLanguageVersionSettingsBasedMetadataFlags(state.languageVersionSettings) if (publicAbi) { flags = flags or JvmAnnotationNames.METADATA_PUBLIC_ABI_FLAG } @@ -59,3 +54,14 @@ fun writeSyntheticClassMetadata(cb: ClassBuilder, state: GenerationState, public // Do nothing } } + +fun generateLanguageVersionSettingsBasedMetadataFlags(languageVersionSettings: LanguageVersionSettings): Int { + var flags = 0 + if (languageVersionSettings.isPreRelease()) { + flags = flags or JvmAnnotationNames.METADATA_PRE_RELEASE_FLAG + } + if (languageVersionSettings.getFlag(JvmAnalysisFlags.strictMetadataVersionSemantics)) { + flags = flags or JvmAnnotationNames.METADATA_STRICT_VERSION_SEMANTICS_FLAG + } + return flags +} diff --git a/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmBackendExtension.kt b/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmBackendExtension.kt index 17f08ca01e2..4ce6b8e670e 100644 --- a/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmBackendExtension.kt +++ b/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmBackendExtension.kt @@ -39,7 +39,12 @@ class FirJvmBackendExtension( } override fun generateMetadataExtraFlags(abiStability: JvmAbiStability?): Int = - JvmAnnotationNames.METADATA_JVM_IR_FLAG or - JvmAnnotationNames.METADATA_FIR_FLAG or - (if (abiStability == JvmAbiStability.STABLE) JvmAnnotationNames.METADATA_JVM_IR_STABLE_ABI_FLAG else 0) + Companion.generateMetadataExtraFlags(abiStability) + + companion object { + fun generateMetadataExtraFlags(abiStability: JvmAbiStability?): Int = + JvmAnnotationNames.METADATA_JVM_IR_FLAG or + JvmAnnotationNames.METADATA_FIR_FLAG or + (if (abiStability == JvmAbiStability.STABLE) JvmAnnotationNames.METADATA_JVM_IR_STABLE_ABI_FLAG else 0) + } } diff --git a/libraries/tools/kotlinp/src/org/jetbrains/kotlin/kotlinp/Kotlinp.kt b/libraries/tools/kotlinp/src/org/jetbrains/kotlin/kotlinp/Kotlinp.kt index 39852bfed24..2e85e7c8291 100644 --- a/libraries/tools/kotlinp/src/org/jetbrains/kotlin/kotlinp/Kotlinp.kt +++ b/libraries/tools/kotlinp/src/org/jetbrains/kotlin/kotlinp/Kotlinp.kt @@ -11,7 +11,7 @@ import kotlinx.metadata.jvm.UnstableMetadataApi import java.io.File class Kotlinp(private val settings: KotlinpSettings) { - internal fun renderClassFile(classFile: KotlinClassMetadata): String = + fun renderClassFile(classFile: KotlinClassMetadata): String = when (classFile) { is KotlinClassMetadata.Class -> ClassPrinter(settings).print(classFile) is KotlinClassMetadata.FileFacade -> FileFacadePrinter(settings).print(classFile) diff --git a/plugins/kapt3/kapt3-compiler/build.gradle.kts b/plugins/kapt3/kapt3-compiler/build.gradle.kts index b05baeda1ff..5eba8729eb9 100644 --- a/plugins/kapt3/kapt3-compiler/build.gradle.kts +++ b/plugins/kapt3/kapt3-compiler/build.gradle.kts @@ -42,6 +42,9 @@ dependencies { embedded(project(":kotlin-annotation-processing-runtime")) { isTransitive = false } embedded(project(":kotlin-annotation-processing-cli")) { isTransitive = false } embedded(project(":kotlin-annotation-processing-base")) { isTransitive = false } + + testApi(project(":tools:kotlinp")) + testApi(project(":kotlinx-metadata-jvm")) } optInToExperimentalCompilerApi() diff --git a/plugins/kapt3/kapt3-compiler/src/org/jetbrains/kotlin/kapt3/Kapt3Extension.kt b/plugins/kapt3/kapt3-compiler/src/org/jetbrains/kotlin/kapt3/Kapt3Extension.kt index 5497a2a9004..163eba755d1 100644 --- a/plugins/kapt3/kapt3-compiler/src/org/jetbrains/kotlin/kapt3/Kapt3Extension.kt +++ b/plugins/kapt3/kapt3-compiler/src/org/jetbrains/kotlin/kapt3/Kapt3Extension.kt @@ -31,7 +31,6 @@ import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity.OUTPUT import org.jetbrains.kotlin.cli.common.messages.MessageCollector import org.jetbrains.kotlin.cli.common.messages.OutputMessageUtil import org.jetbrains.kotlin.cli.common.output.writeAll -import org.jetbrains.kotlin.util.ServiceLoaderLite import org.jetbrains.kotlin.codegen.ClassBuilderMode import org.jetbrains.kotlin.codegen.DefaultCodegenFactory import org.jetbrains.kotlin.codegen.KotlinCodegenFacade @@ -54,16 +53,15 @@ import org.jetbrains.kotlin.kapt3.diagnostic.KaptError import org.jetbrains.kotlin.kapt3.stubs.ClassFileToSourceStubConverter import org.jetbrains.kotlin.kapt3.stubs.ClassFileToSourceStubConverter.KaptStub import org.jetbrains.kotlin.kapt3.util.MessageCollectorBackedKaptLogger -import org.jetbrains.kotlin.kapt3.util.PrettyWithWorkarounds import org.jetbrains.kotlin.kapt3.util.prettyPrint import org.jetbrains.kotlin.modules.TargetId import org.jetbrains.kotlin.psi.KtFile import org.jetbrains.kotlin.resolve.BindingContext import org.jetbrains.kotlin.resolve.BindingTrace import org.jetbrains.kotlin.resolve.jvm.extensions.PartialAnalysisHandlerExtension +import org.jetbrains.kotlin.util.ServiceLoaderLite import org.jetbrains.kotlin.utils.kapt.MemoryLeakDetector import java.io.File -import java.io.StringWriter import java.net.URLClassLoader import javax.annotation.processing.Processor diff --git a/plugins/kapt3/kapt3-compiler/src/org/jetbrains/kotlin/kapt3/util/PrettyWithWorkarounds.kt b/plugins/kapt3/kapt3-compiler/src/org/jetbrains/kotlin/kapt3/util/PrettyWithWorkarounds.kt index 837cffacdfd..d88fca0e97b 100644 --- a/plugins/kapt3/kapt3-compiler/src/org/jetbrains/kotlin/kapt3/util/PrettyWithWorkarounds.kt +++ b/plugins/kapt3/kapt3-compiler/src/org/jetbrains/kotlin/kapt3/util/PrettyWithWorkarounds.kt @@ -7,14 +7,20 @@ package org.jetbrains.kotlin.kapt3.util import com.sun.tools.javac.code.Flags import com.sun.tools.javac.tree.JCTree +import com.sun.tools.javac.tree.JCTree.JCAnnotation +import com.sun.tools.javac.tree.JCTree.JCVariableDecl import com.sun.tools.javac.tree.Pretty import com.sun.tools.javac.tree.TreeMaker import com.sun.tools.javac.util.Context import org.jetbrains.kotlin.kapt3.base.util.isJava11OrLater +import org.jetbrains.kotlin.load.java.JvmAnnotationNames.METADATA_FQ_NAME import java.io.StringWriter import java.io.Writer -class PrettyWithWorkarounds(private val context: Context, val out: Writer, sourceOutput: Boolean) : Pretty(out, sourceOutput) { +private class PrettyWithWorkarounds( + private val context: Context, private val out: Writer, sourceOutput: Boolean, + private val renderMetadata: ((Pretty, JCAnnotation) -> String)?, +) : Pretty(out, sourceOutput) { companion object { private const val ENUM = Flags.ENUM.toLong() } @@ -23,7 +29,7 @@ class PrettyWithWorkarounds(private val context: Context, val out: Writer, sourc out.write(s.toString()) } - override fun visitVarDef(tree: JCTree.JCVariableDecl) { + override fun visitVarDef(tree: JCVariableDecl) { if ((tree.mods.flags and ENUM) != 0L) { // Pretty does not print annotations for enum values for some reason printExpr(TreeMaker.instance(context).Modifiers(0, tree.mods.annotations)) @@ -31,6 +37,7 @@ class PrettyWithWorkarounds(private val context: Context, val out: Writer, sourc if (isJava11OrLater()) { // Print enums fully, there is an issue when using Pretty in JDK 11. // See https://youtrack.jetbrains.com/issue/KT-33052. + print("/*public static final*/ ${tree.name}") tree.init?.let { print(" /* = $it */") } return @@ -38,8 +45,15 @@ class PrettyWithWorkarounds(private val context: Context, val out: Writer, sourc } super.visitVarDef(tree) } + + override fun visitAnnotation(tree: JCAnnotation) { + if (renderMetadata != null && tree.annotationType.toString() == METADATA_FQ_NAME.asString()) { + print(renderMetadata.invoke(this, tree)) + } + super.visitAnnotation(tree) + } } -fun JCTree.prettyPrint(context: Context): String { - return StringWriter().apply { PrettyWithWorkarounds(context, this, false).printStat(this@prettyPrint) }.toString() -} \ No newline at end of file +fun JCTree.prettyPrint(context: Context, renderMetadata: ((Pretty, JCAnnotation) -> String)? = null): String { + return StringWriter().apply { PrettyWithWorkarounds(context, this, false, renderMetadata).printStat(this@prettyPrint) }.toString() +} diff --git a/plugins/kapt3/kapt3-compiler/test/org/jetbrains/kotlin/kapt3/test/handlers/ClassFileToSourceKaptStubHandler.kt b/plugins/kapt3/kapt3-compiler/test/org/jetbrains/kotlin/kapt3/test/handlers/ClassFileToSourceKaptStubHandler.kt index 5432eb62333..18ea70bb4a7 100644 --- a/plugins/kapt3/kapt3-compiler/test/org/jetbrains/kotlin/kapt3/test/handlers/ClassFileToSourceKaptStubHandler.kt +++ b/plugins/kapt3/kapt3-compiler/test/org/jetbrains/kotlin/kapt3/test/handlers/ClassFileToSourceKaptStubHandler.kt @@ -40,7 +40,7 @@ class ClassFileToSourceKaptStubHandler(testServices: TestServices) : BaseKaptHan val actualRaw = convertedFiles .sortedBy { it.sourceFile.name } - .joinToString(FILE_SEPARATOR) { it.prettyPrint(kaptContext.context) } + .joinToString(FILE_SEPARATOR) { it.prettyPrint(kaptContext.context, ::renderMetadata) } val actual = StringUtil.convertLineSeparators(actualRaw.trim { it <= ' ' }) .trimTrailingWhitespacesAndAddNewlineAtEOF() diff --git a/plugins/kapt3/kapt3-compiler/test/org/jetbrains/kotlin/kapt3/test/handlers/utils.kt b/plugins/kapt3/kapt3-compiler/test/org/jetbrains/kotlin/kapt3/test/handlers/utils.kt index bc91499ee49..8cd7028d8e5 100644 --- a/plugins/kapt3/kapt3-compiler/test/org/jetbrains/kotlin/kapt3/test/handlers/utils.kt +++ b/plugins/kapt3/kapt3-compiler/test/org/jetbrains/kotlin/kapt3/test/handlers/utils.kt @@ -5,6 +5,12 @@ package org.jetbrains.kotlin.kapt3.test.handlers +import com.sun.tools.javac.tree.JCTree.* +import com.sun.tools.javac.tree.Pretty +import kotlinx.metadata.jvm.KotlinClassMetadata +import org.jetbrains.kotlin.kotlinp.Kotlinp +import org.jetbrains.kotlin.kotlinp.KotlinpSettings +import org.jetbrains.kotlin.load.java.JvmAnnotationNames import org.jetbrains.kotlin.test.Assertions import org.jetbrains.kotlin.test.model.TestModule import org.jetbrains.kotlin.test.utils.withExtension @@ -29,6 +35,36 @@ fun Assertions.checkTxtAccordingToBackend(module: TestModule, actual: String, fi private val KOTLIN_METADATA_REGEX = "@kotlin\\.Metadata\\(.*\\)".toRegex() -fun removeMetadataAnnotationContents(s: String): String { - return s.replace(KOTLIN_METADATA_REGEX, "@kotlin.Metadata()") +fun removeMetadataAnnotationContents(s: String): String = + s.replace(KOTLIN_METADATA_REGEX, "@kotlin.Metadata()") + +fun renderMetadata(pretty: Pretty, tree: JCAnnotation): String { + val args = tree.args.filterIsInstance().associate { (it.lhs as JCIdent).name.toString() to it.rhs } + val metadata = Metadata( + kind = args[JvmAnnotationNames.KIND_FIELD_NAME].intValue() ?: 1, + metadataVersion = args[JvmAnnotationNames.METADATA_VERSION_FIELD_NAME].arrayValue()?.map { it.intValue()!! }?.toIntArray() ?: intArrayOf(), + data1 = args[JvmAnnotationNames.METADATA_DATA_FIELD_NAME].arrayValue()?.map { it.stringValue()!! }?.toTypedArray() ?: arrayOf(), + data2 = args[JvmAnnotationNames.METADATA_STRINGS_FIELD_NAME].arrayValue()?.map { it.stringValue()!! }?.toTypedArray() ?: arrayOf(), + extraInt = args[JvmAnnotationNames.METADATA_EXTRA_INT_FIELD_NAME].intValue() ?: 0, + extraString = args[JvmAnnotationNames.METADATA_EXTRA_STRING_FIELD_NAME].stringValue() ?: "", + packageName = args[JvmAnnotationNames.METADATA_PACKAGE_NAME_FIELD_NAME].stringValue() ?: "", + ) + val text = Kotlinp(KotlinpSettings(isVerbose = true, sortDeclarations = true)).renderClassFile(KotlinClassMetadata.read(metadata)) + // "/*" and "*/" delimiters are used in kotlinp, for example to render type parameter names. Replace them with something else + // to avoid them being interpreted as Java comments. + val sanitized = text.split('\n').dropLast(1).map { it.replace("/*", "(*").replace("*/", "*)") } + // Add "*" at the beginning of each line to make it look prettier. + val result = sanitized.joinToString("\n * ", "/**\n * ", "\n */\n") + // Indent the rendered metadata for inner classes to make it look prettier. Unfortunately for that we need to read a private field. + val indent = Pretty::class.java.getDeclaredField("lmargin").apply { isAccessible = true }.get(pretty) as Int + return result.replace("\n", "\n" + " ".repeat(indent)) } + +private fun JCExpression?.intValue(): Int? = + (this as? JCLiteral)?.value as? Int + +private fun JCExpression?.stringValue(): String? = + (this as? JCLiteral)?.value as? String + +private fun JCExpression?.arrayValue(): List? = + (this as? JCNewArray)?.elems diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/abstractEnum.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/abstractEnum.fir.txt index abfe2d1623d..d127705408e 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/abstractEnum.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/abstractEnum.fir.txt @@ -1,3 +1,28 @@ +/** + * public final enum class E : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * // signature: a()V + * public abstract fun a(): kotlin/Unit + * + * // signature: b()V + * public final fun b(): kotlin/Unit + * + * // nested class: Obj + * + * // nested class: NestedClass + * + * X, + * + * Y, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum E { /*public static final*/ X /* = new E() */, @@ -16,6 +41,15 @@ public enum E { return null; } + /** + * public final object E.Obj : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Obj { @org.jetbrains.annotations.NotNull() @@ -26,6 +60,15 @@ public enum E { } } + /** + * public final class E.NestedClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class NestedClass { @@ -38,6 +81,27 @@ public enum E { //////////////////// +/** + * public final enum class E2 : kotlin/Enum { + * + * // signature: (Ljava/lang/String;II)V + * private (* secondary *) constructor(n: kotlin/Int) + * + * // signature: (Ljava/lang/String;ILjava/lang/String;)V + * private (* secondary *) constructor(s: kotlin/String) + * + * // signature: a()V + * public abstract fun a(): kotlin/Unit + * + * X, + * + * Y, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum E2 { /*public static final*/ X /* = new E2() */, @@ -60,6 +124,26 @@ public enum E2 { //////////////////// +/** + * public final enum class E3 : kotlin/Enum { + * + * // signature: (Ljava/lang/String;ILjava/lang/String;)V + * private constructor(a: kotlin/String) + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String + * public final get + * + * X, + * + * Y, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum E3 { /*public static final*/ X /* = new E3() */, @@ -84,6 +168,39 @@ public enum E3 { //////////////////// +/** + * public final enum class E4 : kotlin/Enum { + * + * // signature: (Ljava/lang/String;ILjava/lang/String;IJZ)V + * private constructor(a: kotlin/String, b: kotlin/Int, c: kotlin/Long, d: kotlin/Boolean) + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String + * public final get + * + * // field: b:I + * // getter: getB()I + * public final val b: kotlin/Int + * public final get + * + * // field: c:J + * // getter: getC()J + * public final val c: kotlin/Long + * public final get + * + * // field: d:Z + * // getter: getD()Z + * public final val d: kotlin/Boolean + * public final get + * + * X, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum E4 { /*public static final*/ X /* = new E4() */; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/abstractEnum.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/abstractEnum.ir.txt index 5f9506948ac..01f44bcbbbb 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/abstractEnum.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/abstractEnum.ir.txt @@ -1,3 +1,28 @@ +/** + * public final enum class E : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * // signature: a()V + * public abstract fun a(): kotlin/Unit + * + * // signature: b()V + * public final fun b(): kotlin/Unit + * + * // nested class: NestedClass + * + * // nested class: Obj + * + * X, + * + * Y, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum E { /*public static final*/ X /* = new E() */, @@ -16,6 +41,15 @@ public enum E { return null; } + /** + * public final class E.NestedClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class NestedClass { @@ -24,6 +58,15 @@ public enum E { } } + /** + * public final object E.Obj : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Obj { @org.jetbrains.annotations.NotNull() @@ -38,6 +81,27 @@ public enum E { //////////////////// +/** + * public final enum class E2 : kotlin/Enum { + * + * // signature: (Ljava/lang/String;II)V + * private (* secondary *) constructor(n: kotlin/Int) + * + * // signature: (Ljava/lang/String;ILjava/lang/String;)V + * private (* secondary *) constructor(s: kotlin/String) + * + * // signature: a()V + * public abstract fun a(): kotlin/Unit + * + * X, + * + * Y, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum E2 { /*public static final*/ X /* = new E2() */, @@ -60,6 +124,26 @@ public enum E2 { //////////////////// +/** + * public final enum class E3 : kotlin/Enum { + * + * // signature: (Ljava/lang/String;ILjava/lang/String;)V + * private constructor(a: kotlin/String) + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String + * public final get + * + * X, + * + * Y, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum E3 { /*public static final*/ X /* = new E3() */, @@ -84,6 +168,39 @@ public enum E3 { //////////////////// +/** + * public final enum class E4 : kotlin/Enum { + * + * // signature: (Ljava/lang/String;ILjava/lang/String;IJZ)V + * private constructor(a: kotlin/String, b: kotlin/Int, c: kotlin/Long, d: kotlin/Boolean) + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String + * public final get + * + * // field: b:I + * // getter: getB()I + * public final val b: kotlin/Int + * public final get + * + * // field: c:J + * // getter: getC()J + * public final val c: kotlin/Long + * public final get + * + * // field: d:Z + * // getter: getD()Z + * public final val d: kotlin/Boolean + * public final get + * + * X, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum E4 { /*public static final*/ X /* = new E4() */; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/abstractEnum.txt b/plugins/kapt3/kapt3-compiler/testData/converter/abstractEnum.txt index f823b47daaa..6ee34eca4c6 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/abstractEnum.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/abstractEnum.txt @@ -1,3 +1,28 @@ +/** + * public final enum class E : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * // signature: a()V + * public abstract fun a(): kotlin/Unit + * + * // signature: b()V + * public final fun b(): kotlin/Unit + * + * // nested class: NestedClass + * + * // nested class: Obj + * + * X, + * + * Y, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum E { /*public static final*/ X /* = new E() */, @@ -11,6 +36,15 @@ public enum E { public final void b() { } + /** + * public final object E.Obj : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Obj { @org.jetbrains.annotations.NotNull() @@ -21,6 +55,15 @@ public enum E { } } + /** + * public final class E.NestedClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class NestedClass { @@ -33,6 +76,27 @@ public enum E { //////////////////// +/** + * public final enum class E2 : kotlin/Enum { + * + * // signature: (Ljava/lang/String;II)V + * private (* secondary *) constructor(n: kotlin/Int) + * + * // signature: (Ljava/lang/String;ILjava/lang/String;)V + * private (* secondary *) constructor(s: kotlin/String) + * + * // signature: a()V + * public abstract fun a(): kotlin/Unit + * + * X, + * + * Y, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum E2 { /*public static final*/ X /* = new E2() */, @@ -50,6 +114,26 @@ public enum E2 { //////////////////// +/** + * public final enum class E3 : kotlin/Enum { + * + * // signature: (Ljava/lang/String;ILjava/lang/String;)V + * private constructor(a: kotlin/String) + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String + * public final get + * + * X, + * + * Y, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum E3 { /*public static final*/ X /* = new E3() */, @@ -69,6 +153,39 @@ public enum E3 { //////////////////// +/** + * public final enum class E4 : kotlin/Enum { + * + * // signature: (Ljava/lang/String;ILjava/lang/String;IJZ)V + * private constructor(a: kotlin/String, b: kotlin/Int, c: kotlin/Long, d: kotlin/Boolean) + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String + * public final get + * + * // field: b:I + * // getter: getB()I + * public final val b: kotlin/Int + * public final get + * + * // field: c:J + * // getter: getC()J + * public final val c: kotlin/Long + * public final get + * + * // field: d:Z + * // getter: getD()Z + * public final val d: kotlin/Boolean + * public final get + * + * X, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum E4 { /*public static final*/ X /* = new E4() */; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/abstractMethods.txt b/plugins/kapt3/kapt3-compiler/testData/converter/abstractMethods.txt index 19aa6f43fc1..df129fc8c6f 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/abstractMethods.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/abstractMethods.txt @@ -1,3 +1,18 @@ +/** + * public abstract class Base : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: doJob(Ljava/lang/String;I)V + * protected abstract fun doJob(job: kotlin/String, delay: kotlin/Int): kotlin/Unit + * + * // signature: doJobGeneric(Ljava/lang/CharSequence;I)V + * protected abstract fun doJobGeneric(job: T#0, delay: kotlin/Int): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract class Base { @@ -15,6 +30,21 @@ public abstract class Base { //////////////////// +/** + * public final class Impl : Base { + * + * // signature: ()V + * public constructor() + * + * // signature: doJob(Ljava/lang/String;I)V + * protected open fun doJob(job: kotlin/String, delay: kotlin/Int): kotlin/Unit + * + * // signature: doJobGeneric(Ljava/lang/CharSequence;I)V + * protected open fun doJobGeneric(job: T#0, delay: kotlin/Int): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Impl extends Base { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/aliasedImports.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/aliasedImports.fir.txt index 61ec5268403..0270752c804 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/aliasedImports.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/aliasedImports.fir.txt @@ -1,5 +1,44 @@ import a.b.ABC; +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: abc:Lerror/NonExistentClass; + * // getter: getAbc()Lerror/NonExistentClass; + * // setter: setAbc(Lerror/NonExistentClass;)V + * public final lateinit var abc: error/NonExistentClass + * public final get + * public final set + * + * // field: bcd:Lerror/NonExistentClass; + * // getter: getBcd()Lerror/NonExistentClass; + * // setter: setBcd(Lerror/NonExistentClass;)V + * public final lateinit var bcd: error/NonExistentClass + * public final get + * public final set + * + * // field: date:LTest$MyDate; + * // getter: getDate()LTest$MyDate; + * // setter: setDate(LTest$MyDate;)V + * public final lateinit var date: Test.MyDate + * public final get + * public final set + * + * // field: timeUnit:Ljava/util/concurrent/TimeUnit; + * // getter: getTimeUnit()Ljava/util/concurrent/TimeUnit; + * // setter: setTimeUnit(Ljava/util/concurrent/TimeUnit;)V + * public final lateinit var timeUnit: java/util/concurrent/TimeUnit + * public final get + * public final set + * + * // nested class: MyDate + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { public Test.MyDate date; @@ -47,6 +86,22 @@ public final class Test { bcd p0) { } + /** + * public final class Test.MyDate : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: date2:LTest$MyDate; + * // getter: getDate2()LTest$MyDate; + * // setter: setDate2(LTest$MyDate;)V + * public final lateinit var date2: Test.MyDate + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class MyDate { public Test.MyDate date2; @@ -69,6 +124,22 @@ public final class Test { //////////////////// +/** + * public final class Test2 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: date:Ljava/util/Date; + * // getter: getDate()Ljava/util/Date; + * // setter: setDate(Ljava/util/Date;)V + * public final lateinit var date: java/util/Date + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test2 { public java.util.Date date; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/aliasedImports.txt b/plugins/kapt3/kapt3-compiler/testData/converter/aliasedImports.txt index cc742ee79b9..89e50c8baa9 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/aliasedImports.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/aliasedImports.txt @@ -2,6 +2,45 @@ import java.util.Date; import java.util.concurrent.TimeUnit; import a.b.ABC; +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: abc:Lerror/NonExistentClass; + * // getter: getAbc()Lerror/NonExistentClass; + * // setter: setAbc(Lerror/NonExistentClass;)V + * public final lateinit var abc: error/NonExistentClass + * public final get + * public final set + * + * // field: bcd:Lerror/NonExistentClass; + * // getter: getBcd()Lerror/NonExistentClass; + * // setter: setBcd(Lerror/NonExistentClass;)V + * public final lateinit var bcd: error/NonExistentClass + * public final get + * public final set + * + * // field: date:LTest$MyDate; + * // getter: getDate()LTest$MyDate; + * // setter: setDate(LTest$MyDate;)V + * public final lateinit var date: Test.MyDate + * public final get + * public final set + * + * // field: timeUnit:Ljava/util/concurrent/TimeUnit; + * // getter: getTimeUnit()Ljava/util/concurrent/TimeUnit; + * // setter: setTimeUnit(Ljava/util/concurrent/TimeUnit;)V + * public final lateinit var timeUnit: java/util/concurrent/TimeUnit + * public final get + * public final set + * + * // nested class: MyDate + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { public Test.MyDate date; @@ -49,6 +88,22 @@ public final class Test { bcd p0) { } + /** + * public final class Test.MyDate : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: date2:LTest$MyDate; + * // getter: getDate2()LTest$MyDate; + * // setter: setDate2(LTest$MyDate;)V + * public final lateinit var date2: Test.MyDate + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class MyDate { public Test.MyDate date2; @@ -75,6 +130,22 @@ import java.util.Date; import java.util.concurrent.TimeUnit; import a.b.ABC; +/** + * public final class Test2 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: date:Ljava/util/Date; + * // getter: getDate()Ljava/util/Date; + * // setter: setDate(Ljava/util/Date;)V + * public final lateinit var date: java/util/Date + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test2 { public java.util.Date date; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/annotationWithFqNames.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/annotationWithFqNames.fir.txt index 3b637ef222b..32924c11cc6 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/annotationWithFqNames.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/annotationWithFqNames.fir.txt @@ -16,6 +16,15 @@ public class Impl { package test; +/** + * public final class test/Bar : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @lib.Anno(impls = {lib.impl.Impl.class, ABC.class}) public final class Bar { @@ -29,6 +38,15 @@ public final class Bar { package test; +/** + * public final class test/Boo : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @lib.Anno(impls = {lib.impl.Impl.class}) public final class Boo { @@ -42,6 +60,15 @@ public final class Boo { package test; +/** + * public final class test/Foo : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @lib.Anno(impls = {lib.impl.Impl.class}) public final class Foo { @@ -55,6 +82,14 @@ public final class Foo { package test; +/** + * package { + * + * public typealias Joo = lib/impl/Impl (* = lib/impl/Impl *) + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE", "ANNOTATION_ARGUMENT_MUST_BE_CONST", "NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION"}) public final class TestKt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/annotationWithFqNames.txt b/plugins/kapt3/kapt3-compiler/testData/converter/annotationWithFqNames.txt index 87d22ce55c9..f10d47841c1 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/annotationWithFqNames.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/annotationWithFqNames.txt @@ -20,6 +20,15 @@ import lib.Anno; import lib.impl.Impl; @lib.Anno(impls = {lib.impl.Impl.class, ABC.class}) +/** + * public final class test/Bar : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Bar { @@ -36,6 +45,15 @@ import lib.Anno; import lib.impl.Impl; @lib.Anno(impls = {lib.impl.Impl.class}) +/** + * public final class test/Boo : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Boo { @@ -52,6 +70,15 @@ import lib.Anno; import lib.impl.Impl; @lib.Anno(impls = {lib.impl.Impl.class}) +/** + * public final class test/Foo : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { @@ -67,6 +94,14 @@ package test; import lib.Anno; import lib.impl.Impl; +/** + * package { + * + * public typealias Joo = lib/impl/Impl (* = lib/impl/Impl *) + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE", "ANNOTATION_ARGUMENT_MUST_BE_CONST", "NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION"}) public final class TestKt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/annotations.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/annotations.fir.txt index f07eadbc56e..7a4def530b5 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/annotations.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/annotations.fir.txt @@ -1,3 +1,12 @@ +/** + * public final annotation class Anno1 : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface Anno1 { @@ -6,6 +15,51 @@ public abstract @interface Anno1 { //////////////////// +/** + * public final annotation class Anno2 : kotlin/Annotation { + * + * // signature: (ILjava/lang/String;[ILkotlin/Array;LAnno1;LColors;Lkotlin/Array;Lkotlin/reflect/KClass;Lkotlin/Array;)V + * public constructor(i: kotlin/Int (* = ... *), s: kotlin/String (* = ... *), ii: kotlin/IntArray (* = ... *), ss: kotlin/Array (* = ... *), a: Anno1, color: Colors (* = ... *), colors: kotlin/Array (* = ... *), clazz: kotlin/reflect/KClass<*>, classes: kotlin/Array>) + * + * // getter: a()LAnno1; + * public final val a: Anno1 + * public final get + * + * // getter: classes()[Ljava/lang/Class; + * public final val classes: kotlin/Array> + * public final get + * + * // getter: clazz()Ljava/lang/Class; + * public final val clazz: kotlin/reflect/KClass<*> + * public final get + * + * // getter: color()LColors; + * public final val color: Colors + * public final get + * + * // getter: colors()[LColors; + * public final val colors: kotlin/Array + * public final get + * + * // getter: i()I + * public final val i: kotlin/Int + * public final get + * + * // getter: ii()[I + * public final val ii: kotlin/IntArray + * public final get + * + * // getter: s()Ljava/lang/String; + * public final val s: kotlin/String + * public final get + * + * // getter: ss()[Ljava/lang/String; + * public final val ss: kotlin/Array + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface Anno2 { @@ -32,6 +86,19 @@ public abstract @interface Anno2 { //////////////////// +/** + * public final annotation class Anno3 : kotlin/Annotation { + * + * // signature: (Ljava/lang/String;)V + * public constructor(value: kotlin/String) + * + * // getter: value()Ljava/lang/String; + * public final val value: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface Anno3 { @@ -42,6 +109,21 @@ public abstract @interface Anno3 { //////////////////// +/** + * public final enum class Colors : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * WHITE, + * + * BLACK, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Colors { /*public static final*/ WHITE /* = new Colors() */, @@ -59,6 +141,21 @@ public enum Colors { //////////////////// +/** + * public final enum class Enum1 : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * BLACK, + * + * WHITE, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Enum1 { /*public static final*/ BLACK /* = new Enum1() */, @@ -77,6 +174,15 @@ public enum Enum1 { //////////////////// +/** + * public final class TestAnno : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @Anno1() @Anno2(a = @Anno1(), clazz = TestAnno.class, classes = {TestAnno.class, Anno1.class}) @@ -91,6 +197,26 @@ public final class TestAnno { //////////////////// +/** + * public final class TestAnno2 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: a(Ljava/lang/String;)V + * public final fun a(param: kotlin/String): kotlin/Unit + * + * // field: b:Ljava/lang/String; + * // getter: getB()Ljava/lang/String; + * // setter: setB(Ljava/lang/String;)V + * // synthetic method for annotations: getB$annotations()V + * public final var b: kotlin/String + * public final (* non-default *) get + * public final (* non-default *) set(value: kotlin/String) + * + * // module name: main + * } + */ @kotlin.Metadata() @Anno3(value = "value") @Anno2(i = 6, s = "BCD", ii = {4, 5, 6}, ss = {"Z", "X"}, a = @Anno1(), color = Colors.WHITE, colors = {Colors.WHITE}, clazz = TestAnno.class, classes = {TestAnno.class, Anno1.class}) diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/annotations.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/annotations.ir.txt index 2d29b8c8223..43d1c8e02ac 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/annotations.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/annotations.ir.txt @@ -1,4 +1,13 @@ @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class Anno1 : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno1 { } @@ -7,6 +16,51 @@ public abstract @interface Anno1 { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class Anno2 : kotlin/Annotation { + * + * // signature: (ILjava/lang/String;[ILkotlin/Array;LAnno1;LColors;Lkotlin/Array;Lkotlin/reflect/KClass;Lkotlin/Array;)V + * public constructor(i: kotlin/Int (* = ... *), s: kotlin/String (* = ... *), ii: kotlin/IntArray (* = ... *), ss: kotlin/Array (* = ... *), a: Anno1, color: Colors (* = ... *), colors: kotlin/Array (* = ... *), clazz: kotlin/reflect/KClass<*>, classes: kotlin/Array>) + * + * // getter: a()LAnno1; + * public final val a: Anno1 + * public final get + * + * // getter: classes()[Ljava/lang/Class; + * public final val classes: kotlin/Array> + * public final get + * + * // getter: clazz()Ljava/lang/Class; + * public final val clazz: kotlin/reflect/KClass<*> + * public final get + * + * // getter: color()LColors; + * public final val color: Colors + * public final get + * + * // getter: colors()[LColors; + * public final val colors: kotlin/Array + * public final get + * + * // getter: i()I + * public final val i: kotlin/Int + * public final get + * + * // getter: ii()[I + * public final val ii: kotlin/IntArray + * public final get + * + * // getter: s()Ljava/lang/String; + * public final val s: kotlin/String + * public final get + * + * // getter: ss()[Ljava/lang/String; + * public final val ss: kotlin/Array + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno2 { @@ -33,6 +87,19 @@ public abstract @interface Anno2 { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class Anno3 : kotlin/Annotation { + * + * // signature: (Ljava/lang/String;)V + * public constructor(value: kotlin/String) + * + * // getter: value()Ljava/lang/String; + * public final val value: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno3 { @@ -42,6 +109,21 @@ public abstract @interface Anno3 { //////////////////// +/** + * public final enum class Colors : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * WHITE, + * + * BLACK, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Colors { /*public static final*/ WHITE /* = new Colors() */, @@ -59,6 +141,21 @@ public enum Colors { //////////////////// +/** + * public final enum class Enum1 : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * BLACK, + * + * WHITE, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Enum1 { /*public static final*/ BLACK /* = new Enum1() */, @@ -80,6 +177,15 @@ public enum Enum1 { @Anno1() @Anno2(a = @Anno1(), clazz = TestAnno.class, classes = {TestAnno.class, Anno1.class}) @Anno3(value = "value") +/** + * public final class TestAnno : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TestAnno { @@ -93,6 +199,26 @@ public final class TestAnno { @Anno3(value = "value") @Anno2(i = 6, s = "BCD", ii = {4, 5, 6}, ss = {"Z", "X"}, a = @Anno1(), color = Colors.WHITE, colors = {Colors.WHITE}, clazz = TestAnno.class, classes = {TestAnno.class, Anno1.class}) +/** + * public final class TestAnno2 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: a(Ljava/lang/String;)V + * public final fun a(param: kotlin/String): kotlin/Unit + * + * // field: b:Ljava/lang/String; + * // getter: getB()Ljava/lang/String; + * // setter: setB(Ljava/lang/String;)V + * // synthetic method for annotations: getB$annotations()V + * public final var b: kotlin/String + * public final (* non-default *) get + * public final (* non-default *) set(: kotlin/String) + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TestAnno2 { @Anno3(value = "field") diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/annotations.txt b/plugins/kapt3/kapt3-compiler/testData/converter/annotations.txt index 11446319fc0..e2a03433395 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/annotations.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/annotations.txt @@ -1,4 +1,13 @@ @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class Anno1 : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno1 { } @@ -7,6 +16,51 @@ public abstract @interface Anno1 { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class Anno2 : kotlin/Annotation { + * + * // signature: (ILjava/lang/String;[ILkotlin/Array;LAnno1;LColors;Lkotlin/Array;Lkotlin/reflect/KClass;Lkotlin/Array;)V + * public constructor(i: kotlin/Int (* = ... *), s: kotlin/String (* = ... *), ii: kotlin/IntArray (* = ... *), ss: kotlin/Array (* = ... *), a: Anno1, color: Colors (* = ... *), colors: kotlin/Array (* = ... *), clazz: kotlin/reflect/KClass<*>, classes: kotlin/Array>) + * + * // getter: a()LAnno1; + * public final val a: Anno1 + * public final get + * + * // getter: classes()[Ljava/lang/Class; + * public final val classes: kotlin/Array> + * public final get + * + * // getter: clazz()Ljava/lang/Class; + * public final val clazz: kotlin/reflect/KClass<*> + * public final get + * + * // getter: color()LColors; + * public final val color: Colors + * public final get + * + * // getter: colors()[LColors; + * public final val colors: kotlin/Array + * public final get + * + * // getter: i()I + * public final val i: kotlin/Int + * public final get + * + * // getter: ii()[I + * public final val ii: kotlin/IntArray + * public final get + * + * // getter: s()Ljava/lang/String; + * public final val s: kotlin/String + * public final get + * + * // getter: ss()[Ljava/lang/String; + * public final val ss: kotlin/Array + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno2 { @@ -33,6 +87,19 @@ public abstract @interface Anno2 { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class Anno3 : kotlin/Annotation { + * + * // signature: (Ljava/lang/String;)V + * public constructor(value: kotlin/String) + * + * // getter: value()Ljava/lang/String; + * public final val value: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno3 { @@ -42,6 +109,21 @@ public abstract @interface Anno3 { //////////////////// +/** + * public final enum class Colors : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * WHITE, + * + * BLACK, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Colors { /*public static final*/ WHITE /* = new Colors() */, @@ -54,6 +136,21 @@ public enum Colors { //////////////////// +/** + * public final enum class Enum1 : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * BLACK, + * + * WHITE, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Enum1 { /*public static final*/ BLACK /* = new Enum1() */, @@ -70,6 +167,15 @@ public enum Enum1 { @Anno1() @Anno2(a = @Anno1(), clazz = TestAnno.class, classes = {TestAnno.class, Anno1.class}) @Anno3(value = "value") +/** + * public final class TestAnno : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TestAnno { @@ -83,6 +189,26 @@ public final class TestAnno { @Anno3(value = "value") @Anno2(i = 6, s = "BCD", ii = {4, 5, 6}, ss = {"Z", "X"}, a = @Anno1(), color = Colors.WHITE, colors = {Colors.WHITE}, clazz = TestAnno.class, classes = {TestAnno.class, Anno1.class}) +/** + * public final class TestAnno2 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: a(Ljava/lang/String;)V + * public final fun a(param: kotlin/String): kotlin/Unit + * + * // field: b:Ljava/lang/String; + * // getter: getB()Ljava/lang/String; + * // setter: setB(Ljava/lang/String;)V + * // synthetic method for annotations: getB$annotations()V + * public final var b: kotlin/String + * public final (* non-default *) get + * public final (* non-default *) set(: kotlin/String) + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TestAnno2 { @Anno3(value = "field") diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/annotations2.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/annotations2.fir.txt index bb1f3926204..43c7f3d59f1 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/annotations2.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/annotations2.fir.txt @@ -1,5 +1,18 @@ package test; +/** + * public final annotation class test/Anno : kotlin/Annotation { + * + * // signature: (Ljava/lang/String;)V + * public constructor(value: kotlin/String) + * + * // getter: value()Ljava/lang/String; + * public final val value: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @Anno(value = "anno-class") @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) @@ -12,6 +25,20 @@ public abstract @interface Anno { package test; +/** + * package { + * + * // signature: topLevelFun(Ljava/lang/String;)V + * public final fun kotlin/String.topLevelFun(): kotlin/Unit + * + * // getter: getTopLevelVal(I)Ljava/lang/String; + * // synthetic method for annotations: getTopLevelVal$annotations(I)V + * public final val kotlin/Int.topLevelVal: kotlin/String + * public final (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.jvm.JvmName(name = "AnnotationsTest") public final class AnnotationsTest { @@ -42,6 +69,26 @@ public final class AnnotationsTest { package test; +/** + * public final enum class test/Enum : kotlin/Enum { + * + * // signature: (Ljava/lang/String;II)V + * private constructor(x: kotlin/Int) + * + * // field: x:I + * // getter: getX()I + * public final val x: kotlin/Int + * public final get + * + * WHITE, + * + * BLACK, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() @Anno(value = "enum") public enum Enum { @@ -70,6 +117,31 @@ public enum Enum { package test; +/** + * public abstract class test/Test : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * protected constructor(v: kotlin/String) + * + * // signature: abstractMethod()Ljava/lang/String; + * public abstract fun abstractMethod(): kotlin/String + * + * // getter: getAbstractVal()Ljava/lang/String; + * // synthetic method for annotations: getAbstractVal$annotations()V + * public abstract val abstractVal: kotlin/String + * public abstract get + * + * // field: v:Ljava/lang/String; + * // getter: getV()Ljava/lang/String; + * // setter: setV(Ljava/lang/String;)V + * // synthetic method for annotations: getV$annotations()V + * public final var v: kotlin/String + * public final (* non-default *) get + * public final (* non-default *) set(value: kotlin/String) + * + * // module name: main + * } + */ @kotlin.Metadata() @Anno(value = "clazz") public abstract class Test { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/annotations2.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/annotations2.ir.txt index c96ef1067a0..1d8f6452920 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/annotations2.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/annotations2.ir.txt @@ -2,6 +2,19 @@ package test; @Anno(value = "anno-class") @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class test/Anno : kotlin/Annotation { + * + * // signature: (Ljava/lang/String;)V + * public constructor(value: kotlin/String) + * + * // getter: value()Ljava/lang/String; + * public final val value: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno { @@ -12,6 +25,20 @@ public abstract @interface Anno { package test; +/** + * package { + * + * // signature: topLevelFun(Ljava/lang/String;)V + * public final fun kotlin/String.topLevelFun(): kotlin/Unit + * + * // getter: getTopLevelVal(I)Ljava/lang/String; + * // synthetic method for annotations: getTopLevelVal$annotations(I)V + * public final val kotlin/Int.topLevelVal: kotlin/String + * public final (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.jvm.JvmName(name = "AnnotationsTest") public final class AnnotationsTest { @@ -43,6 +70,26 @@ public final class AnnotationsTest { package test; @Anno(value = "enum") +/** + * public final enum class test/Enum : kotlin/Enum { + * + * // signature: (Ljava/lang/String;II)V + * private constructor(x: kotlin/Int) + * + * // field: x:I + * // getter: getX()I + * public final val x: kotlin/Int + * public final get + * + * WHITE, + * + * BLACK, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Enum { @Anno(value = "white") @@ -71,6 +118,31 @@ public enum Enum { package test; @Anno(value = "clazz") +/** + * public abstract class test/Test : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * protected constructor(v: kotlin/String) + * + * // signature: abstractMethod()Ljava/lang/String; + * public abstract fun abstractMethod(): kotlin/String + * + * // getter: getAbstractVal()Ljava/lang/String; + * // synthetic method for annotations: getAbstractVal$annotations()V + * public abstract val abstractVal: kotlin/String + * public abstract get + * + * // field: v:Ljava/lang/String; + * // getter: getV()Ljava/lang/String; + * // setter: setV(Ljava/lang/String;)V + * // synthetic method for annotations: getV$annotations()V + * public final var v: kotlin/String + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract class Test { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/annotations2.txt b/plugins/kapt3/kapt3-compiler/testData/converter/annotations2.txt index 2f1e05c1b49..848f344c178 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/annotations2.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/annotations2.txt @@ -2,6 +2,19 @@ package test; @Anno(value = "anno-class") @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class test/Anno : kotlin/Annotation { + * + * // signature: (Ljava/lang/String;)V + * public constructor(value: kotlin/String) + * + * // getter: value()Ljava/lang/String; + * public final val value: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno { @@ -12,6 +25,20 @@ public abstract @interface Anno { package test; +/** + * package { + * + * // signature: topLevelFun(Ljava/lang/String;)V + * public final fun kotlin/String.topLevelFun(): kotlin/Unit + * + * // getter: getTopLevelVal(I)Ljava/lang/String; + * // synthetic method for annotations: getTopLevelVal$annotations(I)V + * public final val kotlin/Int.topLevelVal: kotlin/String + * public final (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.jvm.JvmName(name = "AnnotationsTest") public final class AnnotationsTest { @@ -43,6 +70,26 @@ public final class AnnotationsTest { package test; @Anno(value = "enum") +/** + * public final enum class test/Enum : kotlin/Enum { + * + * // signature: (Ljava/lang/String;II)V + * private constructor(x: kotlin/Int) + * + * // field: x:I + * // getter: getX()I + * public final val x: kotlin/Int + * public final get + * + * WHITE, + * + * BLACK, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Enum { @Anno(value = "white") @@ -66,6 +113,31 @@ public enum Enum { package test; @Anno(value = "clazz") +/** + * public abstract class test/Test : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * protected constructor(v: kotlin/String) + * + * // signature: abstractMethod()Ljava/lang/String; + * public abstract fun abstractMethod(): kotlin/String + * + * // getter: getAbstractVal()Ljava/lang/String; + * // synthetic method for annotations: getAbstractVal$annotations()V + * public abstract val abstractVal: kotlin/String + * public abstract get + * + * // field: v:Ljava/lang/String; + * // getter: getV()Ljava/lang/String; + * // setter: setV(Ljava/lang/String;)V + * // synthetic method for annotations: getV$annotations()V + * public final var v: kotlin/String + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract class Test { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/annotations3.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/annotations3.fir.txt index 6b68a4df568..78de8575b82 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/annotations3.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/annotations3.fir.txt @@ -1,3 +1,12 @@ +/** + * public final class B : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class B { @@ -9,6 +18,15 @@ public final class B { //////////////////// +/** + * public final object BParceler : Parceler { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class BParceler implements Parceler { @org.jetbrains.annotations.NotNull() @@ -22,6 +40,15 @@ public final class BParceler implements Parceler { //////////////////// +/** + * public final class C : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class C { @@ -33,6 +60,15 @@ public final class C { //////////////////// +/** + * public final object CParceler : Parceler { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class CParceler implements Parceler { @org.jetbrains.annotations.NotNull() @@ -46,6 +82,12 @@ public final class CParceler implements Parceler { //////////////////// +/** + * public abstract interface Parceler : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Parceler { } @@ -53,6 +95,15 @@ public abstract interface Parceler { //////////////////// +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @TypeParceler() @TypeParceler() @@ -66,6 +117,15 @@ public final class Test { //////////////////// +/** + * public final annotation class TypeParceler> : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.annotation.Retention(value = kotlin.annotation.AnnotationRetention.SOURCE) @kotlin.annotation.Repeatable() @@ -75,6 +135,15 @@ public final class Test { @java.lang.annotation.Target(value = {java.lang.annotation.ElementType.TYPE}) public abstract @interface TypeParceler> { + /** + * public final annotation class TypeParceler> : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.annotation.Retention(value = kotlin.annotation.AnnotationRetention.SOURCE) @kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.CLASS, kotlin.annotation.AnnotationTarget.PROPERTY}) diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/annotations3.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/annotations3.ir.txt index 2db7b6b39f1..7dfd5a13f60 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/annotations3.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/annotations3.ir.txt @@ -1,3 +1,12 @@ +/** + * public final class B : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class B { @@ -9,6 +18,15 @@ public final class B { //////////////////// +/** + * public final object BParceler : Parceler { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class BParceler implements Parceler { @org.jetbrains.annotations.NotNull() @@ -22,6 +40,15 @@ public final class BParceler implements Parceler { //////////////////// +/** + * public final class C : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class C { @@ -33,6 +60,15 @@ public final class C { //////////////////// +/** + * public final object CParceler : Parceler { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class CParceler implements Parceler { @org.jetbrains.annotations.NotNull() @@ -46,6 +82,12 @@ public final class CParceler implements Parceler { //////////////////// +/** + * public abstract interface Parceler : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Parceler { } @@ -53,6 +95,15 @@ public abstract interface Parceler { //////////////////// +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @TypeParceler() @TypeParceler() @@ -72,6 +123,15 @@ public final class Test { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target(value = {java.lang.annotation.ElementType.TYPE}) @java.lang.annotation.Repeatable(value = TypeParceler.Container.class) +/** + * public final annotation class TypeParceler> : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface TypeParceler> extends java.lang.annotation.Annotation { @@ -80,6 +140,9 @@ public abstract @interface TypeParceler()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class B { @@ -9,6 +18,15 @@ public final class B { //////////////////// +/** + * public final object BParceler : Parceler { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class BParceler implements Parceler { @org.jetbrains.annotations.NotNull() @@ -22,6 +40,15 @@ public final class BParceler implements Parceler { //////////////////// +/** + * public final class C : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class C { @@ -33,6 +60,15 @@ public final class C { //////////////////// +/** + * public final object CParceler : Parceler { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class CParceler implements Parceler { @org.jetbrains.annotations.NotNull() @@ -46,6 +82,12 @@ public final class CParceler implements Parceler { //////////////////// +/** + * public abstract interface Parceler : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Parceler { } @@ -53,6 +95,15 @@ public abstract interface Parceler { //////////////////// +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @TypeParceler() @TypeParceler() @@ -71,6 +122,15 @@ public final class Test { @kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.CLASS, kotlin.annotation.AnnotationTarget.PROPERTY}) @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target(value = {java.lang.annotation.ElementType.TYPE}) +/** + * public final annotation class TypeParceler> : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface TypeParceler> extends java.lang.annotation.Annotation { } diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/annotationsWithConstants.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/annotationsWithConstants.fir.txt index 55ebec90c08..0baed2cc0e3 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/annotationsWithConstants.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/annotationsWithConstants.fir.txt @@ -1,5 +1,50 @@ package app; +/** + * public final annotation class app/Anno : kotlin/Annotation { + * + * // signature: (ZBISJCFDLjava/lang/String;)V + * public constructor(a1: kotlin/Boolean, a2: kotlin/Byte, a3: kotlin/Int, a4: kotlin/Short, a5: kotlin/Long, a6: kotlin/Char, a7: kotlin/Float, a8: kotlin/Double, a9: kotlin/String) + * + * // getter: a1()Z + * public final val a1: kotlin/Boolean + * public final get + * + * // getter: a2()B + * public final val a2: kotlin/Byte + * public final get + * + * // getter: a3()I + * public final val a3: kotlin/Int + * public final get + * + * // getter: a4()S + * public final val a4: kotlin/Short + * public final get + * + * // getter: a5()J + * public final val a5: kotlin/Long + * public final get + * + * // getter: a6()C + * public final val a6: kotlin/Char + * public final get + * + * // getter: a7()F + * public final val a7: kotlin/Float + * public final get + * + * // getter: a8()D + * public final val a8: kotlin/Double + * public final get + * + * // getter: a9()Ljava/lang/String; + * public final val a9: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface Anno { @@ -55,6 +100,19 @@ public class B { package app; +/** + * public final annotation class app/Bind : kotlin/Annotation { + * + * // signature: (I)V + * public constructor(id: kotlin/Int) + * + * // getter: id()I + * public final val id: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface Bind { @@ -66,6 +124,19 @@ public abstract @interface Bind { package app; +/** + * public final annotation class app/BindField : kotlin/Annotation { + * + * // signature: (I)V + * public constructor(id: kotlin/Int) + * + * // getter: id()I + * public final val id: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.FIELD}) @java.lang.annotation.Target(value = {java.lang.annotation.ElementType.FIELD}) @@ -79,6 +150,23 @@ public abstract @interface BindField { package app; +/** + * public final object app/JJ : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // signature: c()Ljava/lang/String; + * public final fun c(): kotlin/String + * + * // field: b:Ljava/lang/String; + * // getter: getB()Ljava/lang/String; + * public final val b: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class JJ { @org.jetbrains.annotations.NotNull() @@ -105,6 +193,19 @@ public final class JJ { package app; +/** + * public final annotation class app/MultiValue : kotlin/Annotation { + * + * // signature: ([I)V + * public constructor(ids: kotlin/IntArray) + * + * // getter: ids()[I + * public final val ids: kotlin/IntArray + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface MultiValue { @@ -116,6 +217,19 @@ public abstract @interface MultiValue { package app; +/** + * public final annotation class app/MultiValueByte : kotlin/Annotation { + * + * // signature: ([B)V + * public constructor(ids: kotlin/ByteArray) + * + * // getter: ids()[B + * public final val ids: kotlin/ByteArray + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface MultiValueByte { @@ -127,6 +241,19 @@ public abstract @interface MultiValueByte { package app; +/** + * public final annotation class app/MultiValueString : kotlin/Annotation { + * + * // signature: (Lkotlin/Array;)V + * public constructor(ids: kotlin/Array) + * + * // getter: ids()[Ljava/lang/String; + * public final val ids: kotlin/Array + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface MultiValueString { @@ -138,6 +265,123 @@ public abstract @interface MultiValueString { package app; +/** + * public final class app/MyActivity : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: foo()V + * public final fun foo(): kotlin/Unit + * + * // signature: foo2()V + * public final fun foo2(): kotlin/Unit + * + * // signature: foo3()V + * public final fun foo3(): kotlin/Unit + * + * // signature: foo4()V + * public final fun foo4(): kotlin/Unit + * + * // signature: foo5()V + * public final fun foo5(): kotlin/Unit + * + * // signature: multi0()V + * public final fun multi0(): kotlin/Unit + * + * // signature: multi1()V + * public final fun multi1(): kotlin/Unit + * + * // signature: multi2()V + * public final fun multi2(): kotlin/Unit + * + * // signature: multi3()V + * public final fun multi3(): kotlin/Unit + * + * // signature: multi4()V + * public final fun multi4(): kotlin/Unit + * + * // signature: multi5()V + * public final fun multi5(): kotlin/Unit + * + * // signature: multiJava1()V + * public final fun multiJava1(): kotlin/Unit + * + * // signature: multiJava2()V + * public final fun multiJava2(): kotlin/Unit + * + * // signature: plainIntConstant()V + * public final fun plainIntConstant(): kotlin/Unit + * + * // field: a:I + * // getter: getA()I + * // synthetic method for annotations: getA$annotations()V + * public final val a: kotlin/Int (* = ... *) + * public final get + * + * // field: b:I + * // getter: getB()I + * // synthetic method for annotations: getB$annotations()V + * public final val b: kotlin/Int (* = ... *) + * public final get + * + * // field: c:I + * // getter: getC()I + * // synthetic method for annotations: getC$annotations()V + * public final val c: kotlin/Int (* = ... *) + * public final get + * + * // field: d:I + * // getter: getD()I + * // synthetic method for annotations: getD$annotations()V + * public final val d: kotlin/Int (* = ... *) + * public final get + * + * // field: e:I + * // getter: getE()I + * // synthetic method for annotations: getE$annotations()V + * public final val e: kotlin/Int (* = ... *) + * public final get + * + * // field: f:I + * // getter: getF()I + * // synthetic method for annotations: getF$annotations()V + * public final val f: kotlin/Int (* = ... *) + * public final get + * + * // field: propB:I + * // getter: getPropB()I + * public final val propB: kotlin/Int (* = ... *) + * public final get + * + * // field: propC:I + * // getter: getPropC()I + * // setter: setPropC(I)V + * public final var propC: kotlin/Int + * public final get + * public final set + * + * // field: propF:I + * // getter: getPropF()I + * public final val propF: kotlin/Int + * public final get + * + * // field: propA:I + * public final const val propA: kotlin/Int (* = ... *) + * public final get + * + * // field: propD:I + * public final val propD: kotlin/Int (* = ... *) + * public final get + * + * // field: propE:I + * public final var propE: kotlin/Int + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public final class MyActivity { @BindField(id = 100) diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/annotationsWithConstants.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/annotationsWithConstants.ir.txt index c4843c89ef8..24967be1755 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/annotationsWithConstants.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/annotationsWithConstants.ir.txt @@ -1,6 +1,51 @@ package app; @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class app/Anno : kotlin/Annotation { + * + * // signature: (ZBISJCFDLjava/lang/String;)V + * public constructor(a1: kotlin/Boolean, a2: kotlin/Byte, a3: kotlin/Int, a4: kotlin/Short, a5: kotlin/Long, a6: kotlin/Char, a7: kotlin/Float, a8: kotlin/Double, a9: kotlin/String) + * + * // getter: a1()Z + * public final val a1: kotlin/Boolean + * public final get + * + * // getter: a2()B + * public final val a2: kotlin/Byte + * public final get + * + * // getter: a3()I + * public final val a3: kotlin/Int + * public final get + * + * // getter: a4()S + * public final val a4: kotlin/Short + * public final get + * + * // getter: a5()J + * public final val a5: kotlin/Long + * public final get + * + * // getter: a6()C + * public final val a6: kotlin/Char + * public final get + * + * // getter: a7()F + * public final val a7: kotlin/Float + * public final get + * + * // getter: a8()D + * public final val a8: kotlin/Double + * public final get + * + * // getter: a9()Ljava/lang/String; + * public final val a9: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno { @@ -56,6 +101,19 @@ public class B { package app; @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class app/Bind : kotlin/Annotation { + * + * // signature: (I)V + * public constructor(id: kotlin/Int) + * + * // getter: id()I + * public final val id: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Bind { @@ -69,6 +127,19 @@ package app; @kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.FIELD}) @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(value = {java.lang.annotation.ElementType.FIELD}) +/** + * public final annotation class app/BindField : kotlin/Annotation { + * + * // signature: (I)V + * public constructor(id: kotlin/Int) + * + * // getter: id()I + * public final val id: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface BindField { @@ -79,6 +150,23 @@ public abstract @interface BindField { package app; +/** + * public final object app/JJ : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // signature: c()Ljava/lang/String; + * public final fun c(): kotlin/String + * + * // field: b:Ljava/lang/String; + * // getter: getB()Ljava/lang/String; + * public final val b: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class JJ { @org.jetbrains.annotations.NotNull() @@ -106,6 +194,19 @@ public final class JJ { package app; @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class app/MultiValue : kotlin/Annotation { + * + * // signature: ([I)V + * public constructor(ids: kotlin/IntArray) + * + * // getter: ids()[I + * public final val ids: kotlin/IntArray + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface MultiValue { @@ -117,6 +218,19 @@ public abstract @interface MultiValue { package app; @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class app/MultiValueByte : kotlin/Annotation { + * + * // signature: ([B)V + * public constructor(ids: kotlin/ByteArray) + * + * // getter: ids()[B + * public final val ids: kotlin/ByteArray + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface MultiValueByte { @@ -128,6 +242,19 @@ public abstract @interface MultiValueByte { package app; @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class app/MultiValueString : kotlin/Annotation { + * + * // signature: (Lkotlin/Array;)V + * public constructor(ids: kotlin/Array) + * + * // getter: ids()[Ljava/lang/String; + * public final val ids: kotlin/Array + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface MultiValueString { @@ -138,6 +265,123 @@ public abstract @interface MultiValueString { package app; +/** + * public final class app/MyActivity : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: foo()V + * public final fun foo(): kotlin/Unit + * + * // signature: foo2()V + * public final fun foo2(): kotlin/Unit + * + * // signature: foo3()V + * public final fun foo3(): kotlin/Unit + * + * // signature: foo4()V + * public final fun foo4(): kotlin/Unit + * + * // signature: foo5()V + * public final fun foo5(): kotlin/Unit + * + * // signature: multi0()V + * public final fun multi0(): kotlin/Unit + * + * // signature: multi1()V + * public final fun multi1(): kotlin/Unit + * + * // signature: multi2()V + * public final fun multi2(): kotlin/Unit + * + * // signature: multi3()V + * public final fun multi3(): kotlin/Unit + * + * // signature: multi4()V + * public final fun multi4(): kotlin/Unit + * + * // signature: multi5()V + * public final fun multi5(): kotlin/Unit + * + * // signature: multiJava1()V + * public final fun multiJava1(): kotlin/Unit + * + * // signature: multiJava2()V + * public final fun multiJava2(): kotlin/Unit + * + * // signature: plainIntConstant()V + * public final fun plainIntConstant(): kotlin/Unit + * + * // field: a:I + * // getter: getA()I + * // synthetic method for annotations: getA$annotations()V + * public final val a: kotlin/Int (* = ... *) + * public final get + * + * // field: b:I + * // getter: getB()I + * // synthetic method for annotations: getB$annotations()V + * public final val b: kotlin/Int (* = ... *) + * public final get + * + * // field: c:I + * // getter: getC()I + * // synthetic method for annotations: getC$annotations()V + * public final val c: kotlin/Int (* = ... *) + * public final get + * + * // field: d:I + * // getter: getD()I + * // synthetic method for annotations: getD$annotations()V + * public final val d: kotlin/Int (* = ... *) + * public final get + * + * // field: e:I + * // getter: getE()I + * // synthetic method for annotations: getE$annotations()V + * public final val e: kotlin/Int (* = ... *) + * public final get + * + * // field: f:I + * // getter: getF()I + * // synthetic method for annotations: getF$annotations()V + * public final val f: kotlin/Int (* = ... *) + * public final get + * + * // field: propB:I + * // getter: getPropB()I + * public final val propB: kotlin/Int (* = ... *) + * public final get + * + * // field: propC:I + * // getter: getPropC()I + * // setter: setPropC(I)V + * public final var propC: kotlin/Int + * public final get + * public final set + * + * // field: propF:I + * // getter: getPropF()I + * public final val propF: kotlin/Int + * public final get + * + * // field: propA:I + * public final const val propA: kotlin/Int (* = ... *) + * public final get + * + * // field: propD:I + * public final val propD: kotlin/Int (* = ... *) + * public final get + * + * // field: propE:I + * public final var propE: kotlin/Int + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public final class MyActivity { @BindField(id = lib.R.id.textView) diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/annotationsWithConstants.txt b/plugins/kapt3/kapt3-compiler/testData/converter/annotationsWithConstants.txt index f038f1ad6ea..6dcf5a24383 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/annotationsWithConstants.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/annotationsWithConstants.txt @@ -1,6 +1,51 @@ package app; @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class app/Anno : kotlin/Annotation { + * + * // signature: (ZBISJCFDLjava/lang/String;)V + * public constructor(a1: kotlin/Boolean, a2: kotlin/Byte, a3: kotlin/Int, a4: kotlin/Short, a5: kotlin/Long, a6: kotlin/Char, a7: kotlin/Float, a8: kotlin/Double, a9: kotlin/String) + * + * // getter: a1()Z + * public final val a1: kotlin/Boolean + * public final get + * + * // getter: a2()B + * public final val a2: kotlin/Byte + * public final get + * + * // getter: a3()I + * public final val a3: kotlin/Int + * public final get + * + * // getter: a4()S + * public final val a4: kotlin/Short + * public final get + * + * // getter: a5()J + * public final val a5: kotlin/Long + * public final get + * + * // getter: a6()C + * public final val a6: kotlin/Char + * public final get + * + * // getter: a7()F + * public final val a7: kotlin/Float + * public final get + * + * // getter: a8()D + * public final val a8: kotlin/Double + * public final get + * + * // getter: a9()Ljava/lang/String; + * public final val a9: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno { @@ -56,6 +101,19 @@ public class B { package app; @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class app/Bind : kotlin/Annotation { + * + * // signature: (I)V + * public constructor(id: kotlin/Int) + * + * // getter: id()I + * public final val id: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Bind { @@ -69,6 +127,19 @@ package app; @kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.FIELD}) @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(value = {java.lang.annotation.ElementType.FIELD}) +/** + * public final annotation class app/BindField : kotlin/Annotation { + * + * // signature: (I)V + * public constructor(id: kotlin/Int) + * + * // getter: id()I + * public final val id: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface BindField { @@ -79,6 +150,23 @@ public abstract @interface BindField { package app; +/** + * public final object app/JJ : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // signature: c()Ljava/lang/String; + * public final fun c(): kotlin/String + * + * // field: b:Ljava/lang/String; + * // getter: getB()Ljava/lang/String; + * public final val b: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class JJ { @org.jetbrains.annotations.NotNull() @@ -106,6 +194,19 @@ public final class JJ { package app; @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class app/MultiValue : kotlin/Annotation { + * + * // signature: ([I)V + * public constructor(ids: kotlin/IntArray) + * + * // getter: ids()[I + * public final val ids: kotlin/IntArray + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface MultiValue { @@ -117,6 +218,19 @@ public abstract @interface MultiValue { package app; @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class app/MultiValueByte : kotlin/Annotation { + * + * // signature: ([B)V + * public constructor(ids: kotlin/ByteArray) + * + * // getter: ids()[B + * public final val ids: kotlin/ByteArray + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface MultiValueByte { @@ -128,6 +242,19 @@ public abstract @interface MultiValueByte { package app; @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class app/MultiValueString : kotlin/Annotation { + * + * // signature: (Lkotlin/Array;)V + * public constructor(ids: kotlin/Array) + * + * // getter: ids()[Ljava/lang/String; + * public final val ids: kotlin/Array + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface MultiValueString { @@ -138,6 +265,123 @@ public abstract @interface MultiValueString { package app; +/** + * public final class app/MyActivity : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: foo()V + * public final fun foo(): kotlin/Unit + * + * // signature: foo2()V + * public final fun foo2(): kotlin/Unit + * + * // signature: foo3()V + * public final fun foo3(): kotlin/Unit + * + * // signature: foo4()V + * public final fun foo4(): kotlin/Unit + * + * // signature: foo5()V + * public final fun foo5(): kotlin/Unit + * + * // signature: multi0()V + * public final fun multi0(): kotlin/Unit + * + * // signature: multi1()V + * public final fun multi1(): kotlin/Unit + * + * // signature: multi2()V + * public final fun multi2(): kotlin/Unit + * + * // signature: multi3()V + * public final fun multi3(): kotlin/Unit + * + * // signature: multi4()V + * public final fun multi4(): kotlin/Unit + * + * // signature: multi5()V + * public final fun multi5(): kotlin/Unit + * + * // signature: multiJava1()V + * public final fun multiJava1(): kotlin/Unit + * + * // signature: multiJava2()V + * public final fun multiJava2(): kotlin/Unit + * + * // signature: plainIntConstant()V + * public final fun plainIntConstant(): kotlin/Unit + * + * // field: a:I + * // getter: getA()I + * // synthetic method for annotations: getA$annotations()V + * public final val a: kotlin/Int (* = ... *) + * public final get + * + * // field: b:I + * // getter: getB()I + * // synthetic method for annotations: getB$annotations()V + * public final val b: kotlin/Int (* = ... *) + * public final get + * + * // field: c:I + * // getter: getC()I + * // synthetic method for annotations: getC$annotations()V + * public final val c: kotlin/Int (* = ... *) + * public final get + * + * // field: d:I + * // getter: getD()I + * // synthetic method for annotations: getD$annotations()V + * public final val d: kotlin/Int (* = ... *) + * public final get + * + * // field: e:I + * // getter: getE()I + * // synthetic method for annotations: getE$annotations()V + * public final val e: kotlin/Int (* = ... *) + * public final get + * + * // field: f:I + * // getter: getF()I + * // synthetic method for annotations: getF$annotations()V + * public final val f: kotlin/Int (* = ... *) + * public final get + * + * // field: propB:I + * // getter: getPropB()I + * public final val propB: kotlin/Int (* = ... *) + * public final get + * + * // field: propC:I + * // getter: getPropC()I + * // setter: setPropC(I)V + * public final var propC: kotlin/Int + * public final get + * public final set + * + * // field: propF:I + * // getter: getPropF()I + * public final val propF: kotlin/Int + * public final get + * + * // field: propA:I + * public final const val propA: kotlin/Int (* = ... *) + * public final get + * + * // field: propD:I + * public final val propD: kotlin/Int (* = ... *) + * public final get + * + * // field: propE:I + * public final var propE: kotlin/Int + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public final class MyActivity { @BindField(id = lib.R.id.textView) diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/annotationsWithTargets.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/annotationsWithTargets.fir.txt index 9ee34a08714..f756891b60e 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/annotationsWithTargets.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/annotationsWithTargets.fir.txt @@ -1,3 +1,12 @@ +/** + * public final annotation class Anno : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface Anno { @@ -6,6 +15,21 @@ public abstract @interface Anno { //////////////////// +/** + * public final class Bar : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * // synthetic method for annotations: getA$annotations()V + * public final val a: kotlin/String (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Bar { @FieldAnno() @@ -31,6 +55,20 @@ public final class Bar { //////////////////// +/** + * public final class Baz : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: a:Ljava/lang/String; + * // synthetic method for annotations: getA$annotations()V + * public final val a: kotlin/String (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Baz { @FieldAnno() @@ -51,6 +89,15 @@ public final class Baz { //////////////////// +/** + * public final annotation class FieldAnno : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.FIELD}) @java.lang.annotation.Target(value = {java.lang.annotation.ElementType.FIELD}) @@ -61,6 +108,21 @@ public abstract @interface FieldAnno { //////////////////// +/** + * public final class Foo : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * public constructor(a: kotlin/String) + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * // synthetic method for annotations: getA$annotations()V + * public final val a: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { @FieldAnno() @@ -88,6 +150,15 @@ public final class Foo { //////////////////// +/** + * public final annotation class ParameterAnno : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.VALUE_PARAMETER}) @java.lang.annotation.Target(value = {java.lang.annotation.ElementType.PARAMETER}) @@ -98,6 +169,15 @@ public abstract @interface ParameterAnno { //////////////////// +/** + * public final annotation class PropertyAnno : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.PROPERTY}) @java.lang.annotation.Target(value = {}) diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/annotationsWithTargets.txt b/plugins/kapt3/kapt3-compiler/testData/converter/annotationsWithTargets.txt index d6a07d3cb74..2417be86491 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/annotationsWithTargets.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/annotationsWithTargets.txt @@ -1,4 +1,13 @@ @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class Anno : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno { } @@ -6,6 +15,21 @@ public abstract @interface Anno { //////////////////// +/** + * public final class Bar : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * // synthetic method for annotations: getA$annotations()V + * public final val a: kotlin/String (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Bar { @FieldAnno() @@ -31,6 +55,20 @@ public final class Bar { //////////////////// +/** + * public final class Baz : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: a:Ljava/lang/String; + * // synthetic method for annotations: getA$annotations()V + * public final val a: kotlin/String (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Baz { @FieldAnno() @@ -54,6 +92,15 @@ public final class Baz { @kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.FIELD}) @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(value = {java.lang.annotation.ElementType.FIELD}) +/** + * public final annotation class FieldAnno : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface FieldAnno { } @@ -61,6 +108,21 @@ public abstract @interface FieldAnno { //////////////////// +/** + * public final class Foo : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * public constructor(a: kotlin/String) + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * // synthetic method for annotations: getA$annotations()V + * public final val a: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { @FieldAnno() @@ -91,6 +153,15 @@ public final class Foo { @kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.VALUE_PARAMETER}) @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(value = {java.lang.annotation.ElementType.PARAMETER}) +/** + * public final annotation class ParameterAnno : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface ParameterAnno { } @@ -101,6 +172,15 @@ public abstract @interface ParameterAnno { @kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.PROPERTY}) @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(value = {}) +/** + * public final annotation class PropertyAnno : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface PropertyAnno { } diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/anonymousDelegate.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/anonymousDelegate.fir.txt index d7354dea6ab..21e068c4517 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/anonymousDelegate.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/anonymousDelegate.fir.txt @@ -1,3 +1,16 @@ +/** + * package { + * + * // field: delegate$delegate:Ljava/lang/Object; + * // getter: getDelegate()Ljava/lang/Object; + * // setter: setDelegate(Ljava/lang/Object;)V + * public final (* delegated *) var delegate: kotlin/Any + * public final (* non-default *) get + * public final (* non-default *) set(: kotlin/Any) + * + * // module name: main + * } + */ @kotlin.Metadata() public final class AnonymousDelegateKt { @@ -20,6 +33,18 @@ public final class AnonymousDelegateKt { //////////////////// +/** + * public final class ConcreteDelegate : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: getValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;)I + * public final operator fun getValue(t: kotlin/Any?, p: kotlin/reflect/KProperty<*>): kotlin/Int + * + * // module name: main + * } + */ @kotlin.Metadata() public final class ConcreteDelegate { @@ -37,6 +62,39 @@ public final class ConcreteDelegate { //////////////////// +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: broken$delegate:Ljava/lang/Object; + * // getter: getBroken()Ljava/lang/Object; + * // setter: setBroken(Ljava/lang/Object;)V + * public final (* delegated *) var broken: kotlin/Any + * public final (* non-default *) get + * public final (* non-default *) set(: kotlin/Any) + * + * // field: concreteDelegate$delegate:LConcreteDelegate; + * // getter: getConcreteDelegate()I + * public final (* delegated *) val concreteDelegate: kotlin/Int + * public final (* non-default *) get + * + * // field: lazyProp$delegate:Lkotlin/Lazy; + * // getter: getLazyProp()Ljava/lang/Runnable; + * private final (* delegated *) val lazyProp: . + * private final (* non-default *) get + * + * // field: overridden$delegate:Ljava/io/Serializable; + * // getter: getOverridden()Ljava/lang/Object; + * // setter: setOverridden(Ljava/lang/Object;)V + * public final (* delegated *) var overridden: kotlin/Any + * public final (* non-default *) get + * public final (* non-default *) set(: kotlin/Any) + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/anonymousDelegate.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/anonymousDelegate.ir.txt index 1da85d6ff27..8541ccc7f5a 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/anonymousDelegate.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/anonymousDelegate.ir.txt @@ -1,5 +1,18 @@ import kotlin.reflect.KProperty; +/** + * package { + * + * // field: delegate$delegate:Ljava/lang/Object; + * // getter: getDelegate()Ljava/lang/Object; + * // setter: setDelegate(Ljava/lang/Object;)V + * public final (* delegated *) var delegate: kotlin/Any + * public final (* non-default *) get + * public final (* non-default *) set(: kotlin/Any) + * + * // module name: main + * } + */ @kotlin.Metadata() public final class AnonymousDelegateKt { @@ -24,6 +37,18 @@ public final class AnonymousDelegateKt { import kotlin.reflect.KProperty; +/** + * public final class ConcreteDelegate : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: getValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;)I + * public final operator fun getValue(t: kotlin/Any?, p: kotlin/reflect/KProperty<*>): kotlin/Int + * + * // module name: main + * } + */ @kotlin.Metadata() public final class ConcreteDelegate { @@ -43,6 +68,39 @@ public final class ConcreteDelegate { import kotlin.reflect.KProperty; +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: broken$delegate:Ljava/lang/Object; + * // getter: getBroken()Ljava/lang/Object; + * // setter: setBroken(Ljava/lang/Object;)V + * public final (* delegated *) var broken: kotlin/Any + * public final (* non-default *) get + * public final (* non-default *) set(: kotlin/Any) + * + * // field: concreteDelegate$delegate:LConcreteDelegate; + * // getter: getConcreteDelegate()I + * public final (* delegated *) val concreteDelegate: kotlin/Int + * public final (* non-default *) get + * + * // field: lazyProp$delegate:Lkotlin/Lazy; + * // getter: getLazyProp()Ljava/lang/Runnable; + * private final (* delegated *) val lazyProp: java/lang/Runnable + * private final (* non-default *) get + * + * // field: overridden$delegate:Ljava/io/Serializable; + * // getter: getOverridden()Ljava/lang/Object; + * // setter: setOverridden(Ljava/lang/Object;)V + * public final (* delegated *) var overridden: kotlin/Any + * public final (* non-default *) get + * public final (* non-default *) set(: kotlin/Any) + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/anonymousDelegate.txt b/plugins/kapt3/kapt3-compiler/testData/converter/anonymousDelegate.txt index 8ee16ce23b3..14baf00ddea 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/anonymousDelegate.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/anonymousDelegate.txt @@ -1,5 +1,18 @@ import kotlin.reflect.KProperty; +/** + * package { + * + * // field: delegate$delegate:LAnonymousDelegateKt$delegate$2; + * // getter: getDelegate()Ljava/lang/Object; + * // setter: setDelegate(Ljava/lang/Object;)V + * public final (* delegated *) var delegate: kotlin/Any + * public final (* non-default *) get + * public final (* non-default *) set(: kotlin/Any) + * + * // module name: main + * } + */ @kotlin.Metadata() public final class AnonymousDelegateKt { @@ -24,6 +37,18 @@ public final class AnonymousDelegateKt { import kotlin.reflect.KProperty; +/** + * public final class ConcreteDelegate : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: getValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;)I + * public final operator fun getValue(t: kotlin/Any?, p: kotlin/reflect/KProperty<*>): kotlin/Int + * + * // module name: main + * } + */ @kotlin.Metadata() public final class ConcreteDelegate { @@ -43,6 +68,39 @@ public final class ConcreteDelegate { import kotlin.reflect.KProperty; +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: broken$delegate:LTest$broken$2; + * // getter: getBroken()Ljava/lang/Object; + * // setter: setBroken(Ljava/lang/Object;)V + * public final (* delegated *) var broken: kotlin/Any + * public final (* non-default *) get + * public final (* non-default *) set(: kotlin/Any) + * + * // field: concreteDelegate$delegate:LConcreteDelegate; + * // getter: getConcreteDelegate()I + * public final (* delegated *) val concreteDelegate: kotlin/Int + * public final (* non-default *) get + * + * // field: lazyProp$delegate:Lkotlin/Lazy; + * // getter: getLazyProp()Ljava/lang/Runnable; + * private final (* delegated *) val lazyProp: java/lang/Runnable + * private final (* non-default *) get + * + * // field: overridden$delegate:LTest$overridden$2; + * // getter: getOverridden()Ljava/lang/Object; + * // setter: setOverridden(Ljava/lang/Object;)V + * public final (* delegated *) var overridden: kotlin/Any + * public final (* non-default *) get + * public final (* non-default *) set(: kotlin/Any) + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/anonymousInitializer.txt b/plugins/kapt3/kapt3-compiler/testData/converter/anonymousInitializer.txt index 35ef20ecdc9..9186b905d6e 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/anonymousInitializer.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/anonymousInitializer.txt @@ -1,3 +1,15 @@ +/** + * public final class C : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: f()V + * public final fun f(): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public final class C { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/anonymousObjectInEnumSuperConstructor.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/anonymousObjectInEnumSuperConstructor.ir.txt index ef860e4e2a8..e8175ad1c20 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/anonymousObjectInEnumSuperConstructor.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/anonymousObjectInEnumSuperConstructor.ir.txt @@ -1,3 +1,12 @@ +/** + * public abstract interface Callback : kotlin/Any { + * + * // signature: invoke()Ljava/lang/String; + * public abstract fun invoke(): kotlin/String + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Callback { @@ -8,6 +17,24 @@ public abstract interface Callback { //////////////////// +/** + * public final enum class Foo : kotlin/Enum { + * + * // signature: (Ljava/lang/String;ILCallback;)V + * private constructor(callback: Callback) + * + * // field: callback:LCallback; + * // getter: getCallback()LCallback; + * public final val callback: Callback + * public final get + * + * FOO, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Foo { /*public static final*/ FOO /* = new Foo() */; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/anonymousObjectInEnumSuperConstructor.txt b/plugins/kapt3/kapt3-compiler/testData/converter/anonymousObjectInEnumSuperConstructor.txt index b700d995842..460a4cc6b76 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/anonymousObjectInEnumSuperConstructor.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/anonymousObjectInEnumSuperConstructor.txt @@ -1,3 +1,12 @@ +/** + * public abstract interface Callback : kotlin/Any { + * + * // signature: invoke()Ljava/lang/String; + * public abstract fun invoke(): kotlin/String + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Callback { @@ -8,6 +17,24 @@ public abstract interface Callback { //////////////////// +/** + * public final enum class Foo : kotlin/Enum { + * + * // signature: (Ljava/lang/String;ILCallback;)V + * private constructor(callback: Callback) + * + * // field: callback:LCallback; + * // getter: getCallback()LCallback; + * public final val callback: Callback + * public final get + * + * FOO, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Foo { /*public static final*/ FOO /* = new Foo() */; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/comments.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/comments.fir.txt index 5b3440bc578..186fb0d758c 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/comments.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/comments.fir.txt @@ -1,3 +1,12 @@ +/** + * public final annotation class Anno : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.PROPERTY}) @java.lang.annotation.Target(value = {}) @@ -8,6 +17,24 @@ public abstract @interface Anno { //////////////////// +/** + * public final enum class EnumError : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * // signature: doIt()Ljava/lang/String; + * public abstract fun doIt(): kotlin/String + * + * One, + * + * Two, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum EnumError { /*public static final*/ One /* = new EnumError() */, @@ -29,7 +56,13 @@ public enum EnumError { /** - * Obj. + * public final object Obj : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } */ @kotlin.Metadata() public final class Obj { @@ -45,7 +78,38 @@ public final class Obj { /** - * Test. + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: method()V + * public final fun method(): kotlin/Unit + * + * // signature: method(I)V + * public final fun method(a: kotlin/Int): kotlin/Unit + * + * // signature: method(Ljava/lang/String;)V + * public final fun method(a: kotlin/String): kotlin/Unit + * + * // field: prop2:Ljava/lang/String; + * // getter: getProp2()Ljava/lang/String; + * // synthetic method for annotations: getProp2$annotations()V + * public final val prop2: kotlin/String (* = ... *) + * public final get + * + * // getter: getProp3()Ljava/lang/String; + * // setter: setProp3(Ljava/lang/String;)V + * public final var prop3: kotlin/String + * public final (* non-default *) get + * public final (* non-default *) set(v: kotlin/String) + * + * // field: prop:Ljava/lang/String; + * public final const val prop: kotlin/String (* = ... *) + * public final get + * + * // module name: main + * } */ @kotlin.Metadata() public final class Test { @@ -121,9 +185,18 @@ public final class Test { /** - * Test2 - * Multiline - * documentation. + * public final class Test2 : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * public constructor(a: kotlin/String) + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String + * public final get + * + * // module name: main + * } */ @kotlin.Metadata() public final class Test2 { @@ -145,7 +218,18 @@ public final class Test2 { /** - * constructor. + * public final class Test3 : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * protected constructor(a: kotlin/String) + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String + * public final get + * + * // module name: main + * } */ @kotlin.Metadata() public final class Test3 { @@ -166,6 +250,18 @@ public final class Test3 { //////////////////// +/** + * public final class Test4 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: method()V + * public final fun method(): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test4 { @@ -181,7 +277,10 @@ public final class Test4 { /** - * `/ * Failure * /` + * public abstract interface TestComponent : kotlin/Any { + * + * // module name: main + * } */ @kotlin.Metadata() public abstract interface TestComponent { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/comments.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/comments.ir.txt index 5bd2c0483f8..08842d4bb24 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/comments.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/comments.ir.txt @@ -1,6 +1,15 @@ @kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.PROPERTY}) @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(value = {}) +/** + * public final annotation class Anno : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno { } @@ -8,6 +17,24 @@ public abstract @interface Anno { //////////////////// +/** + * public final enum class EnumError : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * // signature: doIt()Ljava/lang/String; + * public abstract fun doIt(): kotlin/String + * + * One, + * + * Two, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum EnumError { /*public static final*/ One /* = new EnumError() */, @@ -31,6 +58,15 @@ public enum EnumError { /** * Obj. */ +/** + * public final object Obj : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Obj { @org.jetbrains.annotations.NotNull() @@ -47,6 +83,40 @@ public final class Obj { /** * Test. */ +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: method()V + * public final fun method(): kotlin/Unit + * + * // signature: method(I)V + * public final fun method(a: kotlin/Int): kotlin/Unit + * + * // signature: method(Ljava/lang/String;)V + * public final fun method(a: kotlin/String): kotlin/Unit + * + * // field: prop2:Ljava/lang/String; + * // getter: getProp2()Ljava/lang/String; + * // synthetic method for annotations: getProp2$annotations()V + * public final val prop2: kotlin/String (* = ... *) + * public final get + * + * // getter: getProp3()Ljava/lang/String; + * // setter: setProp3(Ljava/lang/String;)V + * public final var prop3: kotlin/String + * public final (* non-default *) get + * public final (* non-default *) set(v: kotlin/String) + * + * // field: prop:Ljava/lang/String; + * public final const val prop: kotlin/String (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { @@ -125,6 +195,20 @@ public final class Test { * Multiline * documentation. */ +/** + * public final class Test2 : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * public constructor(a: kotlin/String) + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test2 { @org.jetbrains.annotations.NotNull() @@ -147,6 +231,20 @@ public final class Test2 { /** * constructor. */ +/** + * public final class Test3 : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * protected constructor(a: kotlin/String) + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test3 { @org.jetbrains.annotations.NotNull() @@ -166,6 +264,18 @@ public final class Test3 { //////////////////// +/** + * public final class Test4 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: method()V + * public final fun method(): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test4 { @@ -183,6 +293,12 @@ public final class Test4 { /** * `/ * Failure * /` */ +/** + * public abstract interface TestComponent : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface TestComponent { } diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/comments.txt b/plugins/kapt3/kapt3-compiler/testData/converter/comments.txt index b90a139eff2..004a933c881 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/comments.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/comments.txt @@ -1,6 +1,15 @@ @kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.PROPERTY}) @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(value = {}) +/** + * public final annotation class Anno : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno { } @@ -8,6 +17,24 @@ public abstract @interface Anno { //////////////////// +/** + * public final enum class EnumError : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * // signature: doIt()Ljava/lang/String; + * public abstract fun doIt(): kotlin/String + * + * One, + * + * Two, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum EnumError { /*public static final*/ One /* = new EnumError() */, @@ -26,6 +53,15 @@ public enum EnumError { /** * Obj. */ +/** + * public final object Obj : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Obj { @org.jetbrains.annotations.NotNull() @@ -42,6 +78,40 @@ public final class Obj { /** * Test. */ +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: method()V + * public final fun method(): kotlin/Unit + * + * // signature: method(I)V + * public final fun method(a: kotlin/Int): kotlin/Unit + * + * // signature: method(Ljava/lang/String;)V + * public final fun method(a: kotlin/String): kotlin/Unit + * + * // field: prop2:Ljava/lang/String; + * // getter: getProp2()Ljava/lang/String; + * // synthetic method for annotations: getProp2$annotations()V + * public final val prop2: kotlin/String (* = ... *) + * public final get + * + * // getter: getProp3()Ljava/lang/String; + * // setter: setProp3(Ljava/lang/String;)V + * public final var prop3: kotlin/String + * public final (* non-default *) get + * public final (* non-default *) set(v: kotlin/String) + * + * // field: prop:Ljava/lang/String; + * public final const val prop: kotlin/String (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { @@ -117,6 +187,20 @@ public final class Test { * Multiline * documentation. */ +/** + * public final class Test2 : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * public constructor(a: kotlin/String) + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test2 { @org.jetbrains.annotations.NotNull() @@ -139,6 +223,20 @@ public final class Test2 { /** * constructor. */ +/** + * public final class Test3 : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * protected constructor(a: kotlin/String) + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test3 { @org.jetbrains.annotations.NotNull() @@ -158,6 +256,18 @@ public final class Test3 { //////////////////// +/** + * public final class Test4 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: method()V + * public final fun method(): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test4 { @@ -175,6 +285,12 @@ public final class Test4 { /** * `/ * Failure * /` */ +/** + * public abstract interface TestComponent : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface TestComponent { } diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/commentsRemoved.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/commentsRemoved.ir.txt index 1ed74caf85b..426b22626b2 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/commentsRemoved.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/commentsRemoved.ir.txt @@ -1,6 +1,15 @@ @kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.PROPERTY}) @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(value = {}) +/** + * public final annotation class Anno : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno { } @@ -8,6 +17,24 @@ public abstract @interface Anno { //////////////////// +/** + * public final enum class EnumError : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * // signature: doIt()Ljava/lang/String; + * public abstract fun doIt(): kotlin/String + * + * One, + * + * Two, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum EnumError { /*public static final*/ One /* = new EnumError() */, @@ -28,6 +55,15 @@ public enum EnumError { //////////////////// +/** + * public final object Obj : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Obj { @org.jetbrains.annotations.NotNull() @@ -41,6 +77,40 @@ public final class Obj { //////////////////// +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: method()V + * public final fun method(): kotlin/Unit + * + * // signature: method(I)V + * public final fun method(a: kotlin/Int): kotlin/Unit + * + * // signature: method(Ljava/lang/String;)V + * public final fun method(a: kotlin/String): kotlin/Unit + * + * // field: prop2:Ljava/lang/String; + * // getter: getProp2()Ljava/lang/String; + * // synthetic method for annotations: getProp2$annotations()V + * public final val prop2: kotlin/String (* = ... *) + * public final get + * + * // getter: getProp3()Ljava/lang/String; + * // setter: setProp3(Ljava/lang/String;)V + * public final var prop3: kotlin/String + * public final (* non-default *) get + * public final (* non-default *) set(v: kotlin/String) + * + * // field: prop:Ljava/lang/String; + * public final const val prop: kotlin/String (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { @org.jetbrains.annotations.NotNull() @@ -85,6 +155,20 @@ public final class Test { //////////////////// +/** + * public final class Test2 : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * public constructor(a: kotlin/String) + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test2 { @org.jetbrains.annotations.NotNull() @@ -104,6 +188,20 @@ public final class Test2 { //////////////////// +/** + * public final class Test3 : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * protected constructor(a: kotlin/String) + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test3 { @org.jetbrains.annotations.NotNull() @@ -123,6 +221,18 @@ public final class Test3 { //////////////////// +/** + * public final class Test4 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: method()V + * public final fun method(): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test4 { @@ -137,6 +247,12 @@ public final class Test4 { //////////////////// +/** + * public abstract interface TestComponent : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface TestComponent { } diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/commentsRemoved.txt b/plugins/kapt3/kapt3-compiler/testData/converter/commentsRemoved.txt index 16e78c85519..f3097fb7661 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/commentsRemoved.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/commentsRemoved.txt @@ -1,6 +1,15 @@ @kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.PROPERTY}) @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(value = {}) +/** + * public final annotation class Anno : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno { } @@ -8,6 +17,24 @@ public abstract @interface Anno { //////////////////// +/** + * public final enum class EnumError : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * // signature: doIt()Ljava/lang/String; + * public abstract fun doIt(): kotlin/String + * + * One, + * + * Two, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum EnumError { /*public static final*/ One /* = new EnumError() */, @@ -23,6 +50,15 @@ public enum EnumError { //////////////////// +/** + * public final object Obj : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Obj { @org.jetbrains.annotations.NotNull() @@ -36,6 +72,40 @@ public final class Obj { //////////////////// +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: method()V + * public final fun method(): kotlin/Unit + * + * // signature: method(I)V + * public final fun method(a: kotlin/Int): kotlin/Unit + * + * // signature: method(Ljava/lang/String;)V + * public final fun method(a: kotlin/String): kotlin/Unit + * + * // field: prop2:Ljava/lang/String; + * // getter: getProp2()Ljava/lang/String; + * // synthetic method for annotations: getProp2$annotations()V + * public final val prop2: kotlin/String (* = ... *) + * public final get + * + * // getter: getProp3()Ljava/lang/String; + * // setter: setProp3(Ljava/lang/String;)V + * public final var prop3: kotlin/String + * public final (* non-default *) get + * public final (* non-default *) set(v: kotlin/String) + * + * // field: prop:Ljava/lang/String; + * public final const val prop: kotlin/String (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { @org.jetbrains.annotations.NotNull() @@ -80,6 +150,20 @@ public final class Test { //////////////////// +/** + * public final class Test2 : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * public constructor(a: kotlin/String) + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test2 { @org.jetbrains.annotations.NotNull() @@ -99,6 +183,20 @@ public final class Test2 { //////////////////// +/** + * public final class Test3 : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * protected constructor(a: kotlin/String) + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test3 { @org.jetbrains.annotations.NotNull() @@ -118,6 +216,18 @@ public final class Test3 { //////////////////// +/** + * public final class Test4 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: method()V + * public final fun method(): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test4 { @@ -132,6 +242,12 @@ public final class Test4 { //////////////////// +/** + * public abstract interface TestComponent : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface TestComponent { } diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/cyrillicClassName.txt b/plugins/kapt3/kapt3-compiler/testData/converter/cyrillicClassName.txt index c51eb690c91..72aa1abc489 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/cyrillicClassName.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/cyrillicClassName.txt @@ -1,3 +1,12 @@ +/** + * public final class République : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class République { @@ -9,6 +18,15 @@ public final class République { //////////////////// +/** + * public final class Привет : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Привет { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/dataClass.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/dataClass.fir.txt index 671bb9fd962..18c6a506ac0 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/dataClass.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/dataClass.fir.txt @@ -1,3 +1,48 @@ +/** + * public final data class User : kotlin/Any { + * + * // signature: (Ljava/lang/String;Ljava/lang/String;I)V + * public constructor(firstName: kotlin/String, secondName: kotlin/String, age: kotlin/Int) + * + * // signature: component1()Ljava/lang/String; + * public final (* synthesized *) operator fun component1(): kotlin/String + * + * // signature: component2()Ljava/lang/String; + * public final (* synthesized *) operator fun component2(): kotlin/String + * + * // signature: component3()I + * public final (* synthesized *) operator fun component3(): kotlin/Int + * + * // signature: copy(Ljava/lang/String;Ljava/lang/String;I)LUser; + * public final (* synthesized *) fun copy(firstName: kotlin/String (* = ... *), secondName: kotlin/String (* = ... *), age: kotlin/Int (* = ... *)): User + * + * // signature: equals(Ljava/lang/Object;)Z + * public open (* synthesized *) operator fun equals(other: kotlin/Any?): kotlin/Boolean + * + * // signature: hashCode()I + * public open (* synthesized *) fun hashCode(): kotlin/Int + * + * // signature: procedure()V + * public final fun procedure(): kotlin/Unit + * + * // signature: toString()Ljava/lang/String; + * public open (* synthesized *) fun toString(): kotlin/String + * + * // field: age:I + * public final val age: kotlin/Int + * public final get + * + * // field: firstName:Ljava/lang/String; + * public final val firstName: kotlin/String + * public final get + * + * // field: secondName:Ljava/lang/String; + * public final val secondName: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class User { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/dataClass.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/dataClass.ir.txt index e9e4d6c9103..b4fd95b71b3 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/dataClass.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/dataClass.ir.txt @@ -1,3 +1,51 @@ +/** + * public final data class User : kotlin/Any { + * + * // signature: (Ljava/lang/String;Ljava/lang/String;I)V + * public constructor(firstName: kotlin/String, secondName: kotlin/String, age: kotlin/Int) + * + * // signature: component1()Ljava/lang/String; + * public final (* synthesized *) operator fun component1(): kotlin/String + * + * // signature: component2()Ljava/lang/String; + * public final (* synthesized *) operator fun component2(): kotlin/String + * + * // signature: component3()I + * public final (* synthesized *) operator fun component3(): kotlin/Int + * + * // signature: copy(Ljava/lang/String;Ljava/lang/String;I)LUser; + * public final (* synthesized *) fun copy(firstName: kotlin/String (* = ... *), secondName: kotlin/String (* = ... *), age: kotlin/Int (* = ... *)): User + * + * // signature: equals(Ljava/lang/Object;)Z + * public open (* synthesized *) operator fun equals(other: kotlin/Any?): kotlin/Boolean + * + * // signature: hashCode()I + * public open (* synthesized *) fun hashCode(): kotlin/Int + * + * // signature: procedure()V + * public final fun procedure(): kotlin/Unit + * + * // signature: toString()Ljava/lang/String; + * public open (* synthesized *) fun toString(): kotlin/String + * + * // field: age:I + * // getter: getAge()I + * public final val age: kotlin/Int + * public final get + * + * // field: firstName:Ljava/lang/String; + * // getter: getFirstName()Ljava/lang/String; + * public final val firstName: kotlin/String + * public final get + * + * // field: secondName:Ljava/lang/String; + * // getter: getSecondName()Ljava/lang/String; + * public final val secondName: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class User { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/dataClass.txt b/plugins/kapt3/kapt3-compiler/testData/converter/dataClass.txt index 37cfe010f6f..1963d5e8890 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/dataClass.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/dataClass.txt @@ -1,3 +1,51 @@ +/** + * public final data class User : kotlin/Any { + * + * // signature: (Ljava/lang/String;Ljava/lang/String;I)V + * public constructor(firstName: kotlin/String, secondName: kotlin/String, age: kotlin/Int) + * + * // signature: component1()Ljava/lang/String; + * public final (* synthesized *) operator fun component1(): kotlin/String + * + * // signature: component2()Ljava/lang/String; + * public final (* synthesized *) operator fun component2(): kotlin/String + * + * // signature: component3()I + * public final (* synthesized *) operator fun component3(): kotlin/Int + * + * // signature: copy(Ljava/lang/String;Ljava/lang/String;I)LUser; + * public final (* synthesized *) fun copy(firstName: kotlin/String (* = ... *), secondName: kotlin/String (* = ... *), age: kotlin/Int (* = ... *)): User + * + * // signature: equals(Ljava/lang/Object;)Z + * public open (* synthesized *) operator fun equals(other: kotlin/Any?): kotlin/Boolean + * + * // signature: hashCode()I + * public open (* synthesized *) fun hashCode(): kotlin/Int + * + * // signature: procedure()V + * public final fun procedure(): kotlin/Unit + * + * // signature: toString()Ljava/lang/String; + * public open (* synthesized *) fun toString(): kotlin/String + * + * // field: age:I + * // getter: getAge()I + * public final val age: kotlin/Int + * public final get + * + * // field: firstName:Ljava/lang/String; + * // getter: getFirstName()Ljava/lang/String; + * public final val firstName: kotlin/String + * public final get + * + * // field: secondName:Ljava/lang/String; + * // getter: getSecondName()Ljava/lang/String; + * public final val secondName: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class User { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/defaultImpls.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/defaultImpls.fir.txt index 9062400158b..9bb62811c7b 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/defaultImpls.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/defaultImpls.fir.txt @@ -1,3 +1,17 @@ +/** + * public abstract interface Intf : kotlin/Any { + * + * // getter: getColor()I + * public open val color: kotlin/Int + * public open (* non-default *) get + * + * // companion object: Companion + * + * // nested class: Companion + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Intf { @org.jetbrains.annotations.NotNull() @@ -8,6 +22,24 @@ public abstract interface Intf { return 0; } + /** + * public final companion object Intf.Companion : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // field: WHITE:I + * public final const val WHITE: kotlin/Int (* = ... *) + * public final get + * + * // field: BLACK:I + * // getter: getBLACK()I + * public final val BLACK: kotlin/Int (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Companion { private static final int BLACK = 1; @@ -26,6 +58,15 @@ public abstract interface Intf { //////////////////// +/** + * public abstract interface IntfWithDefaultImpls : kotlin/Any { + * + * // signature: a()V + * public open fun a(): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface IntfWithDefaultImpls { @@ -36,6 +77,12 @@ public abstract interface IntfWithDefaultImpls { //////////////////// +/** + * public abstract interface IntfWithoutDefaultImpls : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface IntfWithoutDefaultImpls { } diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/defaultImpls.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/defaultImpls.ir.txt index 589776f2d7c..89e43b433f2 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/defaultImpls.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/defaultImpls.ir.txt @@ -1,3 +1,17 @@ +/** + * public abstract interface Intf : kotlin/Any { + * + * // getter: getColor()I + * public open val color: kotlin/Int + * public open (* non-default *) get + * + * // companion object: Companion + * + * // nested class: Companion + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Intf { public static final int WHITE = 2; @@ -6,6 +20,24 @@ public abstract interface Intf { public abstract int getColor(); + /** + * public final companion object Intf.Companion : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // field: WHITE:I + * public final const val WHITE: kotlin/Int (* = ... *) + * public final get + * + * // field: BLACK:I + * // getter: getBLACK()I + * public final val BLACK: kotlin/Int (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Companion { private static final int BLACK = 1; @@ -20,6 +52,9 @@ public abstract interface Intf { } } + /** + * synthetic class + */ @kotlin.Metadata() public static final class DefaultImpls { @@ -37,11 +72,23 @@ public abstract interface Intf { //////////////////// +/** + * public abstract interface IntfWithDefaultImpls : kotlin/Any { + * + * // signature: a()V + * public open fun a(): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface IntfWithDefaultImpls { public abstract void a(); + /** + * synthetic class + */ @kotlin.Metadata() public static final class DefaultImpls { @@ -58,6 +105,12 @@ public abstract interface IntfWithDefaultImpls { //////////////////// +/** + * public abstract interface IntfWithoutDefaultImpls : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface IntfWithoutDefaultImpls { } diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/defaultImpls.txt b/plugins/kapt3/kapt3-compiler/testData/converter/defaultImpls.txt index 636a8b93298..fd460fb3bd6 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/defaultImpls.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/defaultImpls.txt @@ -1,3 +1,17 @@ +/** + * public abstract interface Intf : kotlin/Any { + * + * // getter: getColor()I + * public open val color: kotlin/Int + * public open (* non-default *) get + * + * // companion object: Companion + * + * // nested class: Companion + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Intf { @org.jetbrains.annotations.NotNull() @@ -6,6 +20,9 @@ public abstract interface Intf { public abstract int getColor(); + /** + * synthetic class + */ @kotlin.Metadata() public static final class DefaultImpls { @@ -19,6 +36,24 @@ public abstract interface Intf { } } + /** + * public final companion object Intf.Companion : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // field: WHITE:I + * public final const val WHITE: kotlin/Int (* = ... *) + * public final get + * + * // field: BLACK:I + * // getter: getBLACK()I + * public final val BLACK: kotlin/Int (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Companion { private static final int BLACK = 1; @@ -37,11 +72,23 @@ public abstract interface Intf { //////////////////// +/** + * public abstract interface IntfWithDefaultImpls : kotlin/Any { + * + * // signature: a()V + * public open fun a(): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface IntfWithDefaultImpls { public abstract void a(); + /** + * synthetic class + */ @kotlin.Metadata() public static final class DefaultImpls { @@ -58,6 +105,12 @@ public abstract interface IntfWithDefaultImpls { //////////////////// +/** + * public abstract interface IntfWithoutDefaultImpls : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface IntfWithoutDefaultImpls { } diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/defaultImplsWithTypeParameters.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/defaultImplsWithTypeParameters.fir.txt index e450a8fc99c..0a5ee8ff071 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/defaultImplsWithTypeParameters.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/defaultImplsWithTypeParameters.fir.txt @@ -1,3 +1,16 @@ +/** + * public abstract interface Foo : kotlin/Any { + * + * // signature: foo(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V + * public open fun foo(x: T#0, y: T#1, z: T#2): kotlin/Unit + * + * // getter: getX()I + * public open val x: kotlin/Int + * public open (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Foo { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/defaultImplsWithTypeParameters.txt b/plugins/kapt3/kapt3-compiler/testData/converter/defaultImplsWithTypeParameters.txt index 94ceebee6d3..dc4465a696a 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/defaultImplsWithTypeParameters.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/defaultImplsWithTypeParameters.txt @@ -1,3 +1,16 @@ +/** + * public abstract interface Foo : kotlin/Any { + * + * // signature: foo(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V + * public open fun foo(x: T#0, y: T#1, z: T#2): kotlin/Unit + * + * // getter: getX()I + * public open val x: kotlin/Int + * public open (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Foo { @@ -5,6 +18,9 @@ public abstract interface Foo()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class AnotherRootClass { @@ -9,6 +18,15 @@ public final class AnotherRootClass { //////////////////// +/** + * public final class RootClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class RootClass { @@ -37,6 +55,21 @@ public @interface ClassRefAnnotation { package test; +/** + * public abstract interface test/PackedClass : kotlin/Any { + * + * // signature: oneMoreMethod()LAnotherRootClass; + * public abstract fun oneMoreMethod(): AnotherRootClass + * + * // signature: otherMethod()Ljava/lang/Number; + * public abstract fun otherMethod(): java/lang/Number + * + * // signature: someMethod()LRootClass; + * public abstract fun someMethod(): RootClass + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface PackedClass { @@ -54,6 +87,15 @@ public abstract interface PackedClass { package test; +/** + * public final class test/PackedWithAnnotation : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @ClassRefAnnotation(value = {RootClass.class}) public final class PackedWithAnnotation { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/defaultPackage.txt b/plugins/kapt3/kapt3-compiler/testData/converter/defaultPackage.txt index 792ab18cb2a..4c04c798c69 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/defaultPackage.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/defaultPackage.txt @@ -1,3 +1,12 @@ +/** + * public final class AnotherRootClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class AnotherRootClass { @@ -9,6 +18,15 @@ public final class AnotherRootClass { //////////////////// +/** + * public final class RootClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class RootClass { @@ -37,6 +55,21 @@ public @interface ClassRefAnnotation { package test; +/** + * public abstract interface test/PackedClass : kotlin/Any { + * + * // signature: oneMoreMethod()LAnotherRootClass; + * public abstract fun oneMoreMethod(): AnotherRootClass + * + * // signature: otherMethod()Ljava/lang/Number; + * public abstract fun otherMethod(): java/lang/Number + * + * // signature: someMethod()LRootClass; + * public abstract fun someMethod(): RootClass + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface PackedClass { @@ -55,6 +88,15 @@ public abstract interface PackedClass { package test; @ClassRefAnnotation(value = {RootClass.class}) +/** + * public final class test/PackedWithAnnotation : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class PackedWithAnnotation { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/defaultPackageCorrectErrorTypes.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/defaultPackageCorrectErrorTypes.fir.txt index 315489c060f..5c2e42bb8ea 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/defaultPackageCorrectErrorTypes.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/defaultPackageCorrectErrorTypes.fir.txt @@ -1,3 +1,12 @@ +/** + * public final class AnotherRootClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class AnotherRootClass { @@ -9,6 +18,15 @@ public final class AnotherRootClass { //////////////////// +/** + * public final class RootClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class RootClass { @@ -37,6 +55,21 @@ public @interface ClassRefAnnotation { package test; +/** + * public abstract interface test/PackedClass : kotlin/Any { + * + * // signature: oneMoreMethod()LAnotherRootClass; + * public abstract fun oneMoreMethod(): AnotherRootClass + * + * // signature: otherMethod()Ljava/lang/Number; + * public abstract fun otherMethod(): java/lang/Number + * + * // signature: someMethod()LRootClass; + * public abstract fun someMethod(): RootClass + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface PackedClass { @@ -54,6 +87,15 @@ public abstract interface PackedClass { package test; +/** + * public final class test/PackedWithAnnotation : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @ClassRefAnnotation(value = {RootClass.class}) public final class PackedWithAnnotation { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/defaultPackageCorrectErrorTypes.txt b/plugins/kapt3/kapt3-compiler/testData/converter/defaultPackageCorrectErrorTypes.txt index db8d3c763cb..ecb82c2fd9a 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/defaultPackageCorrectErrorTypes.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/defaultPackageCorrectErrorTypes.txt @@ -1,3 +1,12 @@ +/** + * public final class AnotherRootClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class AnotherRootClass { @@ -9,6 +18,15 @@ public final class AnotherRootClass { //////////////////// +/** + * public final class RootClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class RootClass { @@ -39,6 +57,21 @@ package test; import java.lang.Number; +/** + * public abstract interface test/PackedClass : kotlin/Any { + * + * // signature: oneMoreMethod()LAnotherRootClass; + * public abstract fun oneMoreMethod(): AnotherRootClass + * + * // signature: otherMethod()Ljava/lang/Number; + * public abstract fun otherMethod(): java/lang/Number + * + * // signature: someMethod()LRootClass; + * public abstract fun someMethod(): RootClass + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface PackedClass { @@ -59,6 +92,15 @@ package test; import java.lang.Number; @ClassRefAnnotation(value = {RootClass.class}) +/** + * public final class test/PackedWithAnnotation : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class PackedWithAnnotation { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOff.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOff.fir.txt index 1147c288621..d84d86ca310 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOff.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOff.fir.txt @@ -1,3 +1,18 @@ +/** + * public final enum class Em : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * FOO, + * + * BAR, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Em { /*public static final*/ FOO /* = new Em() */, @@ -15,6 +30,108 @@ public enum Em { //////////////////// +/** + * public final class Foo : kotlin/Any { + * + * // signature: (ZBCCSIJFDLjava/lang/String;[I[J[D[Ljava/lang/String;Ljava/lang/Class;[Ljava/lang/Class;LEm;[LEm;)V + * public constructor(z: kotlin/Boolean (* = ... *), b: kotlin/Byte (* = ... *), c: kotlin/Char (* = ... *), c2: kotlin/Char (* = ... *), sh: kotlin/Short (* = ... *), i: kotlin/Int (* = ... *), l: kotlin/Long (* = ... *), f: kotlin/Float (* = ... *), d: kotlin/Double (* = ... *), s: kotlin/String (* = ... *), iarr: kotlin/IntArray (* = ... *), larr: kotlin/LongArray (* = ... *), darr: kotlin/DoubleArray (* = ... *), sarr: kotlin/Array (* = ... *), cl: java/lang/Class<*> (* = ... *), clarr: kotlin/Array> (* = ... *), em: Em (* = ... *), emarr: kotlin/Array (* = ... *)) + * + * // signature: foo(I)V + * public final fun foo(a: kotlin/Int (* = ... *)): kotlin/Unit + * + * // field: b:B + * // getter: getB()B + * public final val b: kotlin/Byte + * public final get + * + * // field: c:C + * // getter: getC()C + * public final val c: kotlin/Char + * public final get + * + * // field: c2:C + * // getter: getC2()C + * public final val c2: kotlin/Char + * public final get + * + * // field: cl:Ljava/lang/Class; + * // getter: getCl()Ljava/lang/Class; + * public final val cl: java/lang/Class<*> + * public final get + * + * // field: clarr:[Ljava/lang/Class; + * // getter: getClarr()[Ljava/lang/Class; + * public final val clarr: kotlin/Array> + * public final get + * + * // field: d:D + * // getter: getD()D + * public final val d: kotlin/Double + * public final get + * + * // field: darr:[D + * // getter: getDarr()[D + * public final val darr: kotlin/DoubleArray + * public final get + * + * // field: em:LEm; + * // getter: getEm()LEm; + * public final val em: Em + * public final get + * + * // field: emarr:[LEm; + * // getter: getEmarr()[LEm; + * public final val emarr: kotlin/Array + * public final get + * + * // field: f:F + * // getter: getF()F + * public final val f: kotlin/Float + * public final get + * + * // field: i:I + * // getter: getI()I + * public final val i: kotlin/Int + * public final get + * + * // field: iarr:[I + * // getter: getIarr()[I + * public final val iarr: kotlin/IntArray + * public final get + * + * // field: l:J + * // getter: getL()J + * public final val l: kotlin/Long + * public final get + * + * // field: larr:[J + * // getter: getLarr()[J + * public final val larr: kotlin/LongArray + * public final get + * + * // field: s:Ljava/lang/String; + * // getter: getS()Ljava/lang/String; + * public final val s: kotlin/String + * public final get + * + * // field: sarr:[Ljava/lang/String; + * // getter: getSarr()[Ljava/lang/String; + * public final val sarr: kotlin/Array + * public final get + * + * // field: sh:S + * // getter: getSh()S + * public final val sh: kotlin/Short + * public final get + * + * // field: z:Z + * // getter: getZ()Z + * public final val z: kotlin/Boolean + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { private final boolean z = false; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOff.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOff.ir.txt index 04c983697f8..b783dc9aea0 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOff.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOff.ir.txt @@ -1,3 +1,18 @@ +/** + * public final enum class Em : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * FOO, + * + * BAR, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Em { /*public static final*/ FOO /* = new Em() */, @@ -15,6 +30,108 @@ public enum Em { //////////////////// +/** + * public final class Foo : kotlin/Any { + * + * // signature: (ZBCCSIJFDLjava/lang/String;[I[J[D[Ljava/lang/String;Ljava/lang/Class;[Ljava/lang/Class;LEm;[LEm;)V + * public constructor(z: kotlin/Boolean (* = ... *), b: kotlin/Byte (* = ... *), c: kotlin/Char (* = ... *), c2: kotlin/Char (* = ... *), sh: kotlin/Short (* = ... *), i: kotlin/Int (* = ... *), l: kotlin/Long (* = ... *), f: kotlin/Float (* = ... *), d: kotlin/Double (* = ... *), s: kotlin/String (* = ... *), iarr: kotlin/IntArray (* = ... *), larr: kotlin/LongArray (* = ... *), darr: kotlin/DoubleArray (* = ... *), sarr: kotlin/Array (* = ... *), cl: java/lang/Class<*> (* = ... *), clarr: kotlin/Array> (* = ... *), em: Em (* = ... *), emarr: kotlin/Array (* = ... *)) + * + * // signature: foo(I)V + * public final fun foo(a: kotlin/Int (* = ... *)): kotlin/Unit + * + * // field: b:B + * // getter: getB()B + * public final val b: kotlin/Byte + * public final get + * + * // field: c:C + * // getter: getC()C + * public final val c: kotlin/Char + * public final get + * + * // field: c2:C + * // getter: getC2()C + * public final val c2: kotlin/Char + * public final get + * + * // field: cl:Ljava/lang/Class; + * // getter: getCl()Ljava/lang/Class; + * public final val cl: java/lang/Class<*> + * public final get + * + * // field: clarr:[Ljava/lang/Class; + * // getter: getClarr()[Ljava/lang/Class; + * public final val clarr: kotlin/Array> + * public final get + * + * // field: d:D + * // getter: getD()D + * public final val d: kotlin/Double + * public final get + * + * // field: darr:[D + * // getter: getDarr()[D + * public final val darr: kotlin/DoubleArray + * public final get + * + * // field: em:LEm; + * // getter: getEm()LEm; + * public final val em: Em + * public final get + * + * // field: emarr:[LEm; + * // getter: getEmarr()[LEm; + * public final val emarr: kotlin/Array + * public final get + * + * // field: f:F + * // getter: getF()F + * public final val f: kotlin/Float + * public final get + * + * // field: i:I + * // getter: getI()I + * public final val i: kotlin/Int + * public final get + * + * // field: iarr:[I + * // getter: getIarr()[I + * public final val iarr: kotlin/IntArray + * public final get + * + * // field: l:J + * // getter: getL()J + * public final val l: kotlin/Long + * public final get + * + * // field: larr:[J + * // getter: getLarr()[J + * public final val larr: kotlin/LongArray + * public final get + * + * // field: s:Ljava/lang/String; + * // getter: getS()Ljava/lang/String; + * public final val s: kotlin/String + * public final get + * + * // field: sarr:[Ljava/lang/String; + * // getter: getSarr()[Ljava/lang/String; + * public final val sarr: kotlin/Array + * public final get + * + * // field: sh:S + * // getter: getSh()S + * public final val sh: kotlin/Short + * public final get + * + * // field: z:Z + * // getter: getZ()Z + * public final val z: kotlin/Boolean + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { private final boolean z = false; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOff.txt b/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOff.txt index cd21ca41f77..8bbdff13b25 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOff.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOff.txt @@ -1,3 +1,18 @@ +/** + * public final enum class Em : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * FOO, + * + * BAR, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Em { /*public static final*/ FOO /* = new Em() */, @@ -10,6 +25,108 @@ public enum Em { //////////////////// +/** + * public final class Foo : kotlin/Any { + * + * // signature: (ZBCCSIJFDLjava/lang/String;[I[J[D[Ljava/lang/String;Ljava/lang/Class;[Ljava/lang/Class;LEm;[LEm;)V + * public constructor(z: kotlin/Boolean (* = ... *), b: kotlin/Byte (* = ... *), c: kotlin/Char (* = ... *), c2: kotlin/Char (* = ... *), sh: kotlin/Short (* = ... *), i: kotlin/Int (* = ... *), l: kotlin/Long (* = ... *), f: kotlin/Float (* = ... *), d: kotlin/Double (* = ... *), s: kotlin/String (* = ... *), iarr: kotlin/IntArray (* = ... *), larr: kotlin/LongArray (* = ... *), darr: kotlin/DoubleArray (* = ... *), sarr: kotlin/Array (* = ... *), cl: java/lang/Class<*> (* = ... *), clarr: kotlin/Array> (* = ... *), em: Em (* = ... *), emarr: kotlin/Array (* = ... *)) + * + * // signature: foo(I)V + * public final fun foo(a: kotlin/Int (* = ... *)): kotlin/Unit + * + * // field: b:B + * // getter: getB()B + * public final val b: kotlin/Byte + * public final get + * + * // field: c:C + * // getter: getC()C + * public final val c: kotlin/Char + * public final get + * + * // field: c2:C + * // getter: getC2()C + * public final val c2: kotlin/Char + * public final get + * + * // field: cl:Ljava/lang/Class; + * // getter: getCl()Ljava/lang/Class; + * public final val cl: java/lang/Class<*> + * public final get + * + * // field: clarr:[Ljava/lang/Class; + * // getter: getClarr()[Ljava/lang/Class; + * public final val clarr: kotlin/Array> + * public final get + * + * // field: d:D + * // getter: getD()D + * public final val d: kotlin/Double + * public final get + * + * // field: darr:[D + * // getter: getDarr()[D + * public final val darr: kotlin/DoubleArray + * public final get + * + * // field: em:LEm; + * // getter: getEm()LEm; + * public final val em: Em + * public final get + * + * // field: emarr:[LEm; + * // getter: getEmarr()[LEm; + * public final val emarr: kotlin/Array + * public final get + * + * // field: f:F + * // getter: getF()F + * public final val f: kotlin/Float + * public final get + * + * // field: i:I + * // getter: getI()I + * public final val i: kotlin/Int + * public final get + * + * // field: iarr:[I + * // getter: getIarr()[I + * public final val iarr: kotlin/IntArray + * public final get + * + * // field: l:J + * // getter: getL()J + * public final val l: kotlin/Long + * public final get + * + * // field: larr:[J + * // getter: getLarr()[J + * public final val larr: kotlin/LongArray + * public final get + * + * // field: s:Ljava/lang/String; + * // getter: getS()Ljava/lang/String; + * public final val s: kotlin/String + * public final get + * + * // field: sarr:[Ljava/lang/String; + * // getter: getSarr()[Ljava/lang/String; + * public final val sarr: kotlin/Array + * public final get + * + * // field: sh:S + * // getter: getSh()S + * public final val sh: kotlin/Short + * public final get + * + * // field: z:Z + * // getter: getZ()Z + * public final val z: kotlin/Boolean + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { private final boolean z = false; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOn.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOn.fir.txt index 17b50cc18b2..1361f32f47d 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOn.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOn.fir.txt @@ -1,3 +1,18 @@ +/** + * public final enum class Em : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * FOO, + * + * BAR, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Em { /*public static final*/ FOO /* = new Em() */, @@ -15,6 +30,108 @@ public enum Em { //////////////////// +/** + * public final class Foo : kotlin/Any { + * + * // signature: (ZBCCSIJFDLjava/lang/String;[I[J[D[Ljava/lang/String;Ljava/lang/Class;[Ljava/lang/Class;LEm;[LEm;)V + * public constructor(z: kotlin/Boolean (* = ... *), b: kotlin/Byte (* = ... *), c: kotlin/Char (* = ... *), c2: kotlin/Char (* = ... *), sh: kotlin/Short (* = ... *), i: kotlin/Int (* = ... *), l: kotlin/Long (* = ... *), f: kotlin/Float (* = ... *), d: kotlin/Double (* = ... *), s: kotlin/String (* = ... *), iarr: kotlin/IntArray (* = ... *), larr: kotlin/LongArray (* = ... *), darr: kotlin/DoubleArray (* = ... *), sarr: kotlin/Array (* = ... *), cl: java/lang/Class<*> (* = ... *), clarr: kotlin/Array> (* = ... *), em: Em (* = ... *), emarr: kotlin/Array (* = ... *)) + * + * // signature: foo(I)V + * public final fun foo(a: kotlin/Int (* = ... *)): kotlin/Unit + * + * // field: b:B + * // getter: getB()B + * public final val b: kotlin/Byte + * public final get + * + * // field: c:C + * // getter: getC()C + * public final val c: kotlin/Char + * public final get + * + * // field: c2:C + * // getter: getC2()C + * public final val c2: kotlin/Char + * public final get + * + * // field: cl:Ljava/lang/Class; + * // getter: getCl()Ljava/lang/Class; + * public final val cl: java/lang/Class<*> + * public final get + * + * // field: clarr:[Ljava/lang/Class; + * // getter: getClarr()[Ljava/lang/Class; + * public final val clarr: kotlin/Array> + * public final get + * + * // field: d:D + * // getter: getD()D + * public final val d: kotlin/Double + * public final get + * + * // field: darr:[D + * // getter: getDarr()[D + * public final val darr: kotlin/DoubleArray + * public final get + * + * // field: em:LEm; + * // getter: getEm()LEm; + * public final val em: Em + * public final get + * + * // field: emarr:[LEm; + * // getter: getEmarr()[LEm; + * public final val emarr: kotlin/Array + * public final get + * + * // field: f:F + * // getter: getF()F + * public final val f: kotlin/Float + * public final get + * + * // field: i:I + * // getter: getI()I + * public final val i: kotlin/Int + * public final get + * + * // field: iarr:[I + * // getter: getIarr()[I + * public final val iarr: kotlin/IntArray + * public final get + * + * // field: l:J + * // getter: getL()J + * public final val l: kotlin/Long + * public final get + * + * // field: larr:[J + * // getter: getLarr()[J + * public final val larr: kotlin/LongArray + * public final get + * + * // field: s:Ljava/lang/String; + * // getter: getS()Ljava/lang/String; + * public final val s: kotlin/String + * public final get + * + * // field: sarr:[Ljava/lang/String; + * // getter: getSarr()[Ljava/lang/String; + * public final val sarr: kotlin/Array + * public final get + * + * // field: sh:S + * // getter: getSh()S + * public final val sh: kotlin/Short + * public final get + * + * // field: z:Z + * // getter: getZ()Z + * public final val z: kotlin/Boolean + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { private final boolean z = true; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOn.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOn.ir.txt index d1ed34a1a83..2b146474224 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOn.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOn.ir.txt @@ -1,3 +1,18 @@ +/** + * public final enum class Em : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * FOO, + * + * BAR, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Em { /*public static final*/ FOO /* = new Em() */, @@ -15,6 +30,108 @@ public enum Em { //////////////////// +/** + * public final class Foo : kotlin/Any { + * + * // signature: (ZBCCSIJFDLjava/lang/String;[I[J[D[Ljava/lang/String;Ljava/lang/Class;[Ljava/lang/Class;LEm;[LEm;)V + * public constructor(z: kotlin/Boolean (* = ... *), b: kotlin/Byte (* = ... *), c: kotlin/Char (* = ... *), c2: kotlin/Char (* = ... *), sh: kotlin/Short (* = ... *), i: kotlin/Int (* = ... *), l: kotlin/Long (* = ... *), f: kotlin/Float (* = ... *), d: kotlin/Double (* = ... *), s: kotlin/String (* = ... *), iarr: kotlin/IntArray (* = ... *), larr: kotlin/LongArray (* = ... *), darr: kotlin/DoubleArray (* = ... *), sarr: kotlin/Array (* = ... *), cl: java/lang/Class<*> (* = ... *), clarr: kotlin/Array> (* = ... *), em: Em (* = ... *), emarr: kotlin/Array (* = ... *)) + * + * // signature: foo(I)V + * public final fun foo(a: kotlin/Int (* = ... *)): kotlin/Unit + * + * // field: b:B + * // getter: getB()B + * public final val b: kotlin/Byte + * public final get + * + * // field: c:C + * // getter: getC()C + * public final val c: kotlin/Char + * public final get + * + * // field: c2:C + * // getter: getC2()C + * public final val c2: kotlin/Char + * public final get + * + * // field: cl:Ljava/lang/Class; + * // getter: getCl()Ljava/lang/Class; + * public final val cl: java/lang/Class<*> + * public final get + * + * // field: clarr:[Ljava/lang/Class; + * // getter: getClarr()[Ljava/lang/Class; + * public final val clarr: kotlin/Array> + * public final get + * + * // field: d:D + * // getter: getD()D + * public final val d: kotlin/Double + * public final get + * + * // field: darr:[D + * // getter: getDarr()[D + * public final val darr: kotlin/DoubleArray + * public final get + * + * // field: em:LEm; + * // getter: getEm()LEm; + * public final val em: Em + * public final get + * + * // field: emarr:[LEm; + * // getter: getEmarr()[LEm; + * public final val emarr: kotlin/Array + * public final get + * + * // field: f:F + * // getter: getF()F + * public final val f: kotlin/Float + * public final get + * + * // field: i:I + * // getter: getI()I + * public final val i: kotlin/Int + * public final get + * + * // field: iarr:[I + * // getter: getIarr()[I + * public final val iarr: kotlin/IntArray + * public final get + * + * // field: l:J + * // getter: getL()J + * public final val l: kotlin/Long + * public final get + * + * // field: larr:[J + * // getter: getLarr()[J + * public final val larr: kotlin/LongArray + * public final get + * + * // field: s:Ljava/lang/String; + * // getter: getS()Ljava/lang/String; + * public final val s: kotlin/String + * public final get + * + * // field: sarr:[Ljava/lang/String; + * // getter: getSarr()[Ljava/lang/String; + * public final val sarr: kotlin/Array + * public final get + * + * // field: sh:S + * // getter: getSh()S + * public final val sh: kotlin/Short + * public final get + * + * // field: z:Z + * // getter: getZ()Z + * public final val z: kotlin/Boolean + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { private final boolean z = true; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOn.txt b/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOn.txt index 8b15bfc410d..5d64529ac71 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOn.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/defaultParameterValueOn.txt @@ -1,3 +1,18 @@ +/** + * public final enum class Em : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * FOO, + * + * BAR, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Em { /*public static final*/ FOO /* = new Em() */, @@ -10,6 +25,108 @@ public enum Em { //////////////////// +/** + * public final class Foo : kotlin/Any { + * + * // signature: (ZBCCSIJFDLjava/lang/String;[I[J[D[Ljava/lang/String;Ljava/lang/Class;[Ljava/lang/Class;LEm;[LEm;)V + * public constructor(z: kotlin/Boolean (* = ... *), b: kotlin/Byte (* = ... *), c: kotlin/Char (* = ... *), c2: kotlin/Char (* = ... *), sh: kotlin/Short (* = ... *), i: kotlin/Int (* = ... *), l: kotlin/Long (* = ... *), f: kotlin/Float (* = ... *), d: kotlin/Double (* = ... *), s: kotlin/String (* = ... *), iarr: kotlin/IntArray (* = ... *), larr: kotlin/LongArray (* = ... *), darr: kotlin/DoubleArray (* = ... *), sarr: kotlin/Array (* = ... *), cl: java/lang/Class<*> (* = ... *), clarr: kotlin/Array> (* = ... *), em: Em (* = ... *), emarr: kotlin/Array (* = ... *)) + * + * // signature: foo(I)V + * public final fun foo(a: kotlin/Int (* = ... *)): kotlin/Unit + * + * // field: b:B + * // getter: getB()B + * public final val b: kotlin/Byte + * public final get + * + * // field: c:C + * // getter: getC()C + * public final val c: kotlin/Char + * public final get + * + * // field: c2:C + * // getter: getC2()C + * public final val c2: kotlin/Char + * public final get + * + * // field: cl:Ljava/lang/Class; + * // getter: getCl()Ljava/lang/Class; + * public final val cl: java/lang/Class<*> + * public final get + * + * // field: clarr:[Ljava/lang/Class; + * // getter: getClarr()[Ljava/lang/Class; + * public final val clarr: kotlin/Array> + * public final get + * + * // field: d:D + * // getter: getD()D + * public final val d: kotlin/Double + * public final get + * + * // field: darr:[D + * // getter: getDarr()[D + * public final val darr: kotlin/DoubleArray + * public final get + * + * // field: em:LEm; + * // getter: getEm()LEm; + * public final val em: Em + * public final get + * + * // field: emarr:[LEm; + * // getter: getEmarr()[LEm; + * public final val emarr: kotlin/Array + * public final get + * + * // field: f:F + * // getter: getF()F + * public final val f: kotlin/Float + * public final get + * + * // field: i:I + * // getter: getI()I + * public final val i: kotlin/Int + * public final get + * + * // field: iarr:[I + * // getter: getIarr()[I + * public final val iarr: kotlin/IntArray + * public final get + * + * // field: l:J + * // getter: getL()J + * public final val l: kotlin/Long + * public final get + * + * // field: larr:[J + * // getter: getLarr()[J + * public final val larr: kotlin/LongArray + * public final get + * + * // field: s:Ljava/lang/String; + * // getter: getS()Ljava/lang/String; + * public final val s: kotlin/String + * public final get + * + * // field: sarr:[Ljava/lang/String; + * // getter: getSarr()[Ljava/lang/String; + * public final val sarr: kotlin/Array + * public final get + * + * // field: sh:S + * // getter: getSh()S + * public final val sh: kotlin/Short + * public final get + * + * // field: z:Z + * // getter: getZ()Z + * public final val z: kotlin/Boolean + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { private final boolean z = true; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/delegateCorrectErrorTypes.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/delegateCorrectErrorTypes.ir.txt index 6a9d86297cb..9a54371efcd 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/delegateCorrectErrorTypes.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/delegateCorrectErrorTypes.ir.txt @@ -1,5 +1,19 @@ package test; +/** + * public final class test/Bar : kotlin/Any { + * + * // signature: (Ltest/Delegate;)V + * public constructor(delegate: test/Delegate) + * + * // field: unknown$delegate:Ltest/Delegate; + * // getter: getUnknown()Lerror/NonExistentClass; + * private final (* delegated *) val unknown: error/NonExistentClass + * private final (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Bar { @org.jetbrains.annotations.NotNull() @@ -19,6 +33,18 @@ public final class Bar { package test; +/** + * public final class test/Delegate : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: getValue(Ljava/lang/Object;Lerror/NonExistentClass;)Ljava/lang/Object; + * public final operator fun getValue(thisRef: kotlin/Any, property: error/NonExistentClass): kotlin/Any + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Delegate { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/delegateCorrectErrorTypes.txt b/plugins/kapt3/kapt3-compiler/testData/converter/delegateCorrectErrorTypes.txt index f12b98a13d7..8a456f72215 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/delegateCorrectErrorTypes.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/delegateCorrectErrorTypes.txt @@ -1,5 +1,19 @@ package test; +/** + * public final class test/Bar : kotlin/Any { + * + * // signature: (Ltest/Delegate;)V + * public constructor(delegate: test/Delegate) + * + * // field: unknown$delegate:Ltest/Delegate; + * // getter: getUnknown()Lerror/NonExistentClass; + * private final (* delegated *) val unknown: error/NonExistentClass + * private final (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Bar { private final test.Delegate unknown$delegate = null; @@ -18,6 +32,18 @@ public final class Bar { package test; +/** + * public final class test/Delegate : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: getValue(Ljava/lang/Object;Lerror/NonExistentClass;)Ljava/lang/Object; + * public final operator fun getValue(thisRef: kotlin/Any, property: error/NonExistentClass): kotlin/Any + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Delegate { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/delegateToList.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/delegateToList.ir.txt index 693e925a260..2a02d7804e3 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/delegateToList.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/delegateToList.ir.txt @@ -1,3 +1,50 @@ +/** + * public final class MyList : kotlin/collections/List { + * + * // signature: (Ljava/util/List;)V + * public constructor(wrappedList: kotlin/collections/List) + * + * // signature: contains(Ljava/lang/Object;)Z + * public open (* delegation *) operator fun contains(element: T#0): kotlin/Boolean + * + * // signature: containsAll(Ljava/util/Collection;)Z + * public open (* delegation *) fun containsAll(elements: kotlin/collections/Collection): kotlin/Boolean + * + * // signature: get(I)Ljava/lang/Object; + * public open (* delegation *) operator fun get(index: kotlin/Int): T#0 + * + * // signature: indexOf(Ljava/lang/Object;)I + * public open (* delegation *) fun indexOf(element: T#0): kotlin/Int + * + * // signature: isEmpty()Z + * public open (* delegation *) fun isEmpty(): kotlin/Boolean + * + * // signature: iterator()Ljava/util/Iterator; + * public open (* delegation *) operator fun iterator(): kotlin/collections/Iterator + * + * // signature: lastIndexOf(Ljava/lang/Object;)I + * public open (* delegation *) fun lastIndexOf(element: T#0): kotlin/Int + * + * // signature: listIterator()Ljava/util/ListIterator; + * public open (* delegation *) fun listIterator(): kotlin/collections/ListIterator + * + * // signature: listIterator(I)Ljava/util/ListIterator; + * public open (* delegation *) fun listIterator(index: kotlin/Int): kotlin/collections/ListIterator + * + * // signature: subList(II)Ljava/util/List; + * public open (* delegation *) fun subList(fromIndex: kotlin/Int, toIndex: kotlin/Int): kotlin/collections/List + * + * // getter: getSize()I + * public open (* delegation *) val size: kotlin/Int + * public open get + * + * // field: wrappedList:Ljava/util/List; + * private final val wrappedList: kotlin/collections/List + * private final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class MyList implements java.util.List, kotlin.jvm.internal.markers.KMappedMarker { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/delegateToList.txt b/plugins/kapt3/kapt3-compiler/testData/converter/delegateToList.txt index 6dd20b21f25..4cf486a1f00 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/delegateToList.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/delegateToList.txt @@ -1,3 +1,50 @@ +/** + * public final class MyList : kotlin/collections/List { + * + * // signature: (Ljava/util/List;)V + * public constructor(wrappedList: kotlin/collections/List) + * + * // signature: contains(Ljava/lang/Object;)Z + * public open (* delegation *) operator fun contains(element: T#0): kotlin/Boolean + * + * // signature: containsAll(Ljava/util/Collection;)Z + * public open (* delegation *) fun containsAll(elements: kotlin/collections/Collection): kotlin/Boolean + * + * // signature: get(I)Ljava/lang/Object; + * public open (* delegation *) operator fun get(index: kotlin/Int): T#0 + * + * // signature: indexOf(Ljava/lang/Object;)I + * public open (* delegation *) fun indexOf(element: T#0): kotlin/Int + * + * // signature: isEmpty()Z + * public open (* delegation *) fun isEmpty(): kotlin/Boolean + * + * // signature: iterator()Ljava/util/Iterator; + * public open (* delegation *) operator fun iterator(): kotlin/collections/Iterator + * + * // signature: lastIndexOf(Ljava/lang/Object;)I + * public open (* delegation *) fun lastIndexOf(element: T#0): kotlin/Int + * + * // signature: listIterator()Ljava/util/ListIterator; + * public open (* delegation *) fun listIterator(): kotlin/collections/ListIterator + * + * // signature: listIterator(I)Ljava/util/ListIterator; + * public open (* delegation *) fun listIterator(index: kotlin/Int): kotlin/collections/ListIterator + * + * // signature: subList(II)Ljava/util/List; + * public open (* delegation *) fun subList(fromIndex: kotlin/Int, toIndex: kotlin/Int): kotlin/collections/List + * + * // getter: getSize()I + * public open (* delegation *) val size: kotlin/Int + * public open get + * + * // field: wrappedList:Ljava/util/List; + * private final val wrappedList: kotlin/collections/List + * private final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class MyList implements java.util.List, kotlin.jvm.internal.markers.KMappedMarker { private final java.util.List wrappedList = null; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/delegatedProperties.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/delegatedProperties.fir.txt index 8750fc5efa4..cb6fe0e709f 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/delegatedProperties.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/delegatedProperties.fir.txt @@ -1,5 +1,40 @@ package test; +/** + * public final class test/A : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: a$delegate:Lkotlin/Lazy; + * // getter: getA()Ltest/C; + * public final (* delegated *) val a: test/C + * public final (* non-default *) get + * + * // field: b$delegate:Lkotlin/Lazy; + * // getter: getB()Ltest/C; + * public final (* delegated *) val b: test/C + * public final (* non-default *) get + * + * // field: x$delegate:Lkotlin/Lazy; + * // getter: getX()Lerror/NonExistentClass; + * // synthetic method for annotations: getX$annotations()V + * public final (* delegated *) val x: error/NonExistentClass + * public final (* non-default *) get + * + * // field: y$delegate:Ltest/C; + * // getter: getY()Ljava/lang/String; + * public final (* delegated *) val y: kotlin/String + * public final (* non-default *) get + * + * // field: z$delegate:Ltest/C; + * // getter: getZ()Ljava/lang/String; + * public final (* delegated *) val z: kotlin/String + * public final (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class A { @org.jetbrains.annotations.NotNull() @@ -51,6 +86,18 @@ public final class A { package test; +/** + * public open class test/C : kotlin/Any { + * + * // signature: (Ljava/lang/Object;)V + * public constructor(v: T#0) + * + * // signature: getValue(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; + * public final operator fun getValue(p1: kotlin/Any?, p2: kotlin/Any?): T#0 + * + * // module name: main + * } + */ @kotlin.Metadata() public class C { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/delegatedProperties.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/delegatedProperties.ir.txt new file mode 100644 index 00000000000..2a4a3165b58 --- /dev/null +++ b/plugins/kapt3/kapt3-compiler/testData/converter/delegatedProperties.ir.txt @@ -0,0 +1,114 @@ +package test; + +/** + * public final class test/A : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: a$delegate:Lkotlin/Lazy; + * // getter: getA()Ltest/C; + * public final (* delegated *) val a: test/C + * public final (* non-default *) get + * + * // field: b$delegate:Lkotlin/Lazy; + * // getter: getB()Ltest/C; + * public final (* delegated *) val b: test/C + * public final (* non-default *) get + * + * // field: x$delegate:Lkotlin/Lazy; + * // getter: getX()Lkotlin/Unit; + * // synthetic method for annotations: getX$annotations()V + * public final (* delegated *) val x: kotlin/Unit + * public final (* non-default *) get + * + * // field: y$delegate:Ltest/C; + * // getter: getY()Ljava/lang/String; + * public final (* delegated *) val y: kotlin/String + * public final (* non-default *) get + * + * // field: z$delegate:Ltest/C; + * // getter: getZ()Ljava/lang/String; + * public final (* delegated *) val z: kotlin/String + * public final (* non-default *) get + * + * // module name: main + * } + */ +@kotlin.Metadata() +public final class A { + @org.jetbrains.annotations.NotNull() + private final kotlin.Lazy x$delegate = null; + @org.jetbrains.annotations.NotNull() + private final test.C z$delegate = null; + @org.jetbrains.annotations.NotNull() + private final test.C y$delegate = null; + @org.jetbrains.annotations.NotNull() + private final kotlin.Lazy a$delegate = null; + @org.jetbrains.annotations.NotNull() + private final kotlin.Lazy b$delegate = null; + + public A() { + super(); + } + + @org.jetbrains.annotations.NotNull() + public final kotlin.Unit getX() { + return null; + } + + @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) + @java.lang.Deprecated() + public static void getX$annotations() { + } + + @org.jetbrains.annotations.NotNull() + public final java.lang.String getZ() { + return null; + } + + @org.jetbrains.annotations.NotNull() + public final java.lang.String getY() { + return null; + } + + @org.jetbrains.annotations.NotNull() + public final test.C getA() { + return null; + } + + @org.jetbrains.annotations.NotNull() + public final test.C getB() { + return null; + } +} + +//////////////////// + +package test; + +/** + * public open class test/C : kotlin/Any { + * + * // signature: (Ljava/lang/Object;)V + * public constructor(v: T#0) + * + * // signature: getValue(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; + * public final operator fun getValue(p1: kotlin/Any?, p2: kotlin/Any?): T#0 + * + * // module name: main + * } + */ +@kotlin.Metadata() +public class C { + + public C(T v) { + super(); + } + + public final T getValue(@org.jetbrains.annotations.Nullable() + java.lang.Object p1, @org.jetbrains.annotations.Nullable() + java.lang.Object p2) { + return null; + } +} diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/delegatedProperties.txt b/plugins/kapt3/kapt3-compiler/testData/converter/delegatedProperties.txt index 3e7330da9ef..cc8a6e7a87a 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/delegatedProperties.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/delegatedProperties.txt @@ -1,5 +1,40 @@ package test; +/** + * public final class test/A : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: a$delegate:Lkotlin/Lazy; + * // getter: getA()Ltest/C; + * public final (* delegated *) val a: test/C + * public final (* non-default *) get + * + * // field: b$delegate:Lkotlin/Lazy; + * // getter: getB()Ltest/C; + * public final (* delegated *) val b: test/C + * public final (* non-default *) get + * + * // field: x$delegate:Lkotlin/Lazy; + * // getter: getX()Lkotlin/Unit; + * // synthetic method for annotations: getX$annotations()V + * public final (* delegated *) val x: kotlin/Unit + * public final (* non-default *) get + * + * // field: y$delegate:Ltest/A$y$2; + * // getter: getY()Ljava/lang/String; + * public final (* delegated *) val y: kotlin/String + * public final (* non-default *) get + * + * // field: z$delegate:Ltest/C; + * // getter: getZ()Ljava/lang/String; + * public final (* delegated *) val z: kotlin/String + * public final (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class A { @org.jetbrains.annotations.NotNull() @@ -52,6 +87,18 @@ public final class A { package test; +/** + * public open class test/C : kotlin/Any { + * + * // signature: (Ljava/lang/Object;)V + * public constructor(v: T#0) + * + * // signature: getValue(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; + * public final operator fun getValue(p1: kotlin/Any?, p2: kotlin/Any?): T#0 + * + * // module name: main + * } + */ @kotlin.Metadata() public class C { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/delegationAndCompanionObject.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/delegationAndCompanionObject.ir.txt index ad476c74242..ade397a089a 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/delegationAndCompanionObject.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/delegationAndCompanionObject.ir.txt @@ -1,3 +1,22 @@ +/** + * public abstract interface A : kotlin/Any { + * + * // signature: inject(LA$B;)V + * public abstract fun inject(b: A.B): kotlin/Unit + * + * // getter: getX()Ljava/lang/String; + * public abstract val x: kotlin/String + * public abstract get + * + * // companion object: Companion + * + * // nested class: B + * + * // nested class: Companion + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) public abstract interface A { @@ -10,6 +29,22 @@ public abstract interface A { @org.jetbrains.annotations.NotNull() public abstract java.lang.String getX(); + /** + * public abstract class A.B : A { + * + * // signature: ()V + * public constructor() + * + * // signature: inject(LA$B;)V + * public open (* delegation *) fun inject(b: A.B): kotlin/Unit + * + * // getter: getX()Ljava/lang/String; + * public open (* delegation *) val x: kotlin/String + * public open get + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract class B implements A { @@ -29,6 +64,15 @@ public abstract interface A { } } + /** + * public final companion object A.Companion : A.B { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Companion extends A.B { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/delegationAndCompanionObject.txt b/plugins/kapt3/kapt3-compiler/testData/converter/delegationAndCompanionObject.txt index 8d5691701e3..35a298e101e 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/delegationAndCompanionObject.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/delegationAndCompanionObject.txt @@ -1,3 +1,22 @@ +/** + * public abstract interface A : kotlin/Any { + * + * // signature: inject(LA$B;)V + * public abstract fun inject(b: A.B): kotlin/Unit + * + * // getter: getX()Ljava/lang/String; + * public abstract val x: kotlin/String + * public abstract get + * + * // companion object: Companion + * + * // nested class: B + * + * // nested class: Companion + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) public abstract interface A { @@ -10,6 +29,22 @@ public abstract interface A { @org.jetbrains.annotations.NotNull() public abstract java.lang.String getX(); + /** + * public abstract class A.B : A { + * + * // signature: ()V + * public constructor() + * + * // signature: inject(LA$B;)V + * public open (* delegation *) fun inject(b: A.B): kotlin/Unit + * + * // getter: getX()Ljava/lang/String; + * public open (* delegation *) val x: kotlin/String + * public open get + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract class B implements A { @@ -29,6 +64,15 @@ public abstract interface A { } } + /** + * public final companion object A.Companion : A.B { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Companion extends A.B { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/delegationToAnonymousObject.txt b/plugins/kapt3/kapt3-compiler/testData/converter/delegationToAnonymousObject.txt index 55480f9ebb9..da67abd74d4 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/delegationToAnonymousObject.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/delegationToAnonymousObject.txt @@ -1,3 +1,12 @@ +/** + * public final class C : I { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class C implements I { @@ -9,6 +18,12 @@ public final class C implements I { //////////////////// +/** + * public abstract interface I : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface I { } diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/deprecated.txt b/plugins/kapt3/kapt3-compiler/testData/converter/deprecated.txt index 59c1b48d2af..686aa8c30aa 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/deprecated.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/deprecated.txt @@ -1,6 +1,15 @@ package deprecated; @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class deprecated/Anno : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.Deprecated() public abstract @interface Anno { @@ -11,6 +20,30 @@ public abstract @interface Anno { package deprecated; @Anno() +/** + * public final class deprecated/Foo : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: foo(I)V + * public final fun foo(a: kotlin/Int): kotlin/Unit + * + * // getter: getFoo()I + * // setter: setFoo(I)V + * public final var foo: kotlin/Int + * public final (* non-default *) get + * public final (* non-default *) set(value: kotlin/Int) + * + * // field: prop:I + * // getter: getProp()I + * // synthetic method for annotations: getProp$annotations()V + * public final val prop: kotlin/Int (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.Deprecated() public final class Foo { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/enumImports.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/enumImports.fir.txt index f505e733370..2cc4f769801 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/enumImports.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/enumImports.fir.txt @@ -1,5 +1,22 @@ package kapt; +/** + * public final enum class kapt/Options : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * A, + * + * B, + * + * C, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Options { /*public static final*/ A /* = new Options() */, diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/enumImports.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/enumImports.ir.txt index ddba00e4129..8eecdf46894 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/enumImports.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/enumImports.ir.txt @@ -2,6 +2,23 @@ package kapt; import kotlin.annotation.Repeatable; +/** + * public final enum class kapt/Options : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * A, + * + * B, + * + * C, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Options { /*public static final*/ A /* = new Options() */, diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/enumImports.txt b/plugins/kapt3/kapt3-compiler/testData/converter/enumImports.txt index 835583976ed..d30cf6007a6 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/enumImports.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/enumImports.txt @@ -2,6 +2,23 @@ package kapt; import kotlin.annotation.Repeatable; +/** + * public final enum class kapt/Options : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * A, + * + * B, + * + * C, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Options { /*public static final*/ A /* = new Options() */, diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/enumInCompanion.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/enumInCompanion.fir.txt index 18d9957390f..f42a9c1602a 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/enumInCompanion.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/enumInCompanion.fir.txt @@ -1,3 +1,20 @@ +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: foo:LTest$Companion$Example; + * private final val foo: Test.Companion.Example (* = ... *) + * private final get + * + * // companion object: Companion + * + * // nested class: Companion + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { @org.jetbrains.annotations.NotNull() @@ -9,6 +26,17 @@ public final class Test { super(); } + /** + * public final companion object Test.Companion : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // nested class: Example + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Companion { @@ -16,6 +44,19 @@ public final class Test { super(); } + /** + * public final enum class Test.Companion.Example : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * FOO, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public static enum Example { /*public static final*/ FOO /* = new Example() */; @@ -34,6 +75,23 @@ public final class Test { //////////////////// +/** + * public final class Test2 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: foo:LTest2$Amigo$Example; + * private final val foo: Test2.Amigo.Example (* = ... *) + * private final get + * + * // companion object: Amigo + * + * // nested class: Amigo + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test2 { @org.jetbrains.annotations.NotNull() @@ -45,6 +103,17 @@ public final class Test2 { super(); } + /** + * public final companion object Test2.Amigo : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // nested class: Example + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Amigo { @@ -52,6 +121,19 @@ public final class Test2 { super(); } + /** + * public final enum class Test2.Amigo.Example : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * FOO, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public static enum Example { /*public static final*/ FOO /* = new Example() */; @@ -70,6 +152,21 @@ public final class Test2 { //////////////////// +/** + * public final class Test3 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: foo:LTest3$Amigo$Example; + * private final val foo: Test3.Amigo.Example (* = ... *) + * private final get + * + * // nested class: Amigo + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test3 { @org.jetbrains.annotations.NotNull() @@ -79,6 +176,17 @@ public final class Test3 { super(); } + /** + * public final object Test3.Amigo : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // nested class: Example + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Amigo { @org.jetbrains.annotations.NotNull() @@ -88,6 +196,19 @@ public final class Test3 { super(); } + /** + * public final enum class Test3.Amigo.Example : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * FOO, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public static enum Example { /*public static final*/ FOO /* = new Example() */; @@ -106,6 +227,23 @@ public final class Test3 { //////////////////// +/** + * public final class Test4 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: foo:I + * private final val foo: kotlin/Int (* = ... *) + * private final get + * + * // companion object: Companion + * + * // nested class: Companion + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test4 { private final int foo = 1; @@ -116,6 +254,17 @@ public final class Test4 { super(); } + /** + * public final companion object Test4.Companion : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // nested class: Foo + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Companion { @@ -123,6 +272,19 @@ public final class Test4 { super(); } + /** + * public final object Test4.Companion.Foo : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // field: constProperty:I + * public final const val constProperty: kotlin/Int (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Foo { @org.jetbrains.annotations.NotNull() @@ -139,6 +301,21 @@ public final class Test4 { //////////////////// +/** + * public final class Test5 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: foo:LTest5$Amigos$Companion$Goo$Example; + * private final val foo: Test5.Amigos.Companion.Goo.Example (* = ... *) + * private final get + * + * // nested class: Amigos + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test5 { @org.jetbrains.annotations.NotNull() @@ -148,6 +325,19 @@ public final class Test5 { super(); } + /** + * public final class Test5.Amigos : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // companion object: Companion + * + * // nested class: Companion + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Amigos { @org.jetbrains.annotations.NotNull() @@ -157,6 +347,17 @@ public final class Test5 { super(); } + /** + * public final companion object Test5.Amigos.Companion : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // nested class: Goo + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Companion { @@ -164,6 +365,17 @@ public final class Test5 { super(); } + /** + * public final class Test5.Amigos.Companion.Goo : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: Example + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Goo { @@ -171,6 +383,19 @@ public final class Test5 { super(); } + /** + * public final enum class Test5.Amigos.Companion.Goo.Example : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * FOO, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public static enum Example { /*public static final*/ FOO /* = new Example() */; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/enumInCompanion.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/enumInCompanion.ir.txt index d223b83faf8..1701991b411 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/enumInCompanion.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/enumInCompanion.ir.txt @@ -1,3 +1,20 @@ +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: foo:LTest$Companion$Example; + * private final val foo: Test.Companion.Example + * private final get + * + * // companion object: Companion + * + * // nested class: Companion + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { @org.jetbrains.annotations.NotNull() @@ -9,6 +26,17 @@ public final class Test { super(); } + /** + * public final companion object Test.Companion : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // nested class: Example + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Companion { @@ -16,6 +44,19 @@ public final class Test { super(); } + /** + * public final enum class Test.Companion.Example : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * FOO, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public static enum Example { /*public static final*/ FOO /* = new Example() */; @@ -34,6 +75,23 @@ public final class Test { //////////////////// +/** + * public final class Test2 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: foo:LTest2$Amigo$Example; + * private final val foo: Test2.Amigo.Example + * private final get + * + * // companion object: Amigo + * + * // nested class: Amigo + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test2 { @org.jetbrains.annotations.NotNull() @@ -45,6 +103,17 @@ public final class Test2 { super(); } + /** + * public final companion object Test2.Amigo : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // nested class: Example + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Amigo { @@ -52,6 +121,19 @@ public final class Test2 { super(); } + /** + * public final enum class Test2.Amigo.Example : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * FOO, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public static enum Example { /*public static final*/ FOO /* = new Example() */; @@ -70,6 +152,21 @@ public final class Test2 { //////////////////// +/** + * public final class Test3 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: foo:LTest3$Amigo$Example; + * private final val foo: Test3.Amigo.Example + * private final get + * + * // nested class: Amigo + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test3 { @org.jetbrains.annotations.NotNull() @@ -79,6 +176,17 @@ public final class Test3 { super(); } + /** + * public final object Test3.Amigo : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // nested class: Example + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Amigo { @org.jetbrains.annotations.NotNull() @@ -88,6 +196,19 @@ public final class Test3 { super(); } + /** + * public final enum class Test3.Amigo.Example : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * FOO, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public static enum Example { /*public static final*/ FOO /* = new Example() */; @@ -106,6 +227,23 @@ public final class Test3 { //////////////////// +/** + * public final class Test4 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: foo:I + * private final val foo: kotlin/Int (* = ... *) + * private final get + * + * // companion object: Companion + * + * // nested class: Companion + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test4 { private final int foo = 1; @@ -116,6 +254,17 @@ public final class Test4 { super(); } + /** + * public final companion object Test4.Companion : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // nested class: Foo + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Companion { @@ -123,6 +272,19 @@ public final class Test4 { super(); } + /** + * public final object Test4.Companion.Foo : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // field: constProperty:I + * public final const val constProperty: kotlin/Int (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Foo { public static final int constProperty = 1; @@ -139,6 +301,21 @@ public final class Test4 { //////////////////// +/** + * public final class Test5 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: foo:LTest5$Amigos$Companion$Goo$Example; + * private final val foo: Test5.Amigos.Companion.Goo.Example + * private final get + * + * // nested class: Amigos + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test5 { @org.jetbrains.annotations.NotNull() @@ -148,6 +325,19 @@ public final class Test5 { super(); } + /** + * public final class Test5.Amigos : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // companion object: Companion + * + * // nested class: Companion + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Amigos { @org.jetbrains.annotations.NotNull() @@ -157,6 +347,17 @@ public final class Test5 { super(); } + /** + * public final companion object Test5.Amigos.Companion : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // nested class: Goo + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Companion { @@ -164,6 +365,17 @@ public final class Test5 { super(); } + /** + * public final class Test5.Amigos.Companion.Goo : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: Example + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Goo { @@ -171,6 +383,19 @@ public final class Test5 { super(); } + /** + * public final enum class Test5.Amigos.Companion.Goo.Example : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * FOO, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public static enum Example { /*public static final*/ FOO /* = new Example() */; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/enumInCompanion.txt b/plugins/kapt3/kapt3-compiler/testData/converter/enumInCompanion.txt index c64cd16816e..e1bf5c5a88a 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/enumInCompanion.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/enumInCompanion.txt @@ -1,3 +1,20 @@ +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: foo:LTest$Companion$Example; + * private final val foo: Test.Companion.Example + * private final get + * + * // companion object: Companion + * + * // nested class: Companion + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { private final Test.Companion.Example foo; @@ -8,6 +25,17 @@ public final class Test { super(); } + /** + * public final companion object Test.Companion : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // nested class: Example + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Companion { @@ -15,6 +43,19 @@ public final class Test { super(); } + /** + * public final enum class Test.Companion.Example : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * FOO, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public static enum Example { /*public static final*/ FOO /* = new Example() */; @@ -28,6 +69,23 @@ public final class Test { //////////////////// +/** + * public final class Test2 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: foo:LTest2$Amigo$Example; + * private final val foo: Test2.Amigo.Example + * private final get + * + * // companion object: Amigo + * + * // nested class: Amigo + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test2 { private final Test2.Amigo.Example foo; @@ -38,6 +96,17 @@ public final class Test2 { super(); } + /** + * public final companion object Test2.Amigo : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // nested class: Example + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Amigo { @@ -45,6 +114,19 @@ public final class Test2 { super(); } + /** + * public final enum class Test2.Amigo.Example : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * FOO, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public static enum Example { /*public static final*/ FOO /* = new Example() */; @@ -58,6 +140,21 @@ public final class Test2 { //////////////////// +/** + * public final class Test3 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: foo:LTest3$Amigo$Example; + * private final val foo: Test3.Amigo.Example + * private final get + * + * // nested class: Amigo + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test3 { private final Test3.Amigo.Example foo = Test3.Amigo.Example.FOO; @@ -66,6 +163,17 @@ public final class Test3 { super(); } + /** + * public final object Test3.Amigo : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // nested class: Example + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Amigo { @org.jetbrains.annotations.NotNull() @@ -75,6 +183,19 @@ public final class Test3 { super(); } + /** + * public final enum class Test3.Amigo.Example : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * FOO, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public static enum Example { /*public static final*/ FOO /* = new Example() */; @@ -88,6 +209,23 @@ public final class Test3 { //////////////////// +/** + * public final class Test4 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: foo:I + * private final val foo: kotlin/Int (* = ... *) + * private final get + * + * // companion object: Companion + * + * // nested class: Companion + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test4 { private final int foo = 1; @@ -98,6 +236,17 @@ public final class Test4 { super(); } + /** + * public final companion object Test4.Companion : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // nested class: Foo + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Companion { @@ -105,6 +254,19 @@ public final class Test4 { super(); } + /** + * public final object Test4.Companion.Foo : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // field: constProperty:I + * public final const val constProperty: kotlin/Int (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Foo { @org.jetbrains.annotations.NotNull() @@ -121,6 +283,21 @@ public final class Test4 { //////////////////// +/** + * public final class Test5 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: foo:LTest5$Amigos$Companion$Goo$Example; + * private final val foo: Test5.Amigos.Companion.Goo.Example + * private final get + * + * // nested class: Amigos + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test5 { private final Test5.Amigos.Companion.Goo.Example foo; @@ -129,6 +306,19 @@ public final class Test5 { super(); } + /** + * public final class Test5.Amigos : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // companion object: Companion + * + * // nested class: Companion + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Amigos { @org.jetbrains.annotations.NotNull() @@ -138,6 +328,17 @@ public final class Test5 { super(); } + /** + * public final companion object Test5.Amigos.Companion : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // nested class: Goo + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Companion { @@ -145,6 +346,17 @@ public final class Test5 { super(); } + /** + * public final class Test5.Amigos.Companion.Goo : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: Example + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Goo { @@ -152,6 +364,19 @@ public final class Test5 { super(); } + /** + * public final enum class Test5.Amigos.Companion.Goo.Example : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * FOO, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public static enum Example { /*public static final*/ FOO /* = new Example() */; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/enumSecondaryConstructor.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/enumSecondaryConstructor.ir.txt index 11f65122a80..b57e970056a 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/enumSecondaryConstructor.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/enumSecondaryConstructor.ir.txt @@ -1,4 +1,3 @@ -@kotlin.Metadata() public enum Foo { /*public static final*/ BLA /* = new Foo() */; @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/enumSecondaryConstructor.kt b/plugins/kapt3/kapt3-compiler/testData/converter/enumSecondaryConstructor.kt index 7eb47402e60..8f4a120b32b 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/enumSecondaryConstructor.kt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/enumSecondaryConstructor.kt @@ -1,3 +1,5 @@ +// STRIP_METADATA + enum class Foo { BLA("bla"); diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/enumSecondaryConstructor.txt b/plugins/kapt3/kapt3-compiler/testData/converter/enumSecondaryConstructor.txt index 2dc9881a662..ef894bfd84f 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/enumSecondaryConstructor.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/enumSecondaryConstructor.txt @@ -1,4 +1,3 @@ -@kotlin.Metadata() public enum Foo { /*public static final*/ BLA /* = new Foo() */; @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/enums.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/enums.fir.txt index 12bb5b1fb3e..0e8fe3d53b0 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/enums.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/enums.fir.txt @@ -1,3 +1,16 @@ +/** + * public final annotation class Anno1 : kotlin/Annotation { + * + * // signature: (Ljava/lang/String;)V + * public constructor(value: kotlin/String) + * + * // getter: value()Ljava/lang/String; + * public final val value: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface Anno1 { @@ -8,6 +21,21 @@ public abstract @interface Anno1 { //////////////////// +/** + * public final enum class Enum1 : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * BLACK, + * + * WHITE, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Enum1 { /*public static final*/ BLACK /* = new Enum1() */, @@ -25,6 +53,40 @@ public enum Enum1 { //////////////////// +/** + * public final enum class Enum2 : kotlin/Enum { + * + * // signature: (Ljava/lang/String;ILjava/lang/String;I)V + * private constructor(col: kotlin/String, col2: kotlin/Int) + * + * // signature: color()Ljava/lang/String; + * public final fun color(): kotlin/String + * + * // signature: privateEnumFun()V + * private final fun privateEnumFun(): kotlin/Unit + * + * // signature: publicEnumFun()V + * public final fun publicEnumFun(): kotlin/Unit + * + * // field: col:Ljava/lang/String; + * // getter: getCol()Ljava/lang/String; + * public final val col: kotlin/String + * public final get + * + * // field: col2:I + * // getter: getCol2()I + * public final val col2: kotlin/Int + * public final get + * + * RED, + * + * WHITE, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Enum2 { /*public static final*/ RED /* = new Enum2() */, @@ -67,9 +129,30 @@ public enum Enum2 { //////////////////// +/** + * public abstract interface I : kotlin/Any { + * + * // nested class: Nested + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface I { + /** + * public final enum class I.Nested : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * WHITE, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public static enum Nested { /*public static final*/ WHITE /* = new Nested() */; @@ -87,6 +170,19 @@ public abstract interface I { //////////////////// +/** + * public final enum class Nested1 : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * WHITE, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Nested1 { /*public static final*/ WHITE /* = new Nested1() */; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/enums.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/enums.ir.txt index 5b885c62d8c..7ca5eb7f9b7 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/enums.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/enums.ir.txt @@ -1,4 +1,17 @@ @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class Anno1 : kotlin/Annotation { + * + * // signature: (Ljava/lang/String;)V + * public constructor(value: kotlin/String) + * + * // getter: value()Ljava/lang/String; + * public final val value: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno1 { @@ -8,6 +21,21 @@ public abstract @interface Anno1 { //////////////////// +/** + * public final enum class Enum1 : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * BLACK, + * + * WHITE, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Enum1 { /*public static final*/ BLACK /* = new Enum1() */, @@ -25,6 +53,40 @@ public enum Enum1 { //////////////////// +/** + * public final enum class Enum2 : kotlin/Enum { + * + * // signature: (Ljava/lang/String;ILjava/lang/String;I)V + * private constructor(col: kotlin/String, col2: kotlin/Int) + * + * // signature: color()Ljava/lang/String; + * public final fun color(): kotlin/String + * + * // signature: privateEnumFun()V + * private final fun privateEnumFun(): kotlin/Unit + * + * // signature: publicEnumFun()V + * public final fun publicEnumFun(): kotlin/Unit + * + * // field: col:Ljava/lang/String; + * // getter: getCol()Ljava/lang/String; + * public final val col: kotlin/String + * public final get + * + * // field: col2:I + * // getter: getCol2()I + * public final val col2: kotlin/Int + * public final get + * + * RED, + * + * WHITE, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Enum2 { /*public static final*/ RED /* = new Enum2() */, @@ -67,9 +129,30 @@ public enum Enum2 { //////////////////// +/** + * public abstract interface I : kotlin/Any { + * + * // nested class: Nested + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface I { + /** + * public final enum class I.Nested : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * WHITE, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public static enum Nested { /*public static final*/ WHITE /* = new Nested() */; @@ -87,6 +170,19 @@ public abstract interface I { //////////////////// +/** + * public final enum class Nested1 : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * WHITE, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Nested1 { /*public static final*/ WHITE /* = new Nested1() */; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/enums.txt b/plugins/kapt3/kapt3-compiler/testData/converter/enums.txt index 967830b511b..6c81245218c 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/enums.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/enums.txt @@ -1,4 +1,17 @@ @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class Anno1 : kotlin/Annotation { + * + * // signature: (Ljava/lang/String;)V + * public constructor(value: kotlin/String) + * + * // getter: value()Ljava/lang/String; + * public final val value: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno1 { @@ -8,6 +21,21 @@ public abstract @interface Anno1 { //////////////////// +/** + * public final enum class Enum1 : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * BLACK, + * + * WHITE, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Enum1 { /*public static final*/ BLACK /* = new Enum1() */, @@ -20,6 +48,40 @@ public enum Enum1 { //////////////////// +/** + * public final enum class Enum2 : kotlin/Enum { + * + * // signature: (Ljava/lang/String;ILjava/lang/String;I)V + * private constructor(col: kotlin/String, col2: kotlin/Int) + * + * // signature: color()Ljava/lang/String; + * public final fun color(): kotlin/String + * + * // signature: privateEnumFun()V + * private final fun privateEnumFun(): kotlin/Unit + * + * // signature: publicEnumFun()V + * public final fun publicEnumFun(): kotlin/Unit + * + * // field: col:Ljava/lang/String; + * // getter: getCol()Ljava/lang/String; + * public final val col: kotlin/String + * public final get + * + * // field: col2:I + * // getter: getCol2()I + * public final val col2: kotlin/Int + * public final get + * + * RED, + * + * WHITE, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Enum2 { /*public static final*/ RED /* = new Enum2() */, @@ -57,9 +119,30 @@ public enum Enum2 { //////////////////// +/** + * public abstract interface I : kotlin/Any { + * + * // nested class: Nested + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface I { + /** + * public final enum class I.Nested : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * WHITE, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public static enum Nested { /*public static final*/ WHITE /* = new Nested() */; @@ -72,6 +155,19 @@ public abstract interface I { //////////////////// +/** + * public final enum class Nested1 : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * WHITE, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Nested1 { /*public static final*/ WHITE /* = new Nested1() */; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/errorExtensionReceiver.txt b/plugins/kapt3/kapt3-compiler/testData/converter/errorExtensionReceiver.txt index 1df266b201c..ee7924e373a 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/errorExtensionReceiver.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/errorExtensionReceiver.txt @@ -1,3 +1,31 @@ +/** + * public final class TypeHook : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: receiverFunction(Lerror/NonExistentClass;)Lerror/NonExistentClass; + * public final fun error/NonExistentClass.receiverFunction(): error/NonExistentClass + * + * // getter: getCustomProperty()Lerror/NonExistentClass; + * // setter: setCustomProperty(Lerror/NonExistentClass;)V + * public final var customProperty: error/NonExistentClass + * public final (* non-default *) get + * public final (* non-default *) set(value: error/NonExistentClass) + * + * // getter: getReceiverProperty(Lerror/NonExistentClass;)Lerror/NonExistentClass; + * // setter: setReceiverProperty(Lerror/NonExistentClass;Lerror/NonExistentClass;)V + * public final var error/NonExistentClass.receiverProperty: error/NonExistentClass + * public final (* non-default *) get + * public final (* non-default *) set(value: error/NonExistentClass) + * + * // companion object: Companion + * + * // nested class: Companion + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) public final class TypeHook { @@ -34,6 +62,21 @@ public final class TypeHook { return null; } + /** + * public final companion object TypeHook.Companion : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // getter: getExtensionProperty(Lerror/NonExistentClass;)Lerror/NonExistentClass; + * // setter: setExtensionProperty(Lerror/NonExistentClass;Lerror/NonExistentClass;)V + * public final var error/NonExistentClass.extensionProperty: error/NonExistentClass + * public final (* non-default *) get + * public final (* non-default *) set(value: error/NonExistentClass) + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Companion { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/errorLocationMapping.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/errorLocationMapping.fir.txt index 2a8ff30adeb..cd3620e7004 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/errorLocationMapping.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/errorLocationMapping.fir.txt @@ -1,3 +1,16 @@ +/** + * public final annotation class Anno : kotlin/Annotation { + * + * // signature: (Lkotlin/reflect/KClass;)V + * public constructor(a: kotlin/reflect/KClass) + * + * // getter: a()Ljava/lang/Class; + * public final val a: kotlin/reflect/KClass + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface Anno { @@ -8,6 +21,15 @@ public abstract @interface Anno { //////////////////// +/** + * public final class ErrorInAnnotation : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @Anno(a = ABC.class) public final class ErrorInAnnotation { @@ -20,6 +42,30 @@ public final class ErrorInAnnotation { //////////////////// +/** + * public final class ErrorInConstructorParameter : kotlin/Any { + * + * // signature: (Ljava/lang/String;Lerror/NonExistentClass;Ljava/util/List;)V + * public constructor(a: kotlin/String, b: error/NonExistentClass, c: kotlin/collections/List) + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String + * public final get + * + * // field: b:Lerror/NonExistentClass; + * // getter: getB()Lerror/NonExistentClass; + * public final val b: error/NonExistentClass + * public final get + * + * // field: c:Ljava/util/List; + * // getter: getC()Ljava/util/List; + * public final val c: kotlin/collections/List + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class ErrorInConstructorParameter { @org.jetbrains.annotations.NotNull() @@ -55,6 +101,54 @@ public final class ErrorInConstructorParameter { //////////////////// +/** + * public final class ErrorInDeclarations : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: f1(Ljava/lang/String;Lerror/NonExistentClass;)V + * public final fun f1(a: kotlin/String, b: error/NonExistentClass): kotlin/Unit + * + * // signature: f2()V + * public final fun f2(): kotlin/Unit + * + * // signature: f3()V + * public final fun f3(): kotlin/Unit + * + * // signature: f4()Lerror/NonExistentClass; + * public final fun f4(): error/NonExistentClass + * + * // signature: overloads(Lerror/NonExistentClass;)V + * public final fun overloads(a: error/NonExistentClass): kotlin/Unit + * + * // signature: overloads(Ljava/lang/String;)V + * public final fun overloads(a: kotlin/String): kotlin/Unit + * + * // field: p1:Ljava/lang/String; + * // getter: getP1()Ljava/lang/String; + * // setter: setP1(Ljava/lang/String;)V + * public final lateinit var p1: kotlin/String + * public final get + * public final set + * + * // field: p2:Lerror/NonExistentClass; + * // getter: getP2()Lerror/NonExistentClass; + * // setter: setP2(Lerror/NonExistentClass;)V + * public final lateinit var p2: error/NonExistentClass + * public final get + * public final set + * + * // field: p3:Lerror/NonExistentClass; + * // getter: getP3()Lerror/NonExistentClass; + * // setter: setP3(Lerror/NonExistentClass;)V + * public final lateinit var p3: error/NonExistentClass + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public final class ErrorInDeclarations { public java.lang.String p1; @@ -120,6 +214,15 @@ public final class ErrorInDeclarations { //////////////////// +/** + * public final class ErrorInSupertype : error/NonExistentClass { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class ErrorInSupertype implements ABC { @@ -131,6 +234,15 @@ public final class ErrorInSupertype implements ABC { //////////////////// +/** + * public final class ErrorInSupertype2 : error/NonExistentClass { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class ErrorInSupertype2 extends ABC { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/errorLocationMapping.txt b/plugins/kapt3/kapt3-compiler/testData/converter/errorLocationMapping.txt index 2207c5a59b2..73ea8734328 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/errorLocationMapping.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/errorLocationMapping.txt @@ -1,6 +1,19 @@ import kotlin.reflect.KClass; @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class Anno : kotlin/Annotation { + * + * // signature: (Lkotlin/reflect/KClass;)V + * public constructor(a: kotlin/reflect/KClass) + * + * // getter: a()Ljava/lang/Class; + * public final val a: kotlin/reflect/KClass + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno { @@ -13,6 +26,15 @@ public abstract @interface Anno { import kotlin.reflect.KClass; @Anno(a = ABC.class) +/** + * public final class ErrorInAnnotation : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class ErrorInAnnotation { @@ -26,6 +48,30 @@ public final class ErrorInAnnotation { import kotlin.reflect.KClass; +/** + * public final class ErrorInConstructorParameter : kotlin/Any { + * + * // signature: (Ljava/lang/String;Lerror/NonExistentClass;Ljava/util/List;)V + * public constructor(a: kotlin/String, b: error/NonExistentClass, c: kotlin/collections/List) + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String + * public final get + * + * // field: b:Lerror/NonExistentClass; + * // getter: getB()Lerror/NonExistentClass; + * public final val b: error/NonExistentClass + * public final get + * + * // field: c:Ljava/util/List; + * // getter: getC()Ljava/util/List; + * public final val c: kotlin/collections/List + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class ErrorInConstructorParameter { @org.jetbrains.annotations.NotNull() @@ -63,6 +109,54 @@ public final class ErrorInConstructorParameter { import kotlin.reflect.KClass; +/** + * public final class ErrorInDeclarations : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: f1(Ljava/lang/String;Lerror/NonExistentClass;)V + * public final fun f1(a: kotlin/String, b: error/NonExistentClass): kotlin/Unit + * + * // signature: f2()V + * public final fun f2(): kotlin/Unit + * + * // signature: f3()V + * public final fun f3(): kotlin/Unit + * + * // signature: f4()Lerror/NonExistentClass; + * public final fun f4(): error/NonExistentClass + * + * // signature: overloads(Lerror/NonExistentClass;)V + * public final fun overloads(a: error/NonExistentClass): kotlin/Unit + * + * // signature: overloads(Ljava/lang/String;)V + * public final fun overloads(a: kotlin/String): kotlin/Unit + * + * // field: p1:Ljava/lang/String; + * // getter: getP1()Ljava/lang/String; + * // setter: setP1(Ljava/lang/String;)V + * public final lateinit var p1: kotlin/String + * public final get + * public final set + * + * // field: p2:Lerror/NonExistentClass; + * // getter: getP2()Lerror/NonExistentClass; + * // setter: setP2(Lerror/NonExistentClass;)V + * public final lateinit var p2: error/NonExistentClass + * public final get + * public final set + * + * // field: p3:Lerror/NonExistentClass; + * // getter: getP3()Lerror/NonExistentClass; + * // setter: setP3(Lerror/NonExistentClass;)V + * public final lateinit var p3: error/NonExistentClass + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public final class ErrorInDeclarations { public java.lang.String p1; @@ -130,6 +224,15 @@ public final class ErrorInDeclarations { import kotlin.reflect.KClass; +/** + * public final class ErrorInSupertype : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class ErrorInSupertype implements ABC { @@ -143,6 +246,15 @@ public final class ErrorInSupertype implements ABC { import kotlin.reflect.KClass; +/** + * public final class ErrorInSupertype2 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class ErrorInSupertype2 extends ABC { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclass.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclass.fir.txt index 058e93a1c74..fec28c8888d 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclass.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclass.fir.txt @@ -1,5 +1,14 @@ package test; +/** + * internal final annotation class test/Anno : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface Anno { @@ -9,6 +18,15 @@ public abstract @interface Anno { package test; +/** + * internal final class test/ClassWithParent : error/NonExistentClass, error/NonExistentClass, error/NonExistentClass, kotlin/CharSequence { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @Anno() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclass.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclass.ir.txt index eaaaac7e63f..a76bf7326b3 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclass.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclass.ir.txt @@ -1,6 +1,15 @@ package test; @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * internal final annotation class test/Anno : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno { } @@ -10,6 +19,15 @@ public abstract @interface Anno { package test; @Anno() +/** + * internal final class test/ClassWithParent : kotlin/CharSequence { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) public final class ClassWithParent implements java.lang.CharSequence { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclass.txt b/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclass.txt index 8291997b9c5..cef745f177a 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclass.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclass.txt @@ -1,6 +1,15 @@ package test; @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * internal final annotation class test/Anno : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno { } @@ -10,6 +19,15 @@ public abstract @interface Anno { package test; @Anno() +/** + * internal final class test/ClassWithParent : kotlin/CharSequence { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) public final class ClassWithParent implements java.lang.CharSequence { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclassCorrectErrorTypes.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclassCorrectErrorTypes.fir.txt index d337e457bd6..1a7cf028fb2 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclassCorrectErrorTypes.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclassCorrectErrorTypes.fir.txt @@ -1,5 +1,14 @@ package test; +/** + * public final class test/Child : kotlin/collections/AbstractList, test/Parent, kotlin/collections/List { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Child extends kotlin.collections.AbstractList implements test.Parent, java.util.List, kotlin.jvm.internal.markers.KMappedMarker { @@ -12,6 +21,15 @@ public final class Child extends kotlin.collections.AbstractList()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public class Cl { @@ -24,6 +42,15 @@ public class Cl { package test; +/** + * public final class test/Generics1 : error/NonExistentClass { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Generics1 extends Foo { @@ -36,6 +63,15 @@ public final class Generics1 extends Foo { package test; +/** + * public final class test/Generics2 : error/NonExistentClass { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Generics2 implements Foo { @@ -48,6 +84,15 @@ public final class Generics2 implements Foo { package test; +/** + * public final class test/Generics3 : error/NonExistentClass { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Generics3 implements Foo>, java.lang.String> { @@ -60,6 +105,12 @@ public final class Generics3 implements Foo package test; +/** + * public abstract interface test/Intf : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Intf { } @@ -68,6 +119,22 @@ public abstract interface Intf { package test; +/** + * public final class test/MappedList : kotlin/collections/AbstractList, kotlin/collections/List { + * + * // signature: ()V + * public constructor() + * + * // signature: get(I)Ljava/lang/Void; + * public open operator fun get(index: kotlin/Int): kotlin/Nothing + * + * // getter: getSize()I + * public open val size: kotlin/Int + * public open (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class MappedList extends kotlin.collections.AbstractList implements java.util.List, kotlin.jvm.internal.markers.KMappedMarker { @@ -91,6 +158,12 @@ public final class MappedList extends kotlin.collect package test; +/** + * public abstract interface test/Parent : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Parent { } @@ -99,6 +172,15 @@ public abstract interface Parent()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TBarBazCl extends test.Cl implements Bar, Baz { @@ -111,6 +193,15 @@ public final class TBarBazCl extends test.Cl implements Bar, Baz { package test; +/** + * public final class test/TClBarBaz : test/Cl, error/NonExistentClass, error/NonExistentClass { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TClBarBaz extends test.Cl implements Bar, Baz { @@ -123,6 +214,20 @@ public final class TClBarBaz extends test.Cl implements Bar, Baz { package test; +/** + * public final class test/TFooBar : error/NonExistentClass, error/NonExistentClass, test/Intf { + * + * // signature: (Lerror/NonExistentClass;)V + * public constructor(a: error/NonExistentClass) + * + * // field: a:Lerror/NonExistentClass; + * // getter: getA()Lerror/NonExistentClass; + * public final val a: error/NonExistentClass + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TFooBar extends Foo implements Bar, test.Intf { @org.jetbrains.annotations.NotNull() @@ -143,6 +248,20 @@ public final class TFooBar extends Foo implements Bar, test.Intf { package test; +/** + * public final class test/TFooBar2 : error/NonExistentClass, error/NonExistentClass { + * + * // signature: (Lerror/NonExistentClass;)V + * public constructor(a: error/NonExistentClass) + * + * // field: a:Lerror/NonExistentClass; + * // getter: getA()Lerror/NonExistentClass; + * public final val a: error/NonExistentClass + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TFooBar2 implements Foo, Bar { @org.jetbrains.annotations.NotNull() @@ -163,6 +282,15 @@ public final class TFooBar2 implements Foo, Bar { package test; +/** + * public final class test/TFooBarBaz : error/NonExistentClass, error/NonExistentClass, error/NonExistentClass { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TFooBarBaz extends Foo implements Bar, Baz { @@ -175,6 +303,15 @@ public final class TFooBarBaz extends Foo implements Bar, Baz { package test; +/** + * public final class test/TFooBarBaz2 : error/NonExistentClass, error/NonExistentClass, error/NonExistentClass, test/Intf { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TFooBarBaz2 extends Foo implements Baz, test.Intf { @@ -187,6 +324,15 @@ public final class TFooBarBaz2 extends Foo implements Baz, test.Intf { package test; +/** + * public final class test/TFooBarBaz3 : error/NonExistentClass, error/NonExistentClass, error/NonExistentClass { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TFooBarBaz3 implements Foo, Bar, Baz { @@ -199,6 +345,15 @@ public final class TFooBarBaz3 implements Foo, Bar, Baz { package test; +/** + * public final class test/TFooBarBaz4 : error/NonExistentClass, error/NonExistentClass, error/NonExistentClass { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TFooBarBaz4 implements Foo, Bar, Baz { @@ -211,6 +366,18 @@ public final class TFooBarBaz4 implements Foo, Bar, Baz { package test; +/** + * public final class test/TFooBarBaz5 : error/NonExistentClass, error/NonExistentClass, error/NonExistentClass { + * + * // signature: ()V + * public constructor() + * + * // signature: (Ljava/lang/String;)V + * public (* secondary *) constructor(s: kotlin/String) + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TFooBarBaz5 implements Foo, Bar, Baz { @@ -228,6 +395,15 @@ public final class TFooBarBaz5 implements Foo, Bar, Baz { package test; +/** + * public final class test/TFooBarBaz6 : error/NonExistentClass, error/NonExistentClass, error/NonExistentClass { + * + * // signature: (Ljava/lang/String;)V + * public (* secondary *) constructor(s: kotlin/String) + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TFooBarBaz6 implements Foo, Bar, Baz { @@ -241,6 +417,15 @@ public final class TFooBarBaz6 implements Foo, Bar, Baz { package test; +/** + * public final class test/TxFooxBarxBaz : error/NonExistentClass, error/NonExistentClass, error/NonExistentClass, test/Intf { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TxFooxBarxBaz extends x.Foo implements x.Bar, x.Baz, test.Intf { @@ -253,6 +438,15 @@ public final class TxFooxBarxBaz extends x.Foo implements x.Bar, x.Baz, test.Int package test; +/** + * public final class test/TxFooxBarxBaz2 : error/NonExistentClass, error/NonExistentClass, error/NonExistentClass { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TxFooxBarxBaz2 extends x.Foo implements x.Bar { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclassCorrectErrorTypes.txt b/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclassCorrectErrorTypes.txt index 9870e360a72..ba1e8d13e59 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclassCorrectErrorTypes.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/errorSuperclassCorrectErrorTypes.txt @@ -1,5 +1,14 @@ package test; +/** + * public final class test/Child : kotlin/collections/AbstractList, test/Parent, kotlin/collections/List { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Child extends kotlin.collections.AbstractList implements test.Parent, java.util.List { @@ -42,6 +51,15 @@ public final class Child extends kotlin.collections.AbstractList()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public class Cl { @@ -54,6 +72,15 @@ public class Cl { package test; +/** + * public final class test/Generics1 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Generics1 extends Foo { @@ -66,6 +93,15 @@ public final class Generics1 extends Foo { package test; +/** + * public final class test/Generics2 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Generics2 implements Foo { @@ -78,6 +114,15 @@ public final class Generics2 implements Foo { package test; +/** + * public final class test/Generics3 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Generics3 implements Foo>, java.lang.String> { @@ -90,6 +135,12 @@ public final class Generics3 implements Foo package test; +/** + * public abstract interface test/Intf : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Intf { } @@ -98,6 +149,22 @@ public abstract interface Intf { package test; +/** + * public final class test/MappedList : kotlin/collections/AbstractList, kotlin/collections/List { + * + * // signature: ()V + * public constructor() + * + * // signature: get(I)Ljava/lang/Void; + * public open operator fun get(index: kotlin/Int): kotlin/Nothing + * + * // getter: getSize()I + * public open val size: kotlin/Int + * public open (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class MappedList extends kotlin.collections.AbstractList implements java.util.List { @@ -121,6 +188,12 @@ public final class MappedList extends kotlin.collect package test; +/** + * public abstract interface test/Parent : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Parent { } @@ -129,6 +202,15 @@ public abstract interface Parent()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TBarBazCl extends test.Cl implements Bar, Baz { @@ -141,6 +223,15 @@ public final class TBarBazCl extends test.Cl implements Bar, Baz { package test; +/** + * public final class test/TClBarBaz : test/Cl { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TClBarBaz extends test.Cl implements Bar, Baz { @@ -153,6 +244,20 @@ public final class TClBarBaz extends test.Cl implements Bar, Baz { package test; +/** + * public final class test/TFooBar : test/Intf { + * + * // signature: (Lerror/NonExistentClass;)V + * public constructor(a: error/NonExistentClass) + * + * // field: a:Lerror/NonExistentClass; + * // getter: getA()Lerror/NonExistentClass; + * public final val a: error/NonExistentClass + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TFooBar extends Foo implements test.Intf, Bar { @org.jetbrains.annotations.NotNull() @@ -173,6 +278,20 @@ public final class TFooBar extends Foo implements test.Intf, Bar { package test; +/** + * public final class test/TFooBar2 : kotlin/Any { + * + * // signature: (Lerror/NonExistentClass;)V + * public constructor(a: error/NonExistentClass) + * + * // field: a:Lerror/NonExistentClass; + * // getter: getA()Lerror/NonExistentClass; + * public final val a: error/NonExistentClass + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TFooBar2 implements Foo, Bar { @org.jetbrains.annotations.NotNull() @@ -193,6 +312,15 @@ public final class TFooBar2 implements Foo, Bar { package test; +/** + * public final class test/TFooBarBaz : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TFooBarBaz extends Foo implements Bar, Baz { @@ -205,6 +333,15 @@ public final class TFooBarBaz extends Foo implements Bar, Baz { package test; +/** + * public final class test/TFooBarBaz2 : test/Intf { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TFooBarBaz2 implements test.Intf { @@ -217,6 +354,15 @@ public final class TFooBarBaz2 implements test.Intf { package test; +/** + * public final class test/TFooBarBaz3 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TFooBarBaz3 implements Foo, Bar, Baz { @@ -229,6 +375,15 @@ public final class TFooBarBaz3 implements Foo, Bar, Baz { package test; +/** + * public final class test/TFooBarBaz4 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TFooBarBaz4 implements Foo, Bar, Baz { @@ -241,6 +396,18 @@ public final class TFooBarBaz4 implements Foo, Bar, Baz { package test; +/** + * public final class test/TFooBarBaz5 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: (Ljava/lang/String;)V + * public (* secondary *) constructor(s: kotlin/String) + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TFooBarBaz5 implements Foo, Bar, Baz { @@ -258,6 +425,15 @@ public final class TFooBarBaz5 implements Foo, Bar, Baz { package test; +/** + * public final class test/TFooBarBaz6 : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * public (* secondary *) constructor(s: kotlin/String) + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TFooBarBaz6 extends Foo implements Bar, Baz { @@ -271,6 +447,15 @@ public final class TFooBarBaz6 extends Foo implements Bar, Baz { package test; +/** + * public final class test/TxFooxBarxBaz : test/Intf { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TxFooxBarxBaz extends x.Foo implements test.Intf, x.Bar, x.Baz { @@ -283,6 +468,15 @@ public final class TxFooxBarxBaz extends x.Foo implements test.Intf, x.Bar, x.Ba package test; +/** + * public final class test/TxFooxBarxBaz2 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TxFooxBarxBaz2 { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/fileFacadeJvmName.txt b/plugins/kapt3/kapt3-compiler/testData/converter/fileFacadeJvmName.txt index f61bdea7812..41ffbcd72ae 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/fileFacadeJvmName.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/fileFacadeJvmName.txt @@ -1,5 +1,18 @@ package a.b.c; +/** + * package { + * + * // signature: foo()V + * public final fun foo(): kotlin/Unit + * + * // field: bar:I + * public final const val bar: kotlin/Int (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.jvm.JvmName(name = "FacadeName") public final class FacadeName { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/functions.txt b/plugins/kapt3/kapt3-compiler/testData/converter/functions.txt index d0cb11b5e2a..adcb5b2552d 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/functions.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/functions.txt @@ -1,3 +1,24 @@ +/** + * public final class FunctionsTest : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: f()Lkotlin/reflect/KProperty1; + * public final fun f(): kotlin/reflect/KProperty1 + * + * // signature: f2()Lkotlin/jvm/functions/Function2; + * public final fun f2(): kotlin/Function2 + * + * // signature: f3()V + * public final fun f3(): kotlin/Unit + * + * // signature: f4()I + * public final fun f4(): kotlin/Int + * + * // module name: main + * } + */ @kotlin.Metadata() public final class FunctionsTest { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/genericParameters.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/genericParameters.fir.txt index 32461696bdf..c8b8188cc02 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/genericParameters.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/genericParameters.fir.txt @@ -1,3 +1,28 @@ +/** + * public final class MappedList : kotlin/collections/AbstractList, kotlin/collections/List { + * + * // signature: (Ljava/util/List;Lkotlin/jvm/functions/Function1;)V + * public constructor(list: kotlin/collections/List, function: kotlin/Function1) + * + * // signature: get(I)Ljava/lang/Object; + * public open operator fun get(index: kotlin/Int): T#1 + * + * // field: function:Lkotlin/jvm/functions/Function1; + * private final val function: kotlin/Function1 + * private final get + * + * // field: list:Ljava/util/List; + * // getter: getList()Ljava/util/List; + * public final val list: kotlin/collections/List + * public final get + * + * // getter: getSize()I + * public open val size: kotlin/Int + * public open (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class MappedList extends kotlin.collections.AbstractList implements java.util.List, kotlin.jvm.internal.markers.KMappedMarker { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/genericParameters.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/genericParameters.ir.txt index 60749ca73bf..cec2190bf92 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/genericParameters.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/genericParameters.ir.txt @@ -1,3 +1,28 @@ +/** + * public final class MappedList : kotlin/collections/AbstractList, kotlin/collections/List { + * + * // signature: (Ljava/util/List;Lkotlin/jvm/functions/Function1;)V + * public constructor(list: kotlin/collections/List, function: kotlin/Function1) + * + * // signature: get(I)Ljava/lang/Object; + * public open operator fun get(index: kotlin/Int): T#1 + * + * // field: function:Lkotlin/jvm/functions/Function1; + * private final val function: kotlin/Function1 + * private final get + * + * // field: list:Ljava/util/List; + * // getter: getList()Ljava/util/List; + * public final val list: kotlin/collections/List + * public final get + * + * // getter: getSize()I + * public open val size: kotlin/Int + * public open (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class MappedList extends kotlin.collections.AbstractList implements java.util.List { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/genericParameters.txt b/plugins/kapt3/kapt3-compiler/testData/converter/genericParameters.txt index 959f5effbd5..5acdfae4b3a 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/genericParameters.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/genericParameters.txt @@ -1,3 +1,28 @@ +/** + * public final class MappedList : kotlin/collections/AbstractList, kotlin/collections/List { + * + * // signature: (Ljava/util/List;Lkotlin/jvm/functions/Function1;)V + * public constructor(list: kotlin/collections/List, function: kotlin/Function1) + * + * // signature: get(I)Ljava/lang/Object; + * public open operator fun get(index: kotlin/Int): T#1 + * + * // field: function:Lkotlin/jvm/functions/Function1; + * private final val function: kotlin/Function1 + * private final get + * + * // field: list:Ljava/util/List; + * // getter: getList()Ljava/util/List; + * public final val list: kotlin/collections/List + * public final get + * + * // getter: getSize()I + * public open val size: kotlin/Int + * public open (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class MappedList extends kotlin.collections.AbstractList implements java.util.List { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/genericRawSignatures.txt b/plugins/kapt3/kapt3-compiler/testData/converter/genericRawSignatures.txt index 43c8168263c..2c1ee82645e 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/genericRawSignatures.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/genericRawSignatures.txt @@ -1,3 +1,18 @@ +/** + * public final class GenericRawSignatures : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: genericFun()Ljava/lang/Object; + * public final fun genericFun(): T#0? + * + * // signature: nonGenericFun()Ljava/lang/String; + * public final fun nonGenericFun(): kotlin/String? + * + * // module name: main + * } + */ @kotlin.Metadata() public final class GenericRawSignatures { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/genericSimple.txt b/plugins/kapt3/kapt3-compiler/testData/converter/genericSimple.txt index 77aac3433ed..13f92851659 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/genericSimple.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/genericSimple.txt @@ -1,3 +1,15 @@ +/** + * public abstract interface ABC : kotlin/Any { + * + * // signature: abc(Ljava/lang/CharSequence;Ljava/util/List;[Ljava/lang/CharSequence;)Ljava/util/List; + * public abstract fun abc(item: T#0, items: kotlin/collections/List, vararg otherItems: T#0 (* kotlin/Array *)): kotlin/collections/List + * + * // signature: bcd([C)I + * public abstract fun bcd(vararg a: kotlin/Char (* kotlin/CharArray *)): kotlin/Int + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface ABC { @@ -14,6 +26,15 @@ public abstract interface ABC { //////////////////// +/** + * public open class BaseClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public class BaseClass { @@ -25,6 +46,12 @@ public class BaseClass { //////////////////// +/** + * public abstract interface Intf : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Intf { } @@ -32,6 +59,12 @@ public abstract interface Intf, T#1 (* M *) : T#0> : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Intf2, M extends T> { } @@ -39,6 +72,20 @@ public abstract interface Intf2 : Intf, OtherIntf, BaseClass { + * + * // signature: ()V + * public constructor() + * + * // field: fld:Ljava/util/List; + * // getter: getFld()Ljava/util/List; + * public final val fld: kotlin/collections/List>? + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class MyClass extends BaseClass implements Intf, OtherIntf { @org.jetbrains.annotations.Nullable() @@ -57,6 +104,12 @@ public final class MyClass : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface OtherIntf { } diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/ignoredMembers.kt b/plugins/kapt3/kapt3-compiler/testData/converter/ignoredMembers.kt index 10e1b56c7d2..92f3757c2da 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/ignoredMembers.kt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/ignoredMembers.kt @@ -1,3 +1,5 @@ +// STRIP_METADATA +// TODO: Re-enable metadata generation import kotlinx.kapt.* class Test { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/ignoredMembers.txt b/plugins/kapt3/kapt3-compiler/testData/converter/ignoredMembers.txt index 53867d57941..c40d2ee304f 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/ignoredMembers.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/ignoredMembers.txt @@ -1,4 +1,3 @@ -@kotlin.Metadata() public final class Test { @org.jetbrains.annotations.NotNull() public final java.lang.String ignoredProperty = ""; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/implicitReturnTypes.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/implicitReturnTypes.fir.txt index d1b0b4c7252..1889425a8e6 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/implicitReturnTypes.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/implicitReturnTypes.fir.txt @@ -15,6 +15,22 @@ public abstract class Prop { package test; +/** + * public final class test/Cl : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * public constructor(name: kotlin/String) + * + * // field: name:Ljava/lang/String; + * // getter: getName()Ljava/lang/String; + * // setter: setName(Ljava/lang/String;)V + * public final var name: kotlin/String + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Cl { @org.jetbrains.annotations.NotNull() @@ -39,6 +55,27 @@ public final class Cl { package test; +/** + * package { + * + * // field: TEST:Llib/Prop; + * // getter: getTEST()Llib/Prop; + * public final val TEST: lib/Prop + * public final get + * + * // field: TESTS_ARRAY:[Llib/Prop; + * // getter: getTESTS_ARRAY()[Llib/Prop; + * public final val TESTS_ARRAY: kotlin/Array> + * public final get + * + * // field: TESTS_LIST:Ljava/util/List; + * // getter: getTESTS_LIST()Ljava/util/List; + * public final val TESTS_LIST: kotlin/collections/List> + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TestKt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/implicitReturnTypes.txt b/plugins/kapt3/kapt3-compiler/testData/converter/implicitReturnTypes.txt index 1c2bfd86254..ad44c7f6590 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/implicitReturnTypes.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/implicitReturnTypes.txt @@ -15,6 +15,22 @@ public abstract class Prop { package test; +/** + * public final class test/Cl : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * public constructor(name: kotlin/String) + * + * // field: name:Ljava/lang/String; + * // getter: getName()Ljava/lang/String; + * // setter: setName(Ljava/lang/String;)V + * public final var name: kotlin/String + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Cl { @org.jetbrains.annotations.NotNull() @@ -39,6 +55,27 @@ public final class Cl { package test; +/** + * package { + * + * // field: TEST:Llib/Prop; + * // getter: getTEST()Llib/Prop; + * public final val TEST: lib/Prop + * public final get + * + * // field: TESTS_ARRAY:[Llib/Prop; + * // getter: getTESTS_ARRAY()[Llib/Prop; + * public final val TESTS_ARRAY: kotlin/Array> + * public final get + * + * // field: TESTS_LIST:Ljava/util/List; + * // getter: getTESTS_LIST()Ljava/util/List; + * public final val TESTS_LIST: kotlin/collections/List> + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TestKt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/importsForErrorTypes.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/importsForErrorTypes.fir.txt index 2adb0b3dac4..6843f43353d 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/importsForErrorTypes.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/importsForErrorTypes.fir.txt @@ -1,3 +1,12 @@ +/** + * package { + * + * // signature: test()Ljava/lang/Object; + * public final fun test(): kotlin/Any? + * + * // module name: main + * } + */ @kotlin.Metadata() public final class ImportsForErrorTypesKt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/importsForErrorTypes.txt b/plugins/kapt3/kapt3-compiler/testData/converter/importsForErrorTypes.txt index 5d39ac4f553..87eeb931d62 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/importsForErrorTypes.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/importsForErrorTypes.txt @@ -2,6 +2,15 @@ import java.util.concurrent.*; import java.util.Date; import java.util.concurrent.TimeUnit; +/** + * package { + * + * // signature: test()Ljava/lang/Object; + * public final fun test(): kotlin/Any? + * + * // module name: main + * } + */ @kotlin.Metadata() public final class ImportsForErrorTypesKt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/importsKt22083.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/importsKt22083.fir.txt index aacbfb52992..8555717e865 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/importsKt22083.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/importsKt22083.fir.txt @@ -22,6 +22,15 @@ public class IOException { package test; +/** + * public final class test/TestA : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TestA { @@ -34,6 +43,24 @@ public final class TestA { package test; +/** + * public abstract interface test/TestB : kotlin/Any { + * + * // signature: a()Ljava/io/File; + * public abstract fun a(): java/io/File + * + * // signature: b()Llib/File; + * public abstract fun b(): lib/File + * + * // signature: c()Ljava/io/IOException; + * public abstract fun c(): java/io/IOException + * + * // signature: d()Llib/IOException; + * public abstract fun d(): lib/IOException + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface TestB { @@ -56,6 +83,27 @@ package test; import lib.FooBar; +/** + * public abstract interface test/TestC : kotlin/Any { + * + * // signature: a()Ljava/io/File; + * public abstract fun a(): java/io/File + * + * // signature: b()Llib/File; + * public abstract fun b(): lib/File + * + * // signature: c()Ljava/io/IOException; + * public abstract fun c(): java/io/IOException + * + * // signature: d()Llib/IOException; + * public abstract fun d(): lib/IOException + * + * // signature: e()Lerror/NonExistentClass; + * public abstract fun e(): error/NonExistentClass + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface TestC { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/importsKt22083.txt b/plugins/kapt3/kapt3-compiler/testData/converter/importsKt22083.txt index 0dd0f8aa2c4..827e1bb5a9c 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/importsKt22083.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/importsKt22083.txt @@ -25,6 +25,15 @@ package test; import java.io.File; import java.io.IOException; +/** + * public final class test/TestA : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TestA { @@ -40,6 +49,24 @@ package test; import java.io.File; import java.io.IOException; +/** + * public abstract interface test/TestB : kotlin/Any { + * + * // signature: a()Ljava/io/File; + * public abstract fun a(): java/io/File + * + * // signature: b()Llib/File; + * public abstract fun b(): lib/File + * + * // signature: c()Ljava/io/IOException; + * public abstract fun c(): java/io/IOException + * + * // signature: d()Llib/IOException; + * public abstract fun d(): lib/IOException + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface TestB { @@ -64,6 +91,27 @@ import java.io.File; import java.io.IOException; import lib.FooBar; +/** + * public abstract interface test/TestC : kotlin/Any { + * + * // signature: a()Ljava/io/File; + * public abstract fun a(): java/io/File + * + * // signature: b()Llib/File; + * public abstract fun b(): lib/File + * + * // signature: c()Ljava/io/IOException; + * public abstract fun c(): java/io/IOException + * + * // signature: d()Llib/IOException; + * public abstract fun d(): lib/IOException + * + * // signature: e()Lerror/NonExistentClass; + * public abstract fun e(): error/NonExistentClass + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface TestC { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/incorrectDelegate.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/incorrectDelegate.fir.txt index 77abea64c82..136596e08e0 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/incorrectDelegate.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/incorrectDelegate.fir.txt @@ -1,3 +1,12 @@ +/** + * public final class GroupedNewsListDelegateAdapter : kotlin/Any { + * + * // signature: (Lkotlin/jvm/functions/Function0;)V + * public constructor(onWiFiClickListener: kotlin/Function0) + * + * // module name: main + * } + */ @kotlin.Metadata() public final class GroupedNewsListDelegateAdapter { @@ -10,6 +19,26 @@ public final class GroupedNewsListDelegateAdapter { //////////////////// +/** + * public final class HomeFragment : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: categoryNewsListPresenter$delegate:Lkotlin/Unit; + * // getter: getCategoryNewsListPresenter()Lerror/NonExistentClass; + * // synthetic method for annotations: getCategoryNewsListPresenter$annotations()V + * private final (* delegated *) val categoryNewsListPresenter: error/NonExistentClass + * private final (* non-default *) get + * + * // field: groupedNewsListAdapter$delegate:Lkotlin/Lazy; + * // getter: getGroupedNewsListAdapter()LGroupedNewsListDelegateAdapter; + * private final (* delegated *) val groupedNewsListAdapter: GroupedNewsListDelegateAdapter + * private final (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class HomeFragment { @org.jetbrains.annotations.NotNull() @@ -38,6 +67,15 @@ public final class HomeFragment { //////////////////// +/** + * package { + * + * // signature: moxyPresenter()V + * public final fun moxyPresenter(): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public final class IncorrectDelegateKt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/incorrectDelegate.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/incorrectDelegate.ir.txt index 8a62a00d12e..ef62054562c 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/incorrectDelegate.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/incorrectDelegate.ir.txt @@ -1,3 +1,12 @@ +/** + * public final class GroupedNewsListDelegateAdapter : kotlin/Any { + * + * // signature: (Lkotlin/jvm/functions/Function0;)V + * public constructor(onWiFiClickListener: kotlin/Function0) + * + * // module name: main + * } + */ @kotlin.Metadata() public final class GroupedNewsListDelegateAdapter { @@ -10,6 +19,26 @@ public final class GroupedNewsListDelegateAdapter { //////////////////// +/** + * public final class HomeFragment : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: categoryNewsListPresenter$delegate:Lkotlin/Unit; + * // getter: getCategoryNewsListPresenter()Lerror/NonExistentClass; + * // synthetic method for annotations: getCategoryNewsListPresenter$annotations()V + * private final (* delegated *) val categoryNewsListPresenter: error/NonExistentClass + * private final (* non-default *) get + * + * // field: groupedNewsListAdapter$delegate:Lkotlin/Lazy; + * // getter: getGroupedNewsListAdapter()LGroupedNewsListDelegateAdapter; + * private final (* delegated *) val groupedNewsListAdapter: GroupedNewsListDelegateAdapter + * private final (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class HomeFragment { @org.jetbrains.annotations.NotNull() @@ -38,6 +67,15 @@ public final class HomeFragment { //////////////////// +/** + * package { + * + * // signature: moxyPresenter()V + * public final fun moxyPresenter(): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public final class IncorrectDelegateKt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/incorrectDelegate.txt b/plugins/kapt3/kapt3-compiler/testData/converter/incorrectDelegate.txt index 4707f40300c..fc20eb67733 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/incorrectDelegate.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/incorrectDelegate.txt @@ -1,3 +1,12 @@ +/** + * public final class GroupedNewsListDelegateAdapter : kotlin/Any { + * + * // signature: (Lkotlin/jvm/functions/Function0;)V + * public constructor(onWiFiClickListener: kotlin/Function0) + * + * // module name: main + * } + */ @kotlin.Metadata() public final class GroupedNewsListDelegateAdapter { @@ -10,6 +19,26 @@ public final class GroupedNewsListDelegateAdapter { //////////////////// +/** + * public final class HomeFragment : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: categoryNewsListPresenter$delegate:Lkotlin/Unit; + * // getter: getCategoryNewsListPresenter()Lerror/NonExistentClass; + * // synthetic method for annotations: getCategoryNewsListPresenter$annotations()V + * private final (* delegated *) val categoryNewsListPresenter: error/NonExistentClass + * private final (* non-default *) get + * + * // field: groupedNewsListAdapter$delegate:Lkotlin/Lazy; + * // getter: getGroupedNewsListAdapter()LGroupedNewsListDelegateAdapter; + * private final (* delegated *) val groupedNewsListAdapter: GroupedNewsListDelegateAdapter + * private final (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class HomeFragment { private final kotlin.Unit categoryNewsListPresenter$delegate = null; @@ -36,6 +65,15 @@ public final class HomeFragment { //////////////////// +/** + * package { + * + * // signature: moxyPresenter()V + * public final fun moxyPresenter(): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public final class IncorrectDelegateKt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/inheritanceSimple.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/inheritanceSimple.fir.txt index 51e901f752a..834a527c162 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/inheritanceSimple.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/inheritanceSimple.fir.txt @@ -1,4 +1,3 @@ -@kotlin.Metadata() public abstract class BaseClass { public BaseClass(@org.jetbrains.annotations.NotNull() @@ -13,14 +12,12 @@ public abstract class BaseClass { //////////////////// -@kotlin.Metadata() public abstract interface Context { } //////////////////// -@kotlin.Metadata() public final class Inheritor extends BaseClass { public Inheritor(@org.jetbrains.annotations.NotNull() @@ -38,7 +35,6 @@ public final class Inheritor extends BaseClass { //////////////////// -@kotlin.Metadata() public enum Result { /*public static final*/ SUCCESS /* = new Result() */, /*public static final*/ ERROR /* = new Result() */; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/inheritanceSimple.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/inheritanceSimple.ir.txt index f5c06826317..0ee0b2cbb48 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/inheritanceSimple.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/inheritanceSimple.ir.txt @@ -1,4 +1,3 @@ -@kotlin.Metadata() public abstract class BaseClass { public BaseClass(@org.jetbrains.annotations.NotNull() @@ -13,14 +12,12 @@ public abstract class BaseClass { //////////////////// -@kotlin.Metadata() public abstract interface Context { } //////////////////// -@kotlin.Metadata() public final class Inheritor extends BaseClass { public Inheritor(@org.jetbrains.annotations.NotNull() @@ -38,7 +35,6 @@ public final class Inheritor extends BaseClass { //////////////////// -@kotlin.Metadata() public enum Result { /*public static final*/ SUCCESS /* = new Result() */, /*public static final*/ ERROR /* = new Result() */; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/inheritanceSimple.kt b/plugins/kapt3/kapt3-compiler/testData/converter/inheritanceSimple.kt index 7a8d995e4b1..cf7f98917b3 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/inheritanceSimple.kt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/inheritanceSimple.kt @@ -1,3 +1,6 @@ +// STRIP_METADATA +// TODO: Re-enable metadata generation + interface Context enum class Result { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/inheritanceSimple.txt b/plugins/kapt3/kapt3-compiler/testData/converter/inheritanceSimple.txt index 0641260938d..f490b1e2575 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/inheritanceSimple.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/inheritanceSimple.txt @@ -1,4 +1,3 @@ -@kotlin.Metadata() public abstract class BaseClass { public BaseClass(@org.jetbrains.annotations.NotNull() @@ -13,14 +12,12 @@ public abstract class BaseClass { //////////////////// -@kotlin.Metadata() public abstract interface Context { } //////////////////// -@kotlin.Metadata() public final class Inheritor extends BaseClass { public Inheritor(@org.jetbrains.annotations.NotNull() @@ -38,7 +35,6 @@ public final class Inheritor extends BaseClass { //////////////////// -@kotlin.Metadata() public enum Result { /*public static final*/ SUCCESS /* = new Result() */, /*public static final*/ ERROR /* = new Result() */; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/inlineClasses.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/inlineClasses.fir.txt index 5f94beed782..c06afba24d2 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/inlineClasses.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/inlineClasses.fir.txt @@ -1,3 +1,30 @@ +/** + * public final value class Cl : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * public constructor(a: kotlin/String) + * + * // signature: equals(Ljava/lang/Object;)Z + * public open (* synthesized *) operator fun equals(other: kotlin/Any?): kotlin/Boolean + * + * // signature: hashCode()I + * public open (* synthesized *) fun hashCode(): kotlin/Int + * + * // signature: toString()Ljava/lang/String; + * public open (* synthesized *) fun toString(): kotlin/String + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String + * public final get + * + * // underlying property: a + * + * // underlying type: kotlin/String + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Cl { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/inlineClasses.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/inlineClasses.ir.txt index 8f66807c596..c07fb8b559e 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/inlineClasses.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/inlineClasses.ir.txt @@ -1,4 +1,31 @@ @kotlin.jvm.JvmInline() +/** + * public final value class Cl : kotlin/Any { + * + * // signature: constructor-impl(Ljava/lang/String;)Ljava/lang/String; + * public constructor(a: kotlin/String) + * + * // signature: equals-impl(Ljava/lang/String;Ljava/lang/Object;)Z + * public open (* synthesized *) operator fun equals(other: kotlin/Any?): kotlin/Boolean + * + * // signature: hashCode-impl(Ljava/lang/String;)I + * public open (* synthesized *) fun hashCode(): kotlin/Int + * + * // signature: toString-impl(Ljava/lang/String;)Ljava/lang/String; + * public open (* synthesized *) fun toString(): kotlin/String + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String + * public final get + * + * // underlying property: a + * + * // underlying type: kotlin/String + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Cl { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/inlineClasses.txt b/plugins/kapt3/kapt3-compiler/testData/converter/inlineClasses.txt index a9df1abc08d..3c9a947251d 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/inlineClasses.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/inlineClasses.txt @@ -1,4 +1,31 @@ @kotlin.jvm.JvmInline() +/** + * public final value class Cl : kotlin/Any { + * + * // signature: constructor-impl(Ljava/lang/String;)Ljava/lang/String; + * public constructor(a: kotlin/String) + * + * // signature: equals(Ljava/lang/Object;)Z + * public open (* synthesized *) operator fun equals(other: kotlin/Any?): kotlin/Boolean + * + * // signature: hashCode()I + * public open (* synthesized *) fun hashCode(): kotlin/Int + * + * // signature: toString()Ljava/lang/String; + * public open (* synthesized *) fun toString(): kotlin/String + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String + * public final get + * + * // underlying property: a + * + * // underlying type: kotlin/String + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Cl { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/innerClassesWithTypeParameters.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/innerClassesWithTypeParameters.fir.txt index 7e533356b16..9ae1d521f9d 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/innerClassesWithTypeParameters.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/innerClassesWithTypeParameters.fir.txt @@ -1,3 +1,19 @@ +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: a:LTest$FilterValueDelegate; + * private final var a: Test.FilterValueDelegate + * private final get + * private final set + * + * // nested class: FilterValueDelegate + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { @org.jetbrains.annotations.NotNull() @@ -7,6 +23,15 @@ public final class Test { super(); } + /** + * private final inner class Test.FilterValueDelegate : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() private final class FilterValueDelegate { @@ -19,6 +44,17 @@ public final class Test { //////////////////// +/** + * public final class Test2 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: FilterValueDelegate + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test2 { @@ -26,6 +62,22 @@ public final class Test2 { super(); } + /** + * public final inner class Test2.FilterValueDelegate : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: a:LTest2$FilterValueDelegate$Filter2; + * private final var a: Test2.FilterValueDelegate.Filter2 + * private final get + * private final set + * + * // nested class: Filter2 + * + * // module name: main + * } + */ @kotlin.Metadata() public final class FilterValueDelegate { @org.jetbrains.annotations.NotNull() @@ -35,6 +87,15 @@ public final class Test2 { super(); } + /** + * public final inner class Test2.FilterValueDelegate.Filter2 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Filter2 { @@ -48,6 +109,22 @@ public final class Test2 { //////////////////// +/** + * public final class Test3 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: a:LTest3$FilterValueDelegate; + * private final var a: Test3.FilterValueDelegate + * private final get + * private final set + * + * // nested class: FilterValueDelegate + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test3 { @org.jetbrains.annotations.NotNull() @@ -57,6 +134,15 @@ public final class Test3 { super(); } + /** + * private final class Test3.FilterValueDelegate : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() private static final class FilterValueDelegate { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/innerClassesWithTypeParameters.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/innerClassesWithTypeParameters.ir.txt index 238966fe83c..80d3ed53f14 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/innerClassesWithTypeParameters.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/innerClassesWithTypeParameters.ir.txt @@ -1,3 +1,19 @@ +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: a:LTest$FilterValueDelegate; + * private final var a: Test.FilterValueDelegate + * private final get + * private final set + * + * // nested class: FilterValueDelegate + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { @org.jetbrains.annotations.NotNull() @@ -7,6 +23,15 @@ public final class Test { super(); } + /** + * private final inner class Test.FilterValueDelegate : kotlin/Any { + * + * // signature: (LTest;)V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() final class FilterValueDelegate { @@ -19,6 +44,17 @@ public final class Test { //////////////////// +/** + * public final class Test2 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: FilterValueDelegate + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test2 { @@ -26,6 +62,22 @@ public final class Test2 { super(); } + /** + * public final inner class Test2.FilterValueDelegate : kotlin/Any { + * + * // signature: (LTest2;)V + * public constructor() + * + * // field: a:LTest2$FilterValueDelegate$Filter2; + * private final var a: Test2.FilterValueDelegate.Filter2 + * private final get + * private final set + * + * // nested class: Filter2 + * + * // module name: main + * } + */ @kotlin.Metadata() public final class FilterValueDelegate { @org.jetbrains.annotations.NotNull() @@ -35,6 +87,15 @@ public final class Test2 { super(); } + /** + * public final inner class Test2.FilterValueDelegate.Filter2 : kotlin/Any { + * + * // signature: (LTest2$FilterValueDelegate;)V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Filter2 { @@ -48,6 +109,22 @@ public final class Test2 { //////////////////// +/** + * public final class Test3 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: a:LTest3$FilterValueDelegate; + * private final var a: Test3.FilterValueDelegate + * private final get + * private final set + * + * // nested class: FilterValueDelegate + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test3 { @org.jetbrains.annotations.NotNull() @@ -57,6 +134,15 @@ public final class Test3 { super(); } + /** + * private final class Test3.FilterValueDelegate : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() static final class FilterValueDelegate { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/innerClassesWithTypeParameters.txt b/plugins/kapt3/kapt3-compiler/testData/converter/innerClassesWithTypeParameters.txt index cbd97275789..7c8c435ddde 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/innerClassesWithTypeParameters.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/innerClassesWithTypeParameters.txt @@ -1,3 +1,19 @@ +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: a:LTest$FilterValueDelegate; + * private final var a: Test.FilterValueDelegate + * private final get + * private final set + * + * // nested class: FilterValueDelegate + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { private Test.FilterValueDelegate a; @@ -6,6 +22,15 @@ public final class Test { super(); } + /** + * private final inner class Test.FilterValueDelegate : kotlin/Any { + * + * // signature: (LTest;)V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() final class FilterValueDelegate { @@ -18,6 +43,17 @@ public final class Test { //////////////////// +/** + * public final class Test2 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: FilterValueDelegate + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test2 { @@ -25,6 +61,22 @@ public final class Test2 { super(); } + /** + * public final inner class Test2.FilterValueDelegate : kotlin/Any { + * + * // signature: (LTest2;)V + * public constructor() + * + * // field: a:LTest2$FilterValueDelegate$Filter2; + * private final var a: Test2.FilterValueDelegate.Filter2 + * private final get + * private final set + * + * // nested class: Filter2 + * + * // module name: main + * } + */ @kotlin.Metadata() public final class FilterValueDelegate { private Test2.FilterValueDelegate.Filter2 a; @@ -33,6 +85,15 @@ public final class Test2 { super(); } + /** + * public final inner class Test2.FilterValueDelegate.Filter2 : kotlin/Any { + * + * // signature: (LTest2$FilterValueDelegate;)V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Filter2 { @@ -46,6 +107,22 @@ public final class Test2 { //////////////////// +/** + * public final class Test3 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: a:LTest3$FilterValueDelegate; + * private final var a: Test3.FilterValueDelegate + * private final get + * private final set + * + * // nested class: FilterValueDelegate + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test3 { private Test3.FilterValueDelegate a; @@ -54,6 +131,15 @@ public final class Test3 { super(); } + /** + * private final class Test3.FilterValueDelegate : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() static final class FilterValueDelegate { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/interfaceImplementation.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/interfaceImplementation.fir.txt index 2d0a4a0f8eb..b8954ff9e05 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/interfaceImplementation.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/interfaceImplementation.fir.txt @@ -1,3 +1,13 @@ +/** + * public abstract interface Named : kotlin/Any { + * + * // getter: getName()Ljava/lang/String; + * public abstract val name: kotlin/String? + * public abstract get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Named { @@ -8,6 +18,22 @@ public abstract interface Named { //////////////////// +/** + * public final class Product2 : Named { + * + * // signature: (Ljava/lang/String;)V + * public (* secondary *) constructor(otherName: kotlin/String) + * + * // field: name:Ljava/lang/String; + * // getter: getName()Ljava/lang/String; + * // setter: setName(Ljava/lang/String;)V + * public open var name: kotlin/String? + * public open get + * public open set + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Product2 implements Named { @org.jetbrains.annotations.Nullable() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/interfaceImplementation.txt b/plugins/kapt3/kapt3-compiler/testData/converter/interfaceImplementation.txt index 7f6f5233be5..b9581355640 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/interfaceImplementation.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/interfaceImplementation.txt @@ -1,3 +1,13 @@ +/** + * public abstract interface Named : kotlin/Any { + * + * // getter: getName()Ljava/lang/String; + * public abstract val name: kotlin/String? + * public abstract get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Named { @@ -8,6 +18,22 @@ public abstract interface Named { //////////////////// +/** + * public final class Product2 : Named { + * + * // signature: (Ljava/lang/String;)V + * public (* secondary *) constructor(otherName: kotlin/String) + * + * // field: name:Ljava/lang/String; + * // getter: getName()Ljava/lang/String; + * // setter: setName(Ljava/lang/String;)V + * public open var name: kotlin/String? + * public open get + * public open set + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Product2 implements Named { @org.jetbrains.annotations.Nullable() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/invalidFieldName.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/invalidFieldName.ir.txt index b21ace2dd5f..5558700f1ec 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/invalidFieldName.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/invalidFieldName.ir.txt @@ -1,5 +1,18 @@ @Anno(color = Color.InvalidFieldName) @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class Anno : kotlin/Annotation { + * + * // signature: (LColor;)V + * public constructor(color: Color) + * + * // getter: color()LColor; + * public final val color: Color + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno { @@ -9,6 +22,21 @@ public abstract @interface Anno { //////////////////// +/** + * public final enum class Color : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * BLACK, + * + * WHI-TE, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Color { /*public static final*/ BLACK /* = new Color() */; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/invalidFieldName.txt b/plugins/kapt3/kapt3-compiler/testData/converter/invalidFieldName.txt index 9251ad795f2..fd4cf66996a 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/invalidFieldName.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/invalidFieldName.txt @@ -1,5 +1,18 @@ @Anno(color = Color.InvalidFieldName) @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class Anno : kotlin/Annotation { + * + * // signature: (LColor;)V + * public constructor(color: Color) + * + * // getter: color()LColor; + * public final val color: Color + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno { @@ -9,6 +22,21 @@ public abstract @interface Anno { //////////////////// +/** + * public final enum class Color : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * BLACK, + * + * WHI-TE, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Color { /*public static final*/ BLACK /* = new Color() */; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/javaKeywordsInPackageNames.txt b/plugins/kapt3/kapt3-compiler/testData/converter/javaKeywordsInPackageNames.txt index a93f52c5781..52c1b119dd2 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/javaKeywordsInPackageNames.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/javaKeywordsInPackageNames.txt @@ -1,5 +1,14 @@ package a.b.c; +/** + * public final class a/b/c/A : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class A { @@ -12,6 +21,15 @@ public final class A { package a.b.typealias.c; +/** + * public final class a/b/typealias/c/E : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class E { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/javadoc.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/javadoc.fir.txt index a08678a5960..32788015474 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/javadoc.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/javadoc.fir.txt @@ -1,7 +1,13 @@ package javadoc; /** - * Simple + * public final class javadoc/A : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } */ @kotlin.Metadata() public final class A { @@ -16,9 +22,59 @@ public final class A { package javadoc; /** - * Multi - * line - * comment. + * public final class javadoc/B : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String (* = ... *) + * public final get + * + * // field: b:Ljava/lang/String; + * // getter: getB()Ljava/lang/String; + * public final val b: kotlin/String (* = ... *) + * public final get + * + * // field: c:Ljava/lang/String; + * // getter: getC()Ljava/lang/String; + * public final val c: kotlin/String (* = ... *) + * public final get + * + * // field: d:Ljava/lang/String; + * // getter: getD()Ljava/lang/String; + * public final val d: kotlin/String (* = ... *) + * public final get + * + * // field: e:Ljava/lang/String; + * // getter: getE()Ljava/lang/String; + * // setter: setE(Ljava/lang/String;)V + * public final var e: kotlin/String + * public final get + * public final set + * + * // getter: getF()Ljava/lang/String; + * // setter: setF(Ljava/lang/String;)V + * public final var f: kotlin/String + * public final (* non-default *) get + * public final (* non-default *) set(value: kotlin/String) + * + * // field: g:Ljava/lang/String; + * // getter: getG()Ljava/lang/String; + * // setter: setG(Ljava/lang/String;)V + * public final var g: kotlin/String + * public final get + * public final (* non-default *) set(value: kotlin/String) + * + * // getter: getH()Ljava/lang/String; + * // setter: setH(Ljava/lang/String;)V + * public final var h: kotlin/String + * public final (* non-default *) get + * public final (* non-default *) set(value: kotlin/String) + * + * // module name: main + * } */ @kotlin.Metadata() public final class B { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/javadoc.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/javadoc.ir.txt index 16d7a60e19f..7630b95e780 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/javadoc.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/javadoc.ir.txt @@ -3,6 +3,15 @@ package javadoc; /** * Simple */ +/** + * public final class javadoc/A : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class A { @@ -20,6 +29,61 @@ package javadoc; * line * comment. */ +/** + * public final class javadoc/B : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String (* = ... *) + * public final get + * + * // field: b:Ljava/lang/String; + * // getter: getB()Ljava/lang/String; + * public final val b: kotlin/String (* = ... *) + * public final get + * + * // field: c:Ljava/lang/String; + * // getter: getC()Ljava/lang/String; + * public final val c: kotlin/String (* = ... *) + * public final get + * + * // field: d:Ljava/lang/String; + * // getter: getD()Ljava/lang/String; + * public final val d: kotlin/String (* = ... *) + * public final get + * + * // field: e:Ljava/lang/String; + * // getter: getE()Ljava/lang/String; + * // setter: setE(Ljava/lang/String;)V + * public final var e: kotlin/String + * public final get + * public final set + * + * // getter: getF()Ljava/lang/String; + * // setter: setF(Ljava/lang/String;)V + * public final var f: kotlin/String + * public final (* non-default *) get + * public final (* non-default *) set(value: kotlin/String) + * + * // field: g:Ljava/lang/String; + * // getter: getG()Ljava/lang/String; + * // setter: setG(Ljava/lang/String;)V + * public final var g: kotlin/String + * public final get + * public final (* non-default *) set(value: kotlin/String) + * + * // getter: getH()Ljava/lang/String; + * // setter: setH(Ljava/lang/String;)V + * public final var h: kotlin/String + * public final (* non-default *) get + * public final (* non-default *) set(value: kotlin/String) + * + * // module name: main + * } + */ @kotlin.Metadata() public final class B { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/javadoc.txt b/plugins/kapt3/kapt3-compiler/testData/converter/javadoc.txt index c5f3b86b062..37498fb4fb4 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/javadoc.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/javadoc.txt @@ -3,6 +3,15 @@ package javadoc; /** * Simple */ +/** + * public final class javadoc/A : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class A { @@ -20,6 +29,61 @@ package javadoc; * line * comment. */ +/** + * public final class javadoc/B : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: a:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * public final val a: kotlin/String (* = ... *) + * public final get + * + * // field: b:Ljava/lang/String; + * // getter: getB()Ljava/lang/String; + * public final val b: kotlin/String (* = ... *) + * public final get + * + * // field: c:Ljava/lang/String; + * // getter: getC()Ljava/lang/String; + * public final val c: kotlin/String (* = ... *) + * public final get + * + * // field: d:Ljava/lang/String; + * // getter: getD()Ljava/lang/String; + * public final val d: kotlin/String (* = ... *) + * public final get + * + * // field: e:Ljava/lang/String; + * // getter: getE()Ljava/lang/String; + * // setter: setE(Ljava/lang/String;)V + * public final var e: kotlin/String + * public final get + * public final set + * + * // getter: getF()Ljava/lang/String; + * // setter: setF(Ljava/lang/String;)V + * public final var f: kotlin/String + * public final (* non-default *) get + * public final (* non-default *) set(value: kotlin/String) + * + * // field: g:Ljava/lang/String; + * // getter: getG()Ljava/lang/String; + * // setter: setG(Ljava/lang/String;)V + * public final var g: kotlin/String + * public final get + * public final (* non-default *) set(value: kotlin/String) + * + * // getter: getH()Ljava/lang/String; + * // setter: setH(Ljava/lang/String;)V + * public final var h: kotlin/String + * public final (* non-default *) get + * public final (* non-default *) set(value: kotlin/String) + * + * // module name: main + * } + */ @kotlin.Metadata() public final class B { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/jvmDefaultAll.txt b/plugins/kapt3/kapt3-compiler/testData/converter/jvmDefaultAll.txt index d9bd6209d0a..d1a7bebe8ae 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/jvmDefaultAll.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/jvmDefaultAll.txt @@ -1,3 +1,24 @@ +/** + * // requires compiler version 1.4.0 (level=ERROR) + * public abstract interface Foo : kotlin/Any { + * + * // signature: bar()V + * public abstract fun bar(): kotlin/Unit + * + * // signature: foo()V + * public open fun foo(): kotlin/Unit + * + * // signature: foo2(I)V + * public open fun foo2(a: kotlin/Int): kotlin/Unit + * + * // signature: privateMethodWithDefault()V + * private final fun privateMethodWithDefault(): kotlin/Unit + * + * // module name: main + * + * // has method bodies in interface + * } + */ @kotlin.Metadata() public abstract interface Foo { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/jvmDefaultAllCompatibility.txt b/plugins/kapt3/kapt3-compiler/testData/converter/jvmDefaultAllCompatibility.txt index 6d8d0b9eef7..08a6edb0939 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/jvmDefaultAllCompatibility.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/jvmDefaultAllCompatibility.txt @@ -1,3 +1,25 @@ +/** + * public abstract interface Foo : kotlin/Any { + * + * // signature: bar()V + * public abstract fun bar(): kotlin/Unit + * + * // signature: foo()V + * public open fun foo(): kotlin/Unit + * + * // signature: foo2(I)V + * public open fun foo2(a: kotlin/Int): kotlin/Unit + * + * // signature: privateMethodWithDefault()V + * private final fun privateMethodWithDefault(): kotlin/Unit + * + * // module name: main + * + * // has method bodies in interface + * + * // is compiled in compatibility mode + * } + */ @kotlin.Metadata() public abstract interface Foo { @@ -12,6 +34,9 @@ public abstract interface Foo { private void privateMethodWithDefault() { } + /** + * synthetic class + */ @kotlin.Metadata() public static final class DefaultImpls { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/jvmOverloads.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/jvmOverloads.ir.txt index 415f1cae695..93a64129933 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/jvmOverloads.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/jvmOverloads.ir.txt @@ -1,3 +1,27 @@ +/** + * public final class State : kotlin/Any { + * + * // signature: (IJLjava/lang/String;)V + * public constructor(someInt: kotlin/Int, someLong: kotlin/Long, someString: kotlin/String (* = ... *)) + * + * // field: someInt:I + * // getter: getSomeInt()I + * public final val someInt: kotlin/Int + * public final get + * + * // field: someLong:J + * // getter: getSomeLong()J + * public final val someLong: kotlin/Long + * public final get + * + * // field: someString:Ljava/lang/String; + * // getter: getSomeString()Ljava/lang/String; + * public final val someString: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class State { private final int someInt = 0; @@ -33,6 +57,36 @@ public final class State { //////////////////// +/** + * public final class State2 : kotlin/Any { + * + * // signature: (IJLjava/lang/String;)V + * public constructor(someInt: kotlin/Int, someLong: kotlin/Long (* = ... *), someString: kotlin/String (* = ... *)) + * + * // signature: methodWithoutArgs()V + * public final fun methodWithoutArgs(): kotlin/Unit + * + * // signature: someMethod(Ljava/lang/String;)V + * public final fun someMethod(str: kotlin/String): kotlin/Unit + * + * // signature: test(IJLjava/lang/String;)I + * public final fun test(someInt: kotlin/Int, someLong: kotlin/Long (* = ... *), someString: kotlin/String (* = ... *)): kotlin/Int + * + * // field: someInt:I + * public final val someInt: kotlin/Int + * public final get + * + * // field: someLong:J + * public final val someLong: kotlin/Long + * public final get + * + * // field: someString:Ljava/lang/String; + * public final val someString: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class State2 { @kotlin.jvm.JvmField() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/jvmOverloads.txt b/plugins/kapt3/kapt3-compiler/testData/converter/jvmOverloads.txt index 2ac5c910c96..3b30d9a4b3c 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/jvmOverloads.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/jvmOverloads.txt @@ -1,3 +1,27 @@ +/** + * public final class State : kotlin/Any { + * + * // signature: (IJLjava/lang/String;)V + * public constructor(someInt: kotlin/Int, someLong: kotlin/Long, someString: kotlin/String (* = ... *)) + * + * // field: someInt:I + * // getter: getSomeInt()I + * public final val someInt: kotlin/Int + * public final get + * + * // field: someLong:J + * // getter: getSomeLong()J + * public final val someLong: kotlin/Long + * public final get + * + * // field: someString:Ljava/lang/String; + * // getter: getSomeString()Ljava/lang/String; + * public final val someString: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class State { private final int someInt = 0; @@ -33,6 +57,36 @@ public final class State { //////////////////// +/** + * public final class State2 : kotlin/Any { + * + * // signature: (IJLjava/lang/String;)V + * public constructor(someInt: kotlin/Int, someLong: kotlin/Long (* = ... *), someString: kotlin/String (* = ... *)) + * + * // signature: methodWithoutArgs()V + * public final fun methodWithoutArgs(): kotlin/Unit + * + * // signature: someMethod(Ljava/lang/String;)V + * public final fun someMethod(str: kotlin/String): kotlin/Unit + * + * // signature: test(IJLjava/lang/String;)I + * public final fun test(someInt: kotlin/Int, someLong: kotlin/Long (* = ... *), someString: kotlin/String (* = ... *)): kotlin/Int + * + * // field: someInt:I + * public final val someInt: kotlin/Int + * public final get + * + * // field: someLong:J + * public final val someLong: kotlin/Long + * public final get + * + * // field: someString:Ljava/lang/String; + * public final val someString: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class State2 { @kotlin.jvm.JvmField() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/jvmRepeatableAnnotation.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/jvmRepeatableAnnotation.fir.txt index 2478d73be7c..da4b432c7cf 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/jvmRepeatableAnnotation.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/jvmRepeatableAnnotation.fir.txt @@ -1,3 +1,12 @@ +/** + * public final class A : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @Condition(condition = "value1") @Condition(condition = "value2") @@ -11,6 +20,19 @@ public final class A { //////////////////// +/** + * public final annotation class Condition : kotlin/Annotation { + * + * // signature: (Ljava/lang/String;)V + * public constructor(condition: kotlin/String) + * + * // getter: condition()Ljava/lang/String; + * public final val condition: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface Condition { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/jvmRepeatableAnnotation.txt b/plugins/kapt3/kapt3-compiler/testData/converter/jvmRepeatableAnnotation.txt index ea6fbe59242..f88004d9901 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/jvmRepeatableAnnotation.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/jvmRepeatableAnnotation.txt @@ -1,5 +1,14 @@ @Condition(condition = "value1") @Condition(condition = "value2") +/** + * public final class A : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class A { @@ -12,6 +21,19 @@ public final class A { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class Condition : kotlin/Annotation { + * + * // signature: (Ljava/lang/String;)V + * public constructor(condition: kotlin/String) + * + * // getter: condition()Ljava/lang/String; + * public final val condition: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Condition { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/jvmStatic.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/jvmStatic.fir.txt index e3d100c042f..e6079c3550b 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/jvmStatic.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/jvmStatic.fir.txt @@ -1,3 +1,13 @@ +/** + * public abstract interface FooComponent : kotlin/Any { + * + * // companion object: Companion + * + * // nested class: Companion + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface FooComponent { @org.jetbrains.annotations.NotNull() @@ -10,6 +20,18 @@ public abstract interface FooComponent { return null; } + /** + * public final companion object FooComponent.Companion : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // signature: create(Ljava/lang/String;)Ljava/lang/String; + * public final fun create(context: kotlin/String): kotlin/String + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Companion { @@ -29,6 +51,27 @@ public abstract interface FooComponent { //////////////////// +/** + * public final class JvmStaticTest : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: d:C + * public final const val d: kotlin/Char (* = ... *) + * public final get + * + * // field: three:B + * public final const val three: kotlin/Byte (* = ... *) + * public final get + * + * // companion object: Companion + * + * // nested class: Companion + * + * // module name: main + * } + */ @kotlin.Metadata() public final class JvmStaticTest { @org.jetbrains.annotations.NotNull() @@ -47,6 +90,26 @@ public final class JvmStaticTest { return 0; } + /** + * public final companion object JvmStaticTest.Companion : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * public final const val c: kotlin/Char (* = ... *) + * public final get + * + * // getter: getOne()I + * // synthetic method for annotations: getOne$annotations()V + * public final val one: kotlin/Int (* = ... *) + * public final get + * + * public final const val two: kotlin/Int (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Companion { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/jvmStatic.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/jvmStatic.ir.txt index 0102168f9a3..b709ed06b6e 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/jvmStatic.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/jvmStatic.ir.txt @@ -1,3 +1,13 @@ +/** + * public abstract interface FooComponent : kotlin/Any { + * + * // companion object: Companion + * + * // nested class: Companion + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface FooComponent { @org.jetbrains.annotations.NotNull() @@ -10,6 +20,18 @@ public abstract interface FooComponent { return null; } + /** + * public final companion object FooComponent.Companion : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // signature: create(Ljava/lang/String;)Ljava/lang/String; + * public final fun create(context: kotlin/String): kotlin/String + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Companion { @@ -29,6 +51,27 @@ public abstract interface FooComponent { //////////////////// +/** + * public final class JvmStaticTest : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: d:C + * public final const val d: kotlin/Char (* = ... *) + * public final get + * + * // field: three:B + * public final const val three: kotlin/Byte (* = ... *) + * public final get + * + * // companion object: Companion + * + * // nested class: Companion + * + * // module name: main + * } + */ @kotlin.Metadata() public final class JvmStaticTest { private static final int one = 1; @@ -47,6 +90,29 @@ public final class JvmStaticTest { return 0; } + /** + * public final companion object JvmStaticTest.Companion : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // field: c:C + * public final const val c: kotlin/Char (* = ... *) + * public final get + * + * // field: one:I + * // getter: getOne()I + * // synthetic method for annotations: getOne$annotations()V + * public final val one: kotlin/Int (* = ... *) + * public final get + * + * // field: two:I + * public final const val two: kotlin/Int (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Companion { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/jvmStatic.txt b/plugins/kapt3/kapt3-compiler/testData/converter/jvmStatic.txt index e3d100c042f..232be42abfa 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/jvmStatic.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/jvmStatic.txt @@ -1,3 +1,13 @@ +/** + * public abstract interface FooComponent : kotlin/Any { + * + * // companion object: Companion + * + * // nested class: Companion + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface FooComponent { @org.jetbrains.annotations.NotNull() @@ -10,6 +20,18 @@ public abstract interface FooComponent { return null; } + /** + * public final companion object FooComponent.Companion : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // signature: create(Ljava/lang/String;)Ljava/lang/String; + * public final fun create(context: kotlin/String): kotlin/String + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Companion { @@ -29,6 +51,27 @@ public abstract interface FooComponent { //////////////////// +/** + * public final class JvmStaticTest : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: d:C + * public final const val d: kotlin/Char (* = ... *) + * public final get + * + * // field: three:B + * public final const val three: kotlin/Byte (* = ... *) + * public final get + * + * // companion object: Companion + * + * // nested class: Companion + * + * // module name: main + * } + */ @kotlin.Metadata() public final class JvmStaticTest { @org.jetbrains.annotations.NotNull() @@ -47,6 +90,29 @@ public final class JvmStaticTest { return 0; } + /** + * public final companion object JvmStaticTest.Companion : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // field: c:C + * public final const val c: kotlin/Char (* = ... *) + * public final get + * + * // field: one:I + * // getter: getOne()I + * // synthetic method for annotations: getOne$annotations()V + * public final val one: kotlin/Int (* = ... *) + * public final get + * + * // field: two:I + * public final const val two: kotlin/Int (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Companion { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/jvmStaticFieldInParent.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/jvmStaticFieldInParent.fir.txt index 2769f65a7b8..2cfa5f5ebaf 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/jvmStaticFieldInParent.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/jvmStaticFieldInParent.fir.txt @@ -1,3 +1,16 @@ +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // companion object: A + * + * // nested class: A + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { @org.jetbrains.annotations.NotNull() @@ -14,6 +27,20 @@ public final class Test { return null; } + /** + * public final companion object Test.A : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // getter: getTest()Ljava/lang/String; + * // synthetic method for annotations: getTest$annotations()V + * public final val test: kotlin/String (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class A { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/jvmStaticFieldInParent.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/jvmStaticFieldInParent.ir.txt index a6349d7c324..7be030f514f 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/jvmStaticFieldInParent.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/jvmStaticFieldInParent.ir.txt @@ -1,3 +1,16 @@ +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // companion object: A + * + * // nested class: A + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { @org.jetbrains.annotations.NotNull() @@ -14,6 +27,21 @@ public final class Test { return null; } + /** + * public final companion object Test.A : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // field: test:Ljava/lang/String; + * // getter: getTest()Ljava/lang/String; + * // synthetic method for annotations: getTest$annotations()V + * public final val test: kotlin/String (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class A { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/jvmStaticFieldInParent.txt b/plugins/kapt3/kapt3-compiler/testData/converter/jvmStaticFieldInParent.txt index 2769f65a7b8..e4be7f8043b 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/jvmStaticFieldInParent.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/jvmStaticFieldInParent.txt @@ -1,3 +1,16 @@ +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // companion object: A + * + * // nested class: A + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { @org.jetbrains.annotations.NotNull() @@ -14,6 +27,21 @@ public final class Test { return null; } + /** + * public final companion object Test.A : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // field: test:Ljava/lang/String; + * // getter: getTest()Ljava/lang/String; + * // synthetic method for annotations: getTest$annotations()V + * public final val test: kotlin/String (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class A { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt14996.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt14996.fir.txt index 2c3a8443bde..64d3f1898ce 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt14996.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt14996.fir.txt @@ -1,3 +1,15 @@ +/** + * package { + * + * // signature: crashMe(Ljava/util/List;)Ljava/lang/CharSequence; + * public final fun crashMe(values: kotlin/collections/List): kotlin/CharSequence + * + * // signature: crashMe(Ljava/util/List;)Ljava/lang/String; + * public final fun crashMe(values: kotlin/collections/List): kotlin/String + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Kt14996Kt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt14996.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt14996.txt index fe0d1934cd5..0f941e73408 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt14996.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt14996.txt @@ -1,3 +1,15 @@ +/** + * package { + * + * // signature: crashMe(Ljava/util/List;)Ljava/lang/CharSequence; + * public final fun crashMe(values: kotlin/collections/List): kotlin/CharSequence + * + * // signature: crashMe(Ljava/util/List;)Ljava/lang/String; + * public final fun crashMe(values: kotlin/collections/List): kotlin/String + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Kt14996Kt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt14997.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt14997.fir.txt index cabd0fc4061..317ad96e95b 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt14997.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt14997.fir.txt @@ -1,3 +1,16 @@ +/** + * public open class CrashMe : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: notReally:Ljava/lang/Runnable; + * private final val notReally: . + * private final get + * + * // module name: main + * } + */ @kotlin.Metadata() public class CrashMe { @org.jetbrains.annotations.NotNull() @@ -11,6 +24,39 @@ public class CrashMe { //////////////////// +/** + * package { + * + * // signature: a()Ljava/lang/Runnable; + * public final fun a(): java/lang/Runnable + * + * // signature: b()Ljava/io/Serializable; + * public final fun b(): java/io/Serializable + * + * // signature: c()LCrashMe; + * public final fun c(): CrashMe + * + * // signature: d()Ljava/util/List; + * public final fun d(): kotlin/collections/List + * + * // signature: e()[Ljava/lang/Runnable; + * public final fun e(): kotlin/Array + * + * // signature: e1([Ljava/lang/CharSequence;)V + * public final fun e1(a: kotlin/Array): kotlin/Unit + * + * // signature: e2([Ljava/lang/Object;)V + * public final fun e2(a: kotlin/Array): kotlin/Unit + * + * // signature: e3([Ljava/lang/CharSequence;)V + * public final fun e3(a: kotlin/Array): kotlin/Unit + * + * // signature: e3([Ljava/lang/Object;)V + * public final fun e3(a: kotlin/Array<*>): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"AMBIGUOUS_ANONYMOUS_TYPE_INFERRED"}) public final class Kt14997Kt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt14997.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt14997.ir.txt index 59bb0639f72..e35687ef672 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt14997.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt14997.ir.txt @@ -1,3 +1,16 @@ +/** + * public open class CrashMe : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: notReally:Ljava/lang/Runnable; + * private final val notReally: java/lang/Runnable + * private final get + * + * // module name: main + * } + */ @kotlin.Metadata() public class CrashMe { @org.jetbrains.annotations.NotNull() @@ -11,6 +24,39 @@ public class CrashMe { //////////////////// +/** + * package { + * + * // signature: a()Ljava/lang/Runnable; + * public final fun a(): java/lang/Runnable + * + * // signature: b()Ljava/lang/Object; + * public final fun b(): kotlin/Any + * + * // signature: c()Ljava/lang/Object; + * public final fun c(): kotlin/Any + * + * // signature: d()Ljava/util/List; + * public final fun d(): kotlin/collections/List + * + * // signature: e()[Ljava/lang/Runnable; + * public final fun e(): kotlin/Array + * + * // signature: e1([Ljava/lang/CharSequence;)V + * public final fun e1(a: kotlin/Array): kotlin/Unit + * + * // signature: e2([Ljava/lang/Object;)V + * public final fun e2(a: kotlin/Array): kotlin/Unit + * + * // signature: e3([Ljava/lang/CharSequence;)V + * public final fun e3(a: kotlin/Array): kotlin/Unit + * + * // signature: e3([Ljava/lang/Object;)V + * public final fun e3(a: kotlin/Array<*>): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"AMBIGUOUS_ANONYMOUS_TYPE_INFERRED"}) public final class Kt14997Kt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt14997.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt14997.txt index b4071b31cef..0e9e159dd90 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt14997.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt14997.txt @@ -1,3 +1,16 @@ +/** + * public open class CrashMe : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: notReally:Ljava/lang/Runnable; + * private final val notReally: java/lang/Runnable + * private final get + * + * // module name: main + * } + */ @kotlin.Metadata() public class CrashMe { private final java.lang.Runnable notReally = null; @@ -10,6 +23,39 @@ public class CrashMe { //////////////////// +/** + * package { + * + * // signature: a()Ljava/lang/Runnable; + * public final fun a(): java/lang/Runnable + * + * // signature: b()Ljava/lang/Object; + * public final fun b(): kotlin/Any + * + * // signature: c()Ljava/lang/Object; + * public final fun c(): kotlin/Any + * + * // signature: d()Ljava/util/List; + * public final fun d(): kotlin/collections/List + * + * // signature: e()[Ljava/lang/Runnable; + * public final fun e(): kotlin/Array + * + * // signature: e1([Ljava/lang/CharSequence;)V + * public final fun e1(a: kotlin/Array): kotlin/Unit + * + * // signature: e2([Ljava/lang/Object;)V + * public final fun e2(a: kotlin/Array): kotlin/Unit + * + * // signature: e3([Ljava/lang/CharSequence;)V + * public final fun e3(a: kotlin/Array): kotlin/Unit + * + * // signature: e3([Ljava/lang/Object;)V + * public final fun e3(a: kotlin/Array<*>): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"AMBIGUOUS_ANONYMOUS_TYPE_INFERRED"}) public final class Kt14997Kt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt14998.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt14998.fir.txt index 28a6a8e25cc..1928484129e 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt14998.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt14998.fir.txt @@ -1,3 +1,22 @@ +/** + * public final class Outer : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: abstract(Ljava/lang/String;I)V + * public abstract fun abstract(s: kotlin/String, i: kotlin/Int): kotlin/Unit + * + * // signature: nonAbstract(Ljava/lang/String;I)V + * public final fun nonAbstract(s: kotlin/String, i: kotlin/Int): kotlin/Unit + * + * // nested class: Inner + * + * // nested class: Nested + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Outer { @@ -9,6 +28,25 @@ public final class Outer { java.lang.String s, int i) { } + /** + * private final inner class Outer.Inner : kotlin/Any { + * + * // signature: (Ljava/lang/String;Ljava/lang/String;)V + * public constructor(foo: kotlin/String, bar: kotlin/String) + * + * // field: bar:Ljava/lang/String; + * // getter: getBar()Ljava/lang/String; + * public final val bar: kotlin/String + * public final get + * + * // field: foo:Ljava/lang/String; + * // getter: getFoo()Ljava/lang/String; + * public final val foo: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() private final class Inner { @org.jetbrains.annotations.NotNull() @@ -33,6 +71,25 @@ public final class Outer { } } + /** + * private final class Outer.Nested : kotlin/Any { + * + * // signature: (Ljava/lang/String;Ljava/lang/String;)V + * public constructor(foo: kotlin/String, bar: kotlin/String) + * + * // field: bar:Ljava/lang/String; + * // getter: getBar()Ljava/lang/String; + * public final val bar: kotlin/String + * public final get + * + * // field: foo:Ljava/lang/String; + * // getter: getFoo()Ljava/lang/String; + * public final val foo: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() private static final class Nested { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt14998.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt14998.txt index 4c3ec630424..1ad054e3638 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt14998.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt14998.txt @@ -1,3 +1,22 @@ +/** + * public final class Outer : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: abstract(Ljava/lang/String;I)V + * public abstract fun abstract(s: kotlin/String, i: kotlin/Int): kotlin/Unit + * + * // signature: nonAbstract(Ljava/lang/String;I)V + * public final fun nonAbstract(s: kotlin/String, i: kotlin/Int): kotlin/Unit + * + * // nested class: Inner + * + * // nested class: Nested + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Outer { @@ -9,6 +28,25 @@ public final class Outer { java.lang.String s, int i) { } + /** + * private final inner class Outer.Inner : kotlin/Any { + * + * // signature: (LOuter;Ljava/lang/String;Ljava/lang/String;)V + * public constructor(foo: kotlin/String, bar: kotlin/String) + * + * // field: bar:Ljava/lang/String; + * // getter: getBar()Ljava/lang/String; + * public final val bar: kotlin/String + * public final get + * + * // field: foo:Ljava/lang/String; + * // getter: getFoo()Ljava/lang/String; + * public final val foo: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() final class Inner { @org.jetbrains.annotations.NotNull() @@ -33,6 +71,25 @@ public final class Outer { } } + /** + * private final class Outer.Nested : kotlin/Any { + * + * // signature: (Ljava/lang/String;Ljava/lang/String;)V + * public constructor(foo: kotlin/String, bar: kotlin/String) + * + * // field: bar:Ljava/lang/String; + * // getter: getBar()Ljava/lang/String; + * public final val bar: kotlin/String + * public final get + * + * // field: foo:Ljava/lang/String; + * // getter: getFoo()Ljava/lang/String; + * public final val foo: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() static final class Nested { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt15145.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt15145.txt index e83fd18a317..f872c9c5780 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt15145.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt15145.txt @@ -1,8 +1,28 @@ +/** + * public abstract interface MyInterface : kotlin/Any { + * + * // signature: someFun()V + * public abstract fun someFun(): kotlin/Unit + * + * // nested class: MyDefaultInferface + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface MyInterface { public abstract void someFun(); + /** + * private final class MyInterface.MyDefaultInferface : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class MyDefaultInferface { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt17567.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt17567.ir.txt index 371af34f60d..52bf1b9e964 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt17567.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt17567.ir.txt @@ -1,5 +1,23 @@ package test; +/** + * internal final class test/MutableEntry : kotlin/collections/MutableMap.MutableEntry { + * + * // signature: (Ljava/util/Map;Ljava/lang/Object;Ljava/lang/Object;)V + * public constructor(internal: kotlin/collections/MutableMap, key: T#0, value: T#1) + * + * // field: key:Ljava/lang/Object; + * // getter: getKey()Ljava/lang/Object; + * public open val key: T#0 + * public open get + * + * // field: internal:Ljava/util/Map; + * private final val internal: kotlin/collections/MutableMap + * private final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class MutableEntry implements java.util.Map.Entry, kotlin.jvm.internal.markers.KMutableMap.Entry { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt17567.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt17567.txt index 4744a8c9a5d..684928ee859 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt17567.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt17567.txt @@ -1,5 +1,23 @@ package test; +/** + * internal final class test/MutableEntry : kotlin/collections/MutableMap.MutableEntry { + * + * // signature: (Ljava/util/Map;Ljava/lang/Object;Ljava/lang/Object;)V + * public constructor(internal: kotlin/collections/MutableMap, key: T#0, value: T#1) + * + * // field: key:Ljava/lang/Object; + * // getter: getKey()Ljava/lang/Object; + * public open val key: T#0 + * public open get + * + * // field: internal:Ljava/util/Map; + * private final val internal: kotlin/collections/MutableMap + * private final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class MutableEntry implements java.util.Map.Entry, kotlin.jvm.internal.markers.KMutableMap.Entry { private final java.util.Map internal = null; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt18377.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt18377.txt index 34284ec82db..dca3233acd2 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt18377.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt18377.txt @@ -1,3 +1,12 @@ +/** + * package { + * + * // signature: Date(D)Ljava/util/Date; + * public final fun Date(double: kotlin/Double): java/util/Date + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Kt18377Kt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt18682.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt18682.fir.txt index e02c7426051..ad74c259280 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt18682.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt18682.fir.txt @@ -1,3 +1,12 @@ +/** + * public abstract class Foo : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract class Foo { @@ -9,6 +18,24 @@ public abstract class Foo { //////////////////// +/** + * package { + * + * // signature: test1()Ljava/util/List; + * public final fun test1(): kotlin/collections/List + * + * // signature: test2()Ljava/util/List; + * public final fun test2(): kotlin/collections/List + * + * // signature: test3()Ljava/util/List; + * public final fun test3(): kotlin/collections/List + * + * // signature: test4()Ljava/util/List; + * public final fun test4(): kotlin/collections/List + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Kt18682Kt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt18682.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt18682.txt index 9d9aa57f579..acfd4f80034 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt18682.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt18682.txt @@ -1,3 +1,12 @@ +/** + * public abstract class Foo : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract class Foo { @@ -9,6 +18,24 @@ public abstract class Foo { //////////////////// +/** + * package { + * + * // signature: test1()Ljava/util/List; + * public final fun test1(): kotlin/collections/List + * + * // signature: test2()Ljava/util/List; + * public final fun test2(): kotlin/collections/List + * + * // signature: test3()Ljava/util/List; + * public final fun test3(): kotlin/collections/List + * + * // signature: test4()Ljava/util/List; + * public final fun test4(): kotlin/collections/List + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Kt18682Kt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt19700.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt19700.ir.txt index 2f52306bfe1..0c4d65a4046 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt19700.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt19700.ir.txt @@ -1,6 +1,5 @@ package test; -@kotlin.Metadata() public abstract interface ListUpdateCallback { public abstract void onInserted(int position, int count); @@ -10,7 +9,6 @@ public abstract interface ListUpdateCallback { package test; -@kotlin.Metadata() public final class Test { @org.jetbrains.annotations.NotNull() private final test.ListUpdateCallback x = null; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt19700.kt b/plugins/kapt3/kapt3-compiler/testData/converter/kt19700.kt index 898e5797912..71a54cbe203 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt19700.kt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt19700.kt @@ -1,3 +1,6 @@ +// STRIP_METADATA +// TODO: Re-enable metadata generation + package test class Test { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt19700.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt19700.txt index a357c1ae126..7ae0ca530c3 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt19700.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt19700.txt @@ -1,6 +1,5 @@ package test; -@kotlin.Metadata() public abstract interface ListUpdateCallback { public abstract void onInserted(int position, int count); @@ -10,7 +9,6 @@ public abstract interface ListUpdateCallback { package test; -@kotlin.Metadata() public final class Test { private final test.ListUpdateCallback x = null; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt19750.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt19750.ir.txt index e0609f574b2..429837e30a3 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt19750.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt19750.ir.txt @@ -1,6 +1,5 @@ package test; -@kotlin.Metadata() public final class Test { @org.jetbrains.annotations.NotNull() private final test.TypedListUpdateCallback x = null; @@ -14,7 +13,6 @@ public final class Test { public abstract void onInserted(@org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt19750.kt b/plugins/kapt3/kapt3-compiler/testData/converter/kt19750.kt index 91920949c79..2bd8c5af45e 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt19750.kt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt19750.kt @@ -1,3 +1,6 @@ +// STRIP_METADATA +// TODO: Re-enable metadata generation + package test class Test { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt19750.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt19750.txt index 9a062a45135..2308ff2b8a9 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt19750.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt19750.txt @@ -1,6 +1,5 @@ package test; -@kotlin.Metadata() public final class Test { private final test.TypedListUpdateCallback x = null; @@ -13,7 +12,6 @@ public final class Test { public abstract void onInserted(@org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt24272.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt24272.ir.txt index 1c1d80ec0d5..500783cb8e7 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt24272.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt24272.ir.txt @@ -1,3 +1,23 @@ +/** + * public final class Foo : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * public constructor(string: kotlin/String) + * + * // field: bar:LFoo$Bar; + * // getter: getBar()LFoo$Bar; + * public final val bar: Foo.Bar + * public final get + * + * // field: string:Ljava/lang/String; + * private final val string: kotlin/String + * private final get + * + * // nested class: Bar + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { @org.jetbrains.annotations.NotNull() @@ -15,6 +35,27 @@ public final class Foo { return null; } + /** + * public final class Foo.Bar : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * public constructor(string: kotlin/String) + * + * // field: bars:Ljava/util/ArrayList; + * // getter: getBars()Ljava/util/ArrayList; + * public final val bars: java/util/ArrayList (* = kotlin/collections/ArrayList^ *) + * public final get + * + * // field: string:Ljava/lang/String; + * // getter: getString()Ljava/lang/String; + * public final val string: kotlin/String + * public final get + * + * // nested class: Bar + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Bar { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt24272.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt24272.txt index 5e057a966c0..79988d9cb23 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt24272.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt24272.txt @@ -1,3 +1,23 @@ +/** + * public final class Foo : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * public constructor(string: kotlin/String) + * + * // field: bar:LFoo$Bar; + * // getter: getBar()LFoo$Bar; + * public final val bar: Foo.Bar + * public final get + * + * // field: string:Ljava/lang/String; + * private final val string: kotlin/String + * private final get + * + * // nested class: Bar + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { private final java.lang.String string = null; @@ -14,6 +34,27 @@ public final class Foo { return null; } + /** + * public final class Foo.Bar : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * public constructor(string: kotlin/String) + * + * // field: bars:Ljava/util/ArrayList; + * // getter: getBars()Ljava/util/ArrayList; + * public final val bars: java/util/ArrayList (* = kotlin/collections/ArrayList^ *) + * public final get + * + * // field: string:Ljava/lang/String; + * // getter: getString()Ljava/lang/String; + * public final val string: kotlin/String + * public final get + * + * // nested class: Bar + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Bar { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt25071.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt25071.txt index 01793dfe7e4..de7d149168f 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt25071.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt25071.txt @@ -1,5 +1,34 @@ package kapt; +/** + * public final class kapt/StaticImport : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: l:Lkapt/StaticMethod; + * // getter: getL()Lkapt/StaticMethod; + * public final val l: kapt/StaticMethod! + * public final get + * + * // field: m:Lkapt/StaticMethod; + * // getter: getM()Lkapt/StaticMethod; + * public final val m: kapt/StaticMethod! + * public final get + * + * // field: x:Ljava/util/Collection; + * // getter: getX()Ljava/util/Collection; + * public final val x: kotlin/collections/MutableCollection..kotlin/collections/Collection? + * public final get + * + * // field: y:I + * // getter: getY()I + * public final val y: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class StaticImport { private final java.util.Collection x = null; @@ -56,6 +85,15 @@ public class StaticMethod { package my.lib; +/** + * package { + * + * // signature: func(Ljava/lang/String;)I + * public final fun kotlin/String.func(): kotlin/Int + * + * // module name: main + * } + */ @kotlin.Metadata() public final class LibKt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt27126.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt27126.fir.txt index 7bd6b3e3e51..a6ad7262cc5 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt27126.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt27126.fir.txt @@ -1,5 +1,26 @@ package test; +/** + * public abstract class test/BundleProperty : test/NullableBundleProperty { + * + * // signature: (Ljava/lang/String;)V + * public constructor(key: kotlin/String?) + * + * // signature: getValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;)Ljava/lang/Object; + * public final operator fun getValue(thisRef: kotlin/Any, property: kotlin/reflect/KProperty<*>): T#0 + * + * // signature: setNullableValue(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V + * public final fun setNullableValue(bundle: kotlin/Any, key: kotlin/String, value: T#0?): kotlin/Unit + * + * // signature: setValue(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V + * public abstract fun setValue(bundle: kotlin/Any, key: kotlin/String, value: T#0): kotlin/Unit + * + * // signature: setValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;Ljava/lang/Object;)V + * public final operator fun setValue(thisRef: kotlin/Any, property: kotlin/reflect/KProperty<*>, value: T#0?): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract class BundleProperty extends test.NullableBundleProperty { @@ -38,6 +59,15 @@ public abstract class BundleProperty extends test.N package test; +/** + * package { + * + * // signature: charSequence(Ljava/lang/String;)Ltest/BundleProperty; + * public final inline fun charSequence(key: kotlin/String? (* = ... *)): test/BundleProperty + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"NOTHING_TO_INLINE"}) public final class Kt27126Kt { @@ -57,6 +87,34 @@ public final class Kt27126Kt { package test; +/** + * public abstract class test/NullableBundleProperty : kotlin/properties/ReadWriteProperty { + * + * // signature: (Ljava/lang/String;)V + * public constructor(key: kotlin/String?) + * + * // signature: getValue(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object; + * public abstract fun getValue(bundle: kotlin/Any, key: kotlin/String): T#0? + * + * // signature: getValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;)Ljava/lang/Object; + * public open operator fun getValue(thisRef: kotlin/Any, property: kotlin/reflect/KProperty<*>): T#0? + * + * // signature: setNullableValue(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V + * public abstract fun setNullableValue(bundle: kotlin/Any, key: kotlin/String, value: T#0?): kotlin/Unit + * + * // signature: setValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;Ljava/lang/Object;)V + * public open operator fun setValue(thisRef: kotlin/Any, property: kotlin/reflect/KProperty<*>, value: T#0?): kotlin/Unit + * + * // signature: toKey(Lkotlin/reflect/KProperty;)Ljava/lang/String; + * private final inline fun kotlin/reflect/KProperty<*>.toKey(): kotlin/String + * + * // field: key:Ljava/lang/String; + * private final val key: kotlin/String? + * private final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract class NullableBundleProperty implements kotlin.properties.ReadWriteProperty { @org.jetbrains.annotations.Nullable() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt27126.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt27126.ir.txt index 0fd37bb13e9..cec599aa3d3 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt27126.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt27126.ir.txt @@ -1,5 +1,26 @@ package test; +/** + * public abstract class test/BundleProperty : test/NullableBundleProperty { + * + * // signature: (Ljava/lang/String;)V + * public constructor(key: kotlin/String?) + * + * // signature: getValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;)Ljava/lang/Object; + * public final operator fun getValue(thisRef: kotlin/Any, property: kotlin/reflect/KProperty<*>): T#0 + * + * // signature: setNullableValue(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V + * public final fun setNullableValue(bundle: kotlin/Any, key: kotlin/String, value: T#0?): kotlin/Unit + * + * // signature: setValue(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V + * public abstract fun setValue(bundle: kotlin/Any, key: kotlin/String, value: T#0): kotlin/Unit + * + * // signature: setValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;Ljava/lang/Object;)V + * public final operator fun setValue(thisRef: kotlin/Any, property: kotlin/reflect/KProperty<*>, value: T#0?): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract class BundleProperty extends test.NullableBundleProperty { @@ -38,6 +59,15 @@ public abstract class BundleProperty extends test.N package test; +/** + * package { + * + * // signature: charSequence(Ljava/lang/String;)Ltest/BundleProperty; + * public final inline fun charSequence(key: kotlin/String? (* = ... *)): test/BundleProperty + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"NOTHING_TO_INLINE"}) public final class Kt27126Kt { @@ -57,6 +87,34 @@ public final class Kt27126Kt { package test; +/** + * public abstract class test/NullableBundleProperty : kotlin/properties/ReadWriteProperty { + * + * // signature: (Ljava/lang/String;)V + * public constructor(key: kotlin/String?) + * + * // signature: getValue(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object; + * public abstract fun getValue(bundle: kotlin/Any, key: kotlin/String): T#0? + * + * // signature: getValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;)Ljava/lang/Object; + * public open operator fun getValue(thisRef: kotlin/Any, property: kotlin/reflect/KProperty<*>): T#0? + * + * // signature: setNullableValue(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V + * public abstract fun setNullableValue(bundle: kotlin/Any, key: kotlin/String, value: T#0?): kotlin/Unit + * + * // signature: setValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;Ljava/lang/Object;)V + * public open operator fun setValue(thisRef: kotlin/Any, property: kotlin/reflect/KProperty<*>, value: T#0?): kotlin/Unit + * + * // signature: toKey(Lkotlin/reflect/KProperty;)Ljava/lang/String; + * private final inline fun kotlin/reflect/KProperty<*>.toKey(): kotlin/String + * + * // field: key:Ljava/lang/String; + * private final val key: kotlin/String? + * private final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract class NullableBundleProperty implements kotlin.properties.ReadWriteProperty { @org.jetbrains.annotations.Nullable() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt27126.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt27126.txt index ea5dcfe8c36..35c0a531cb1 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt27126.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt27126.txt @@ -1,5 +1,26 @@ package test; +/** + * public abstract class test/BundleProperty : test/NullableBundleProperty { + * + * // signature: (Ljava/lang/String;)V + * public constructor(key: kotlin/String?) + * + * // signature: getValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;)Ljava/lang/Object; + * public final operator fun getValue(thisRef: kotlin/Any, property: kotlin/reflect/KProperty<*>): T#0 + * + * // signature: setNullableValue(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V + * public final fun setNullableValue(bundle: kotlin/Any, key: kotlin/String, value: T#0?): kotlin/Unit + * + * // signature: setValue(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V + * public abstract fun setValue(bundle: kotlin/Any, key: kotlin/String, value: T#0): kotlin/Unit + * + * // signature: setValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;Ljava/lang/Object;)V + * public final operator fun setValue(thisRef: kotlin/Any, property: kotlin/reflect/KProperty<*>, value: T#0?): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract class BundleProperty extends test.NullableBundleProperty { @@ -38,6 +59,15 @@ public abstract class BundleProperty extends test.N package test; +/** + * package { + * + * // signature: charSequence(Ljava/lang/String;)Ltest/BundleProperty; + * public final inline fun charSequence(key: kotlin/String? (* = ... *)): test/BundleProperty + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"NOTHING_TO_INLINE"}) public final class Kt27126Kt { @@ -57,6 +87,34 @@ public final class Kt27126Kt { package test; +/** + * public abstract class test/NullableBundleProperty : kotlin/properties/ReadWriteProperty { + * + * // signature: (Ljava/lang/String;)V + * public constructor(key: kotlin/String?) + * + * // signature: getValue(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object; + * public abstract fun getValue(bundle: kotlin/Any, key: kotlin/String): T#0? + * + * // signature: getValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;)Ljava/lang/Object; + * public open operator fun getValue(thisRef: kotlin/Any, property: kotlin/reflect/KProperty<*>): T#0? + * + * // signature: setNullableValue(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V + * public abstract fun setNullableValue(bundle: kotlin/Any, key: kotlin/String, value: T#0?): kotlin/Unit + * + * // signature: setValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;Ljava/lang/Object;)V + * public open operator fun setValue(thisRef: kotlin/Any, property: kotlin/reflect/KProperty<*>, value: T#0?): kotlin/Unit + * + * // signature: toKey(Lkotlin/reflect/KProperty;)Ljava/lang/String; + * private final inline fun kotlin/reflect/KProperty<*>.toKey(): kotlin/String + * + * // field: key:Ljava/lang/String; + * private final val key: kotlin/String? + * private final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract class NullableBundleProperty implements kotlin.properties.ReadWriteProperty { private final java.lang.String key = null; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt28306.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt28306.fir.txt index 4c14edb072a..e2d9d199378 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt28306.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt28306.fir.txt @@ -1,5 +1,14 @@ package foo; +/** + * public abstract interface foo/InterfaceWithDefaults : kotlin/Any { + * + * // signature: foo()V + * public open fun foo(): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface InterfaceWithDefaults { @@ -11,6 +20,12 @@ public abstract interface InterfaceWithDefaults { package foo; +/** + * public abstract interface foo/SubInterface : foo/InterfaceWithDefaults { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface SubInterface extends foo.InterfaceWithDefaults { } diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt28306.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt28306.ir.txt index 2b2c91127fc..751556cac97 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt28306.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt28306.ir.txt @@ -1,10 +1,22 @@ package foo; +/** + * public abstract interface foo/InterfaceWithDefaults : kotlin/Any { + * + * // signature: foo()V + * public open fun foo(): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface InterfaceWithDefaults { public abstract void foo(); + /** + * synthetic class + */ @kotlin.Metadata() public static final class DefaultImpls { @@ -22,9 +34,18 @@ public abstract interface InterfaceWithDefaults { package foo; +/** + * public abstract interface foo/SubInterface : foo/InterfaceWithDefaults { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface SubInterface extends foo.InterfaceWithDefaults { + /** + * synthetic class + */ @kotlin.Metadata() public static final class DefaultImpls { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt28306.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt28306.txt index 3d4485782aa..9b0b3b8f77b 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt28306.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt28306.txt @@ -1,10 +1,22 @@ package foo; +/** + * public abstract interface foo/InterfaceWithDefaults : kotlin/Any { + * + * // signature: foo()V + * public open fun foo(): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface InterfaceWithDefaults { public abstract void foo(); + /** + * synthetic class + */ @kotlin.Metadata() public static final class DefaultImpls { @@ -22,9 +34,18 @@ public abstract interface InterfaceWithDefaults { package foo; +/** + * public abstract interface foo/SubInterface : foo/InterfaceWithDefaults { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface SubInterface extends foo.InterfaceWithDefaults { + /** + * synthetic class + */ @kotlin.Metadata() public static final class DefaultImpls { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt32596.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt32596.txt index c7e9b5372c3..4a0e877e041 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt32596.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt32596.txt @@ -1,6 +1,19 @@ import kotlin.reflect.KClass; @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class Anno : kotlin/Annotation { + * + * // signature: (Lkotlin/reflect/KClass;)V + * public constructor(klass: kotlin/reflect/KClass<*>) + * + * // getter: klass()Ljava/lang/Class; + * public final val klass: kotlin/reflect/KClass<*> + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno { @@ -13,6 +26,15 @@ public abstract @interface Anno { import kotlin.reflect.KClass; @ABC() +/** + * public final class ErrorMissingAnnotation : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class ErrorMissingAnnotation { @@ -28,6 +50,15 @@ import kotlin.reflect.KClass; @ABC() @CDE() +/** + * public final class ErrorMultipleMissingAnnotations : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class ErrorMultipleMissingAnnotations { @@ -44,6 +75,15 @@ import kotlin.reflect.KClass; @CDE() @Anno(klass = ABC.class) @ABC() +/** + * public final class ErrorSomeMissingAnnotations : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class ErrorSomeMissingAnnotations { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt34569.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt34569.txt index 31d73b1ded9..6efb2f41464 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt34569.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt34569.txt @@ -1,3 +1,15 @@ +/** + * public final class T : java/lang/Runnable { + * + * // signature: ()V + * public constructor() + * + * // signature: run()V + * public open fun run(): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public final class T implements java.lang.Runnable { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt43786.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt43786.fir.txt index 506717f319f..d43e83410e5 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt43786.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt43786.fir.txt @@ -1,3 +1,23 @@ +/** + * public final class Application : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: _preferencesDataStore:Lerror/NonExistentClass; + * // getter: get_preferencesDataStore()Lerror/NonExistentClass; + * // setter: set_preferencesDataStore(Lerror/NonExistentClass;)V + * public final lateinit var _preferencesDataStore: error/NonExistentClass + * public final get + * public final set + * + * // companion object: Companion + * + * // nested class: Companion + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) public final class Application { @@ -30,6 +50,21 @@ public final class Application { return null; } + /** + * public final companion object Application.Companion : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // signature: get()LApplication; + * public final fun get(): Application + * + * // signature: getPreferencesDataStore()Lerror/NonExistentClass; + * public final fun getPreferencesDataStore(): error/NonExistentClass + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Companion { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt43786.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt43786.txt index 1e5ac37ba49..0c5cf6b6a84 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/kt43786.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt43786.txt @@ -1,3 +1,23 @@ +/** + * public final class Application : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: _preferencesDataStore:Lerror/NonExistentClass; + * // getter: get_preferencesDataStore()Lerror/NonExistentClass; + * // setter: set_preferencesDataStore(Lerror/NonExistentClass;)V + * public final lateinit var _preferencesDataStore: error/NonExistentClass + * public final get + * public final set + * + * // companion object: Companion + * + * // nested class: Companion + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) public final class Application { @@ -30,6 +50,21 @@ public final class Application { return null; } + /** + * public final companion object Application.Companion : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // signature: get()LApplication; + * public final fun get(): Application + * + * // signature: getPreferencesDataStore()Lerror/NonExistentClass; + * public final fun getPreferencesDataStore(): error/NonExistentClass + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Companion { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/lazyProperty.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/lazyProperty.fir.txt index 5344177f309..82773c258b7 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/lazyProperty.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/lazyProperty.fir.txt @@ -1,3 +1,32 @@ +/** + * public final class Foo : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: bar$delegate:Lkotlin/Lazy; + * // getter: getBar()Ljava/lang/Object; + * private final (* delegated *) val bar: . + * private final (* non-default *) get + * + * // field: baz$delegate:Lkotlin/Lazy; + * // getter: getBaz()Ljava/lang/Object; + * private final (* delegated *) val baz: . + * private final (* non-default *) get + * + * // field: foo$delegate:Lkotlin/Lazy; + * // getter: getFoo()Ljava/lang/Runnable; + * private final (* delegated *) val foo: . + * private final (* non-default *) get + * + * // field: generic1$delegate:Lkotlin/Lazy; + * // getter: getGeneric1()LGenericIntf; + * private final (* delegated *) val generic1: . + * private final (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { @org.jetbrains.annotations.NotNull() @@ -33,6 +62,12 @@ public final class Foo { //////////////////// +/** + * public abstract interface GenericIntf : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface GenericIntf { } @@ -40,6 +75,12 @@ public abstract interface GenericIntf { //////////////////// +/** + * public abstract interface Intf : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Intf { } diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/lazyProperty.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/lazyProperty.ir.txt index 6b76413dbc4..1c419a0ce46 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/lazyProperty.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/lazyProperty.ir.txt @@ -1,3 +1,32 @@ +/** + * public final class Foo : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: bar$delegate:Lkotlin/Lazy; + * // getter: getBar()Ljava/lang/Object; + * private final (* delegated *) val bar: kotlin/Any + * private final (* non-default *) get + * + * // field: baz$delegate:Lkotlin/Lazy; + * // getter: getBaz()Ljava/lang/Object; + * private final (* delegated *) val baz: kotlin/Any + * private final (* non-default *) get + * + * // field: foo$delegate:Lkotlin/Lazy; + * // getter: getFoo()Ljava/lang/Runnable; + * private final (* delegated *) val foo: java/lang/Runnable + * private final (* non-default *) get + * + * // field: generic1$delegate:Lkotlin/Lazy; + * // getter: getGeneric1()LGenericIntf; + * private final (* delegated *) val generic1: GenericIntf + * private final (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { @org.jetbrains.annotations.NotNull() @@ -33,6 +62,12 @@ public final class Foo { //////////////////// +/** + * public abstract interface GenericIntf : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface GenericIntf { } @@ -40,6 +75,12 @@ public abstract interface GenericIntf { //////////////////// +/** + * public abstract interface Intf : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Intf { } diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/lazyProperty.txt b/plugins/kapt3/kapt3-compiler/testData/converter/lazyProperty.txt index 44adf429340..d860f9a1643 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/lazyProperty.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/lazyProperty.txt @@ -1,3 +1,32 @@ +/** + * public final class Foo : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: bar$delegate:Lkotlin/Lazy; + * // getter: getBar()Ljava/lang/Object; + * private final (* delegated *) val bar: kotlin/Any + * private final (* non-default *) get + * + * // field: baz$delegate:Lkotlin/Lazy; + * // getter: getBaz()Ljava/lang/Object; + * private final (* delegated *) val baz: kotlin/Any + * private final (* non-default *) get + * + * // field: foo$delegate:Lkotlin/Lazy; + * // getter: getFoo()Ljava/lang/Runnable; + * private final (* delegated *) val foo: java/lang/Runnable + * private final (* non-default *) get + * + * // field: generic1$delegate:Lkotlin/Lazy; + * // getter: getGeneric1()LGenericIntf; + * private final (* delegated *) val generic1: GenericIntf + * private final (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { private final kotlin.Lazy foo$delegate = null; @@ -29,6 +58,12 @@ public final class Foo { //////////////////// +/** + * public abstract interface GenericIntf : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface GenericIntf { } @@ -36,6 +71,12 @@ public abstract interface GenericIntf { //////////////////// +/** + * public abstract interface Intf : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Intf { } diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/leadingDollars.txt b/plugins/kapt3/kapt3-compiler/testData/converter/leadingDollars.txt index e0c772c3bfc..b5eccb10387 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/leadingDollars.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/leadingDollars.txt @@ -33,6 +33,18 @@ public class Test$ { package test; +/** + * package { + * + * // signature: test(L$Test$$Inner;)V + * public final fun test(a: $Test.$Inner): kotlin/Unit + * + * // signature: test(LTest$$Inner$;)V + * public final fun test(a: Test$.Inner$): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TestKt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/leadingDollars2.txt b/plugins/kapt3/kapt3-compiler/testData/converter/leadingDollars2.txt index 6b5ee4adc72..c49b0820f51 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/leadingDollars2.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/leadingDollars2.txt @@ -14,6 +14,15 @@ package te.st.a; import te.st.a.$Test.Inner; import te.st.a.Test$.Inner$; +/** + * package { + * + * // signature: a(Lerror/NonExistentClass;)V + * public final fun a(a: error/NonExistentClass): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) public final class TestKt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/mapEntry.txt b/plugins/kapt3/kapt3-compiler/testData/converter/mapEntry.txt index 1fab800ca1c..67f005f0773 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/mapEntry.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/mapEntry.txt @@ -1,3 +1,16 @@ +/** + * public abstract interface EntryHolder : kotlin/Any { + * + * // signature: entry(Ljava/util/Map$Entry;)Ljava/util/Map$Entry; + * public abstract fun entry(p: kotlin/collections/Map.Entry>): kotlin/collections/Map.Entry + * + * // getter: getEntryProperty()Ljava/util/Map$Entry; + * public abstract val entryProperty: kotlin/collections/Map.Entry + * public abstract get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface EntryHolder { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/maxErrorCount.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/maxErrorCount.fir.txt index 727c0b2df7f..f8dcd43d897 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/maxErrorCount.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/maxErrorCount.fir.txt @@ -1,3 +1,15 @@ +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: a(Lerror/NonExistentClass;Lerror/NonExistentClass;)V + * public final fun a(a: error/NonExistentClass, b: error/NonExistentClass): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/maxErrorCount.txt b/plugins/kapt3/kapt3-compiler/testData/converter/maxErrorCount.txt index 238868dcb69..9115a8f40d6 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/maxErrorCount.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/maxErrorCount.txt @@ -1,5 +1,17 @@ import kotlin.reflect.KClass; +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: a(Lerror/NonExistentClass;Lerror/NonExistentClass;)V + * public final fun a(a: error/NonExistentClass, b: error/NonExistentClass): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/methodParameterNames.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/methodParameterNames.fir.txt index 506f0fb5567..f5e181f244c 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/methodParameterNames.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/methodParameterNames.fir.txt @@ -1,3 +1,18 @@ +/** + * public abstract class Cls : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: bar(I)Ljava/lang/String; + * public final fun bar(bcd: kotlin/Int): kotlin/String + * + * // signature: foo(Ljava/lang/String;)V + * public abstract fun foo(abc: kotlin/String): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract class Cls { @@ -17,6 +32,18 @@ public abstract class Cls { //////////////////// +/** + * public abstract interface Intf : kotlin/Any { + * + * // signature: bar(I)Ljava/lang/String; + * public open fun bar(bcd: kotlin/Int): kotlin/String + * + * // signature: foo(Ljava/lang/String;)V + * public abstract fun foo(abc: kotlin/String): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Intf { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/methodParameterNames.txt b/plugins/kapt3/kapt3-compiler/testData/converter/methodParameterNames.txt index a14c778ded1..06940ca77b0 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/methodParameterNames.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/methodParameterNames.txt @@ -1,3 +1,18 @@ +/** + * public abstract class Cls : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: bar(I)Ljava/lang/String; + * public final fun bar(bcd: kotlin/Int): kotlin/String + * + * // signature: foo(Ljava/lang/String;)V + * public abstract fun foo(abc: kotlin/String): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract class Cls { @@ -17,6 +32,18 @@ public abstract class Cls { //////////////////// +/** + * public abstract interface Intf : kotlin/Any { + * + * // signature: bar(I)Ljava/lang/String; + * public open fun bar(bcd: kotlin/Int): kotlin/String + * + * // signature: foo(Ljava/lang/String;)V + * public abstract fun foo(abc: kotlin/String): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Intf { @@ -26,6 +53,9 @@ public abstract interface Intf { @org.jetbrains.annotations.NotNull() public abstract java.lang.String bar(int bcd); + /** + * synthetic class + */ @kotlin.Metadata() public static final class DefaultImpls { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/methodPropertySignatureClash.txt b/plugins/kapt3/kapt3-compiler/testData/converter/methodPropertySignatureClash.txt index df2d6c3409a..4d295dff211 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/methodPropertySignatureClash.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/methodPropertySignatureClash.txt @@ -1,3 +1,20 @@ +/** + * public final class CrashMe : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: getResources()Ljava/lang/String; + * public final fun getResources(): kotlin/String + * + * // field: resources:I + * // getter: getResources()I + * public final val resources: kotlin/Int (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class CrashMe { private final int resources = 1; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/modifiers.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/modifiers.fir.txt index b31551d031f..cb454b33120 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/modifiers.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/modifiers.fir.txt @@ -1,5 +1,14 @@ package modifiers; +/** + * internal final class modifiers/InternalClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class InternalClass { @@ -12,6 +21,12 @@ public final class InternalClass { package modifiers; +/** + * internal abstract interface modifiers/InternalInterface : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface InternalInterface { } @@ -20,6 +35,33 @@ public abstract interface InternalInterface { package modifiers; +/** + * public final class modifiers/Modifiers : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: overloads(Ljava/lang/String;I)Ljava/lang/String; + * public final fun overloads(a: kotlin/String (* = ... *), n: kotlin/Int (* = ... *)): kotlin/String + * + * // signature: strictFp()V + * public final fun strictFp(): kotlin/Unit + * + * // field: transientField:Ljava/lang/String; + * // getter: getTransientField()Ljava/lang/String; + * public final val transientField: kotlin/String (* = ... *) + * public final get + * + * // field: volatileField:Ljava/lang/String; + * // getter: getVolatileField()Ljava/lang/String; + * // setter: setVolatileField(Ljava/lang/String;)V + * public final var volatileField: kotlin/String + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Modifiers { @kotlin.jvm.Transient() @@ -76,6 +118,15 @@ public final class Modifiers { package modifiers; +/** + * private final class modifiers/PrivateClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() final class PrivateClass { @@ -88,6 +139,12 @@ final class PrivateClass { package modifiers; +/** + * private abstract interface modifiers/PrivateInterface : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() abstract interface PrivateInterface { } @@ -96,6 +153,15 @@ abstract interface PrivateInterface { package modifiers; +/** + * public final class modifiers/PublicClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class PublicClass { @@ -108,6 +174,15 @@ public final class PublicClass { package modifiers; +/** + * public abstract class modifiers/PublicClassPrivateConstructor : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract class PublicClassPrivateConstructor { @@ -120,6 +195,19 @@ public abstract class PublicClassPrivateConstructor { package modifiers; +/** + * public open class modifiers/PublicClassProtectedConstructor : kotlin/Any { + * + * // signature: ()V + * protected constructor() + * + * // nested class: ProtectedInterface + * + * // nested class: PrivateInterface + * + * // module name: main + * } + */ @kotlin.Metadata() public class PublicClassProtectedConstructor { @@ -127,10 +215,22 @@ public class PublicClassProtectedConstructor { super(); } + /** + * protected abstract interface modifiers/PublicClassProtectedConstructor.ProtectedInterface : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() protected static abstract interface ProtectedInterface { } + /** + * private abstract interface modifiers/PublicClassProtectedConstructor.PrivateInterface : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() private static abstract interface PrivateInterface { } @@ -140,6 +240,12 @@ public class PublicClassProtectedConstructor { package modifiers; +/** + * public abstract interface modifiers/PublicInterface : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface PublicInterface { } @@ -148,6 +254,23 @@ public abstract interface PublicInterface { package modifiers; +/** + * public sealed class modifiers/SealedClass : kotlin/Any { + * + * // signature: ()V + * protected constructor() + * + * // nested class: One + * + * // nested class: Two + * + * // nested class: Three + * + * // nested class: Four + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract class SealedClass { @@ -155,6 +278,15 @@ public abstract class SealedClass { super(); } + /** + * public final class modifiers/SealedClass.One : modifiers/SealedClass { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class One extends modifiers.SealedClass { @@ -163,6 +295,15 @@ public abstract class SealedClass { } } + /** + * public open class modifiers/SealedClass.Two : modifiers/SealedClass { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static class Two extends modifiers.SealedClass { @@ -171,6 +312,15 @@ public abstract class SealedClass { } } + /** + * public abstract class modifiers/SealedClass.Three : modifiers/SealedClass.Two { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract class Three extends modifiers.SealedClass.Two { @@ -179,6 +329,15 @@ public abstract class SealedClass { } } + /** + * public final class modifiers/SealedClass.Four : modifiers/SealedClass.Three { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Four extends modifiers.SealedClass.Three { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/modifiers.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/modifiers.ir.txt index 77e03cc329c..03ca27c5ec2 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/modifiers.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/modifiers.ir.txt @@ -1,5 +1,14 @@ package modifiers; +/** + * internal final class modifiers/InternalClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class InternalClass { @@ -12,6 +21,12 @@ public final class InternalClass { package modifiers; +/** + * internal abstract interface modifiers/InternalInterface : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface InternalInterface { } @@ -20,6 +35,33 @@ public abstract interface InternalInterface { package modifiers; +/** + * public final class modifiers/Modifiers : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: overloads(Ljava/lang/String;I)Ljava/lang/String; + * public final fun overloads(a: kotlin/String (* = ... *), n: kotlin/Int (* = ... *)): kotlin/String + * + * // signature: strictFp()V + * public final fun strictFp(): kotlin/Unit + * + * // field: transientField:Ljava/lang/String; + * // getter: getTransientField()Ljava/lang/String; + * public final val transientField: kotlin/String (* = ... *) + * public final get + * + * // field: volatileField:Ljava/lang/String; + * // getter: getVolatileField()Ljava/lang/String; + * // setter: setVolatileField(Ljava/lang/String;)V + * public final var volatileField: kotlin/String + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Modifiers { @kotlin.jvm.Transient() @@ -76,6 +118,15 @@ public final class Modifiers { package modifiers; +/** + * private final class modifiers/PrivateClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() final class PrivateClass { @@ -88,6 +139,12 @@ final class PrivateClass { package modifiers; +/** + * private abstract interface modifiers/PrivateInterface : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() abstract interface PrivateInterface { } @@ -96,6 +153,15 @@ abstract interface PrivateInterface { package modifiers; +/** + * public final class modifiers/PublicClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class PublicClass { @@ -108,6 +174,15 @@ public final class PublicClass { package modifiers; +/** + * public abstract class modifiers/PublicClassPrivateConstructor : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract class PublicClassPrivateConstructor { @@ -120,6 +195,19 @@ public abstract class PublicClassPrivateConstructor { package modifiers; +/** + * public open class modifiers/PublicClassProtectedConstructor : kotlin/Any { + * + * // signature: ()V + * protected constructor() + * + * // nested class: PrivateInterface + * + * // nested class: ProtectedInterface + * + * // module name: main + * } + */ @kotlin.Metadata() public class PublicClassProtectedConstructor { @@ -127,10 +215,22 @@ public class PublicClassProtectedConstructor { super(); } + /** + * private abstract interface modifiers/PublicClassProtectedConstructor.PrivateInterface : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() static abstract interface PrivateInterface { } + /** + * protected abstract interface modifiers/PublicClassProtectedConstructor.ProtectedInterface : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract interface ProtectedInterface { } @@ -140,6 +240,12 @@ public class PublicClassProtectedConstructor { package modifiers; +/** + * public abstract interface modifiers/PublicInterface : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface PublicInterface { } @@ -148,6 +254,27 @@ public abstract interface PublicInterface { package modifiers; +/** + * public sealed class modifiers/SealedClass : kotlin/Any { + * + * // signature: ()V + * protected constructor() + * + * // nested class: Four + * + * // nested class: One + * + * // nested class: Three + * + * // nested class: Two + * + * // sealed subclass: modifiers/SealedClass.One + * + * // sealed subclass: modifiers/SealedClass.Two + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract class SealedClass { @@ -155,6 +282,15 @@ public abstract class SealedClass { super(); } + /** + * public final class modifiers/SealedClass.Four : modifiers/SealedClass.Three { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Four extends modifiers.SealedClass.Three { @@ -163,6 +299,15 @@ public abstract class SealedClass { } } + /** + * public final class modifiers/SealedClass.One : modifiers/SealedClass { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class One extends modifiers.SealedClass { @@ -170,6 +315,15 @@ public abstract class SealedClass { } } + /** + * public abstract class modifiers/SealedClass.Three : modifiers/SealedClass.Two { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract class Three extends modifiers.SealedClass.Two { @@ -178,6 +332,15 @@ public abstract class SealedClass { } } + /** + * public open class modifiers/SealedClass.Two : modifiers/SealedClass { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static class Two extends modifiers.SealedClass { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/modifiers.txt b/plugins/kapt3/kapt3-compiler/testData/converter/modifiers.txt index 4bb3e36d5e2..83c7ea15b35 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/modifiers.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/modifiers.txt @@ -1,5 +1,14 @@ package modifiers; +/** + * internal final class modifiers/InternalClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class InternalClass { @@ -12,6 +21,12 @@ public final class InternalClass { package modifiers; +/** + * internal abstract interface modifiers/InternalInterface : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface InternalInterface { } @@ -20,6 +35,33 @@ public abstract interface InternalInterface { package modifiers; +/** + * public final class modifiers/Modifiers : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: overloads(Ljava/lang/String;I)Ljava/lang/String; + * public final fun overloads(a: kotlin/String (* = ... *), n: kotlin/Int (* = ... *)): kotlin/String + * + * // signature: strictFp()V + * public final fun strictFp(): kotlin/Unit + * + * // field: transientField:Ljava/lang/String; + * // getter: getTransientField()Ljava/lang/String; + * public final val transientField: kotlin/String (* = ... *) + * public final get + * + * // field: volatileField:Ljava/lang/String; + * // getter: getVolatileField()Ljava/lang/String; + * // setter: setVolatileField(Ljava/lang/String;)V + * public final var volatileField: kotlin/String + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Modifiers { @kotlin.jvm.Transient() @@ -76,6 +118,15 @@ public final class Modifiers { package modifiers; +/** + * private final class modifiers/PrivateClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() final class PrivateClass { @@ -88,6 +139,12 @@ final class PrivateClass { package modifiers; +/** + * private abstract interface modifiers/PrivateInterface : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() abstract interface PrivateInterface { } @@ -96,6 +153,15 @@ abstract interface PrivateInterface { package modifiers; +/** + * public final class modifiers/PublicClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class PublicClass { @@ -108,6 +174,15 @@ public final class PublicClass { package modifiers; +/** + * public abstract class modifiers/PublicClassPrivateConstructor : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract class PublicClassPrivateConstructor { @@ -120,6 +195,19 @@ public abstract class PublicClassPrivateConstructor { package modifiers; +/** + * public open class modifiers/PublicClassProtectedConstructor : kotlin/Any { + * + * // signature: ()V + * protected constructor() + * + * // nested class: PrivateInterface + * + * // nested class: ProtectedInterface + * + * // module name: main + * } + */ @kotlin.Metadata() public class PublicClassProtectedConstructor { @@ -127,10 +215,22 @@ public class PublicClassProtectedConstructor { super(); } + /** + * protected abstract interface modifiers/PublicClassProtectedConstructor.ProtectedInterface : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract interface ProtectedInterface { } + /** + * private abstract interface modifiers/PublicClassProtectedConstructor.PrivateInterface : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() static abstract interface PrivateInterface { } @@ -140,6 +240,12 @@ public class PublicClassProtectedConstructor { package modifiers; +/** + * public abstract interface modifiers/PublicInterface : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface PublicInterface { } @@ -148,6 +254,27 @@ public abstract interface PublicInterface { package modifiers; +/** + * public sealed class modifiers/SealedClass : kotlin/Any { + * + * // signature: ()V + * protected constructor() + * + * // nested class: Four + * + * // nested class: One + * + * // nested class: Three + * + * // nested class: Two + * + * // sealed subclass: modifiers/SealedClass.One + * + * // sealed subclass: modifiers/SealedClass.Two + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract class SealedClass { @@ -155,6 +282,15 @@ public abstract class SealedClass { super(); } + /** + * public final class modifiers/SealedClass.One : modifiers/SealedClass { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class One extends modifiers.SealedClass { @@ -163,6 +299,15 @@ public abstract class SealedClass { } } + /** + * public open class modifiers/SealedClass.Two : modifiers/SealedClass { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static class Two extends modifiers.SealedClass { @@ -171,6 +316,15 @@ public abstract class SealedClass { } } + /** + * public abstract class modifiers/SealedClass.Three : modifiers/SealedClass.Two { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract class Three extends modifiers.SealedClass.Two { @@ -179,6 +333,15 @@ public abstract class SealedClass { } } + /** + * public final class modifiers/SealedClass.Four : modifiers/SealedClass.Three { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Four extends modifiers.SealedClass.Three { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/multifileClass.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/multifileClass.ir.txt index 1c341e16481..58cacab5d86 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/multifileClass.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/multifileClass.ir.txt @@ -1,5 +1,11 @@ package test; +/** + * multi-file class { + * // test/M1__AKt + * // test/M1__BKt + * } + */ @kotlin.Metadata() public final class M1 { @@ -18,6 +24,11 @@ public final class M1 { package test; +/** + * multi-file class { + * // test/M2__CKt + * } + */ @kotlin.Metadata() public final class M2 { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/multifileClass.txt b/plugins/kapt3/kapt3-compiler/testData/converter/multifileClass.txt index fc411a0e597..b44a15fb8f9 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/multifileClass.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/multifileClass.txt @@ -1,5 +1,11 @@ package test; +/** + * multi-file class { + * // test/M1__AKt + * // test/M1__BKt + * } + */ @kotlin.Metadata() public final class M1 { @@ -18,6 +24,11 @@ public final class M1 { package test; +/** + * multi-file class { + * // test/M2__CKt + * } + */ @kotlin.Metadata() public final class M2 { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/multifileClassDefaultPackage.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/multifileClassDefaultPackage.ir.txt index 5e156921f0d..046c37943f0 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/multifileClassDefaultPackage.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/multifileClassDefaultPackage.ir.txt @@ -1,3 +1,12 @@ +/** + * public final class AnotherRootClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class AnotherRootClass { @@ -9,6 +18,15 @@ public final class AnotherRootClass { //////////////////// +/** + * public final class RootClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class RootClass { @@ -21,6 +39,12 @@ public final class RootClass { package test; +/** + * multi-file class { + * // test/M1__BKt + * // test/M1__CKt + * } + */ @kotlin.Metadata() public final class M1 { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/multifileClassDefaultPackage.txt b/plugins/kapt3/kapt3-compiler/testData/converter/multifileClassDefaultPackage.txt index 7dda63d7fa4..5dd10c63125 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/multifileClassDefaultPackage.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/multifileClassDefaultPackage.txt @@ -1,3 +1,12 @@ +/** + * public final class AnotherRootClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class AnotherRootClass { @@ -9,6 +18,15 @@ public final class AnotherRootClass { //////////////////// +/** + * public final class RootClass : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class RootClass { @@ -21,6 +39,12 @@ public final class RootClass { package test; +/** + * multi-file class { + * // test/M1__BKt + * // test/M1__CKt + * } + */ @kotlin.Metadata() public final class M1 { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/nestedClasses.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/nestedClasses.fir.txt index bcb2298f3cb..a3be52a9a9c 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/nestedClasses.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/nestedClasses.fir.txt @@ -1,3 +1,24 @@ +/** + * public final class A : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: f1(LA;LA$B;)LA; + * public final fun f1(a: A, b: A.B): A? + * + * // field: x:LA; + * // getter: getX()LA; + * public final val x: A? + * public final get + * + * // nested class: B + * + * // nested class: C + * + * // module name: main + * } + */ @kotlin.Metadata() public final class A { @org.jetbrains.annotations.Nullable() @@ -19,6 +40,21 @@ public final class A { return null; } + /** + * public abstract interface A.B : kotlin/Any { + * + * // signature: f2(LA$B$A;LA$B;)LA$B$A; + * public open fun f2(a: A.B.A, b: A.B): A.B.A? + * + * // getter: getY()LA$B; + * public abstract val y: A.B? + * public abstract get + * + * // nested class: A + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract interface B { @@ -26,6 +62,17 @@ public final class A { public abstract A.B getY(); } + /** + * public final object A.C : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // nested class: C + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class C { @org.jetbrains.annotations.NotNull() @@ -40,6 +87,17 @@ public final class A { //////////////////// +/** + * public final class A2 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: B + * + * // module name: main + * } + */ @kotlin.Metadata() public final class A2 { @@ -47,6 +105,17 @@ public final class A2 { super(); } + /** + * public final class A2.B : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: C + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class B { @@ -54,6 +123,17 @@ public final class A2 { super(); } + /** + * public final class A2.B.C : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: D + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class C { @@ -61,6 +141,25 @@ public final class A2 { super(); } + /** + * public final class A2.B.C.D : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: A2 + * + * // nested class: B + * + * // nested class: Cme + * + * // nested class: D + * + * // nested class: E + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class D { @@ -68,6 +167,15 @@ public final class A2 { super(); } + /** + * public final class A2.B.C.D.Cme : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Cme { @@ -76,6 +184,15 @@ public final class A2 { } } + /** + * public final class A2.B.C.D.E : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class E { @@ -91,6 +208,19 @@ public final class A2 { //////////////////// +/** + * public final class Foo : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // companion object: Foo + * + * // nested class: Foo + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { @@ -102,6 +232,25 @@ public final class Foo { //////////////////// +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: Nested + * + * // nested class: Inner + * + * // nested class: NestedObject + * + * // nested class: NestedInterface + * + * // nested class: NestedEnum + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { @@ -109,6 +258,17 @@ public final class Test { super(); } + /** + * public final class Test.Nested : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: NestedNested + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Nested { @@ -116,6 +276,15 @@ public final class Test { super(); } + /** + * public final class Test.Nested.NestedNested : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class NestedNested { @@ -125,6 +294,15 @@ public final class Test { } } + /** + * public final inner class Test.Inner : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Inner { @@ -133,6 +311,15 @@ public final class Test { } } + /** + * public final object Test.NestedObject : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class NestedObject { @org.jetbrains.annotations.NotNull() @@ -143,10 +330,31 @@ public final class Test { } } + /** + * public abstract interface Test.NestedInterface : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract interface NestedInterface { } + /** + * public final enum class Test.NestedEnum : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * BLACK, + * + * WHITE, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public static enum NestedEnum { /*public static final*/ BLACK /* = new NestedEnum() */, diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/nestedClasses.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/nestedClasses.ir.txt index 8262fc27177..05e32cc197c 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/nestedClasses.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/nestedClasses.ir.txt @@ -1,3 +1,24 @@ +/** + * public final class A : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: f1(LA;LA$B;)LA; + * public final fun f1(a: A, b: A.B): A? + * + * // field: x:LA; + * // getter: getX()LA; + * public final val x: A? + * public final get + * + * // nested class: B + * + * // nested class: C + * + * // module name: main + * } + */ @kotlin.Metadata() public final class A { @org.jetbrains.annotations.Nullable() @@ -19,12 +40,30 @@ public final class A { return null; } + /** + * public abstract interface A.B : kotlin/Any { + * + * // signature: f2(LA$B$A;LA$B;)LA$B$A; + * public open fun f2(a: A.B.A, b: A.B): A.B.A? + * + * // getter: getY()LA$B; + * public abstract val y: A.B? + * public abstract get + * + * // nested class: A + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract interface B { @org.jetbrains.annotations.Nullable() public abstract A.B getY(); + /** + * synthetic class + */ @kotlin.Metadata() public static final class DefaultImpls { @@ -34,6 +73,17 @@ public final class A { } } + /** + * public final object A.C : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // nested class: C + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class C { @org.jetbrains.annotations.NotNull() @@ -48,6 +98,17 @@ public final class A { //////////////////// +/** + * public final class A2 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: B + * + * // module name: main + * } + */ @kotlin.Metadata() public final class A2 { @@ -55,6 +116,17 @@ public final class A2 { super(); } + /** + * public final class A2.B : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: C + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class B { @@ -62,6 +134,17 @@ public final class A2 { super(); } + /** + * public final class A2.B.C : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: D + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class C { @@ -69,6 +152,25 @@ public final class A2 { super(); } + /** + * public final class A2.B.C.D : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: A2 + * + * // nested class: B + * + * // nested class: Cme + * + * // nested class: D + * + * // nested class: E + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class D { @@ -76,6 +178,15 @@ public final class A2 { super(); } + /** + * public final class A2.B.C.D.Cme : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Cme { @@ -84,6 +195,15 @@ public final class A2 { } } + /** + * public final class A2.B.C.D.E : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class E { @@ -99,6 +219,19 @@ public final class A2 { //////////////////// +/** + * public final class Foo : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // companion object: Foo + * + * // nested class: Foo + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { @@ -110,6 +243,25 @@ public final class Foo { //////////////////// +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: Inner + * + * // nested class: Nested + * + * // nested class: NestedEnum + * + * // nested class: NestedInterface + * + * // nested class: NestedObject + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { @@ -117,6 +269,15 @@ public final class Test { super(); } + /** + * public final inner class Test.Inner : kotlin/Any { + * + * // signature: (LTest;)V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Inner { @@ -125,6 +286,17 @@ public final class Test { } } + /** + * public final class Test.Nested : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: NestedNested + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Nested { @@ -132,6 +304,15 @@ public final class Test { super(); } + /** + * public final class Test.Nested.NestedNested : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class NestedNested { @@ -141,6 +322,21 @@ public final class Test { } } + /** + * public final enum class Test.NestedEnum : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * BLACK, + * + * WHITE, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public static enum NestedEnum { /*public static final*/ BLACK /* = new NestedEnum() */, @@ -155,10 +351,25 @@ public final class Test { } } + /** + * public abstract interface Test.NestedInterface : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract interface NestedInterface { } + /** + * public final object Test.NestedObject : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class NestedObject { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/nestedClasses.txt b/plugins/kapt3/kapt3-compiler/testData/converter/nestedClasses.txt index 4c82aa88d5f..59e4c597eda 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/nestedClasses.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/nestedClasses.txt @@ -1,3 +1,24 @@ +/** + * public final class A : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: f1(LA;LA$B;)LA; + * public final fun f1(a: A, b: A.B): A? + * + * // field: x:LA; + * // getter: getX()LA; + * public final val x: A? + * public final get + * + * // nested class: B + * + * // nested class: C + * + * // module name: main + * } + */ @kotlin.Metadata() public final class A { @org.jetbrains.annotations.Nullable() @@ -19,12 +40,30 @@ public final class A { return null; } + /** + * public abstract interface A.B : kotlin/Any { + * + * // signature: f2(LA$B$A;LA$B;)LA$B$A; + * public open fun f2(a: A.B.A, b: A.B): A.B.A? + * + * // getter: getY()LA$B; + * public abstract val y: A.B? + * public abstract get + * + * // nested class: A + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract interface B { @org.jetbrains.annotations.Nullable() public abstract A.B getY(); + /** + * synthetic class + */ @kotlin.Metadata() public static final class DefaultImpls { @@ -34,6 +73,17 @@ public final class A { } } + /** + * public final object A.C : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // nested class: C + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class C { @org.jetbrains.annotations.NotNull() @@ -48,6 +98,17 @@ public final class A { //////////////////// +/** + * public final class A2 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: B + * + * // module name: main + * } + */ @kotlin.Metadata() public final class A2 { @@ -55,6 +116,17 @@ public final class A2 { super(); } + /** + * public final class A2.B : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: C + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class B { @@ -62,6 +134,17 @@ public final class A2 { super(); } + /** + * public final class A2.B.C : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: D + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class C { @@ -69,6 +152,25 @@ public final class A2 { super(); } + /** + * public final class A2.B.C.D : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: A2 + * + * // nested class: B + * + * // nested class: Cme + * + * // nested class: D + * + * // nested class: E + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class D { @@ -76,6 +178,15 @@ public final class A2 { super(); } + /** + * public final class A2.B.C.D.Cme : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Cme { @@ -84,6 +195,15 @@ public final class A2 { } } + /** + * public final class A2.B.C.D.E : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class E { @@ -99,6 +219,19 @@ public final class A2 { //////////////////// +/** + * public final class Foo : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // companion object: Foo + * + * // nested class: Foo + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { @@ -110,6 +243,25 @@ public final class Foo { //////////////////// +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: Inner + * + * // nested class: Nested + * + * // nested class: NestedEnum + * + * // nested class: NestedInterface + * + * // nested class: NestedObject + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { @@ -117,6 +269,17 @@ public final class Test { super(); } + /** + * public final class Test.Nested : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: NestedNested + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Nested { @@ -124,6 +287,15 @@ public final class Test { super(); } + /** + * public final class Test.Nested.NestedNested : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class NestedNested { @@ -133,6 +305,15 @@ public final class Test { } } + /** + * public final inner class Test.Inner : kotlin/Any { + * + * // signature: (LTest;)V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Inner { @@ -141,6 +322,15 @@ public final class Test { } } + /** + * public final object Test.NestedObject : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class NestedObject { @org.jetbrains.annotations.NotNull() @@ -151,10 +341,31 @@ public final class Test { } } + /** + * public abstract interface Test.NestedInterface : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract interface NestedInterface { } + /** + * public final enum class Test.NestedEnum : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * BLACK, + * + * WHITE, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public static enum NestedEnum { /*public static final*/ BLACK /* = new NestedEnum() */, diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/nestedClasses2.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/nestedClasses2.ir.txt index d7cdba03e0b..1ff4a76c97f 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/nestedClasses2.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/nestedClasses2.ir.txt @@ -1,3 +1,60 @@ +/** + * public final class A$B : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: c:LA$B$C; + * public final lateinit var c: A$B.C + * public final get + * public final set + * + * // field: de:LA$B$D$E; + * public final lateinit var de: A$B.D$E + * public final get + * public final set + * + * // field: dee:LA$B$D$$E; + * public final lateinit var dee: A$B.D$$E + * public final get + * public final set + * + * // field: deee:LA$B$D$$$E; + * public final lateinit var deee: A$B.D$$$E + * public final get + * public final set + * + * // field: jc:LJ$B$C; + * public final lateinit var jc: J$B.C + * public final get + * public final set + * + * // field: jde:LJ$B$D$E; + * public final lateinit var jde: J$B.D$E + * public final get + * public final set + * + * // field: jdee:LJ$B$D$$E; + * public final lateinit var jdee: J$B.D$$E + * public final get + * public final set + * + * // field: jdeee:LJ$B$D$$$E; + * public final lateinit var jdeee: J$B.D$$$E + * public final get + * public final set + * + * // nested class: C + * + * // nested class: D$$$E + * + * // nested class: D$$E + * + * // nested class: D$E + * + * // module name: main + * } + */ @kotlin.Metadata() public final class A$B { @kotlin.jvm.JvmField() @@ -21,6 +78,15 @@ public final class A$B { super(); } + /** + * public final class A$B.C : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class C { @@ -29,6 +95,15 @@ public final class A$B { } } + /** + * public final class A$B.D$$$E : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class D$$$E { @@ -37,6 +112,15 @@ public final class A$B { } } + /** + * public final class A$B.D$$E : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class D$$E { @@ -45,6 +129,39 @@ public final class A$B { } } + /** + * public final class A$B.D$E : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: f:LA$B$D$E$F; + * public final lateinit var f: A$B.D$E.F + * public final get + * public final set + * + * // field: fg:LA$B$D$E$F$G; + * public final lateinit var fg: A$B.D$E.F$G + * public final get + * public final set + * + * // field: jf:LJ$B$D$E$F; + * public final lateinit var jf: J$B.D$E.F + * public final get + * public final set + * + * // field: jfg:LJ$B$D$E$F$G; + * public final lateinit var jfg: J$B.D$E.F$G + * public final get + * public final set + * + * // nested class: F + * + * // nested class: F$G + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class D$E { @kotlin.jvm.JvmField() @@ -60,6 +177,15 @@ public final class A$B { super(); } + /** + * public final class A$B.D$E.F : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class F { @@ -68,6 +194,15 @@ public final class A$B { } } + /** + * public final class A$B.D$E.F$G : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class F$G { @@ -81,6 +216,19 @@ public final class A$B { //////////////////// +/** + * public final class Experiment : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: Group + * + * // nested class: Type + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Experiment { @@ -89,6 +237,37 @@ public final class Experiment { } @Experiment.Type() + /** + * public final data class Experiment.Group : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * public constructor(s: kotlin/String) + * + * // signature: component1()Ljava/lang/String; + * public final (* synthesized *) operator fun component1(): kotlin/String + * + * // signature: copy(Ljava/lang/String;)LExperiment$Group; + * public final (* synthesized *) fun copy(s: kotlin/String (* = ... *)): Experiment.Group + * + * // signature: equals(Ljava/lang/Object;)Z + * public open (* synthesized *) operator fun equals(other: kotlin/Any?): kotlin/Boolean + * + * // signature: hashCode()I + * public open (* synthesized *) fun hashCode(): kotlin/Int + * + * // signature: toString()Ljava/lang/String; + * public open (* synthesized *) fun toString(): kotlin/String + * + * // field: s:Ljava/lang/String; + * // getter: getS()Ljava/lang/String; + * // setter: setS(Ljava/lang/String;)V + * public final var s: kotlin/String + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Group { @org.jetbrains.annotations.NotNull() @@ -138,6 +317,15 @@ public final class Experiment { } @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) + /** + * public final annotation class Experiment.Type : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract @interface Type { } @@ -146,6 +334,17 @@ public final class Experiment { //////////////////// +/** + * public final class Foo : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: Bar + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { @@ -153,6 +352,17 @@ public final class Foo { super(); } + /** + * public open class Foo.Bar : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: Zoo + * + * // module name: main + * } + */ @kotlin.Metadata() public static class Bar { @@ -160,6 +370,15 @@ public final class Foo { super(); } + /** + * public final object Foo.Bar.Zoo : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Zoo { @org.jetbrains.annotations.NotNull() @@ -175,13 +394,44 @@ public final class Foo { //////////////////// +/** + * public abstract interface IFoo : kotlin/Any { + * + * // nested class: IBar + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface IFoo { + /** + * public abstract interface IFoo.IBar : kotlin/Any { + * + * // nested class: Anno + * + * // nested class: IZoo + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract interface IBar { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) + /** + * public final annotation class IFoo.IBar.Anno : kotlin/Annotation { + * + * // signature: (Lkotlin/Array;)V + * public constructor(vararg value: kotlin/reflect/KClass<*> (* kotlin/Array> *)) + * + * // getter: value()[Ljava/lang/Class; + * public final val value: kotlin/Array> + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract @interface Anno { @@ -189,6 +439,12 @@ public abstract interface IFoo { } @IFoo.IBar.Anno(value = {IFoo.IBar.IZoo.class}) + /** + * public abstract interface IFoo.IBar.IZoo : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract interface IZoo { } @@ -275,6 +531,26 @@ public class JavaClass { @IFoo.IBar.Anno(value = {IFoo.IBar.IZoo.class, Foo.Bar.class}) +/** + * public final class Test1 : Foo.Bar, IFoo.IBar, IFoo.IBar.IZoo { + * + * // signature: (LFoo$Bar$Zoo;)V + * public constructor(zoo: Foo.Bar.Zoo) + * + * // signature: a()Ljava/lang/Thread$State; + * public final fun a(): java/lang/Thread.State + * + * // signature: b(LJavaClass$Foo;LJavaClass$Foo$Bar;)V + * public final fun b(foo: JavaClass.Foo, bar: JavaClass.Foo.Bar): kotlin/Unit + * + * // field: zoo:LFoo$Bar$Zoo; + * // getter: getZoo()LFoo$Bar$Zoo; + * public final val zoo: Foo.Bar.Zoo + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test1 extends Foo.Bar implements IFoo.IBar, IFoo.IBar.IZoo { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/nestedClasses2.txt b/plugins/kapt3/kapt3-compiler/testData/converter/nestedClasses2.txt index c63533cb17f..c7d60371ded 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/nestedClasses2.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/nestedClasses2.txt @@ -1,3 +1,60 @@ +/** + * public final class A$B : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: c:LA$B$C; + * public final lateinit var c: A$B.C + * public final get + * public final set + * + * // field: de:LA$B$D$E; + * public final lateinit var de: A$B.D$E + * public final get + * public final set + * + * // field: dee:LA$B$D$$E; + * public final lateinit var dee: A$B.D$$E + * public final get + * public final set + * + * // field: deee:LA$B$D$$$E; + * public final lateinit var deee: A$B.D$$$E + * public final get + * public final set + * + * // field: jc:LJ$B$C; + * public final lateinit var jc: J$B.C + * public final get + * public final set + * + * // field: jde:LJ$B$D$E; + * public final lateinit var jde: J$B.D$E + * public final get + * public final set + * + * // field: jdee:LJ$B$D$$E; + * public final lateinit var jdee: J$B.D$$E + * public final get + * public final set + * + * // field: jdeee:LJ$B$D$$$E; + * public final lateinit var jdeee: J$B.D$$$E + * public final get + * public final set + * + * // nested class: C + * + * // nested class: D$$$E + * + * // nested class: D$$E + * + * // nested class: D$E + * + * // module name: main + * } + */ @kotlin.Metadata() public final class A$B { @kotlin.jvm.JvmField() @@ -21,6 +78,15 @@ public final class A$B { super(); } + /** + * public final class A$B.C : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class C { @@ -29,6 +95,39 @@ public final class A$B { } } + /** + * public final class A$B.D$E : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: f:LA$B$D$E$F; + * public final lateinit var f: A$B.D$E.F + * public final get + * public final set + * + * // field: fg:LA$B$D$E$F$G; + * public final lateinit var fg: A$B.D$E.F$G + * public final get + * public final set + * + * // field: jf:LJ$B$D$E$F; + * public final lateinit var jf: J$B.D$E.F + * public final get + * public final set + * + * // field: jfg:LJ$B$D$E$F$G; + * public final lateinit var jfg: J$B.D$E.F$G + * public final get + * public final set + * + * // nested class: F + * + * // nested class: F$G + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class D$E { @kotlin.jvm.JvmField() @@ -44,6 +143,15 @@ public final class A$B { super(); } + /** + * public final class A$B.D$E.F : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class F { @@ -52,6 +160,15 @@ public final class A$B { } } + /** + * public final class A$B.D$E.F$G : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class F$G { @@ -61,6 +178,15 @@ public final class A$B { } } + /** + * public final class A$B.D$$E : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class D$$E { @@ -69,6 +195,15 @@ public final class A$B { } } + /** + * public final class A$B.D$$$E : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class D$$$E { @@ -81,6 +216,19 @@ public final class A$B { //////////////////// +/** + * public final class Experiment : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: Group + * + * // nested class: Type + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Experiment { @@ -89,11 +237,51 @@ public final class Experiment { } @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) + /** + * public final annotation class Experiment.Type : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract @interface Type { } @Experiment.Type() + /** + * public final data class Experiment.Group : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * public constructor(s: kotlin/String) + * + * // signature: component1()Ljava/lang/String; + * public final (* synthesized *) operator fun component1(): kotlin/String + * + * // signature: copy(Ljava/lang/String;)LExperiment$Group; + * public final (* synthesized *) fun copy(s: kotlin/String (* = ... *)): Experiment.Group + * + * // signature: equals(Ljava/lang/Object;)Z + * public open (* synthesized *) operator fun equals(other: kotlin/Any?): kotlin/Boolean + * + * // signature: hashCode()I + * public open (* synthesized *) fun hashCode(): kotlin/Int + * + * // signature: toString()Ljava/lang/String; + * public open (* synthesized *) fun toString(): kotlin/String + * + * // field: s:Ljava/lang/String; + * // getter: getS()Ljava/lang/String; + * // setter: setS(Ljava/lang/String;)V + * public final var s: kotlin/String + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Group { @org.jetbrains.annotations.NotNull() @@ -146,6 +334,17 @@ public final class Experiment { //////////////////// +/** + * public final class Foo : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: Bar + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { @@ -153,6 +352,17 @@ public final class Foo { super(); } + /** + * public open class Foo.Bar : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: Zoo + * + * // module name: main + * } + */ @kotlin.Metadata() public static class Bar { @@ -160,6 +370,15 @@ public final class Foo { super(); } + /** + * public final object Foo.Bar.Zoo : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Zoo { @org.jetbrains.annotations.NotNull() @@ -175,13 +394,44 @@ public final class Foo { //////////////////// +/** + * public abstract interface IFoo : kotlin/Any { + * + * // nested class: IBar + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface IFoo { + /** + * public abstract interface IFoo.IBar : kotlin/Any { + * + * // nested class: Anno + * + * // nested class: IZoo + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract interface IBar { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) + /** + * public final annotation class IFoo.IBar.Anno : kotlin/Annotation { + * + * // signature: (Lkotlin/Array;)V + * public constructor(vararg value: kotlin/reflect/KClass<*> (* kotlin/Array> *)) + * + * // getter: value()[Ljava/lang/Class; + * public final val value: kotlin/Array> + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract @interface Anno { @@ -189,6 +439,12 @@ public abstract interface IFoo { } @IFoo.IBar.Anno(value = {IFoo.IBar.IZoo.class}) + /** + * public abstract interface IFoo.IBar.IZoo : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract interface IZoo { } @@ -275,6 +531,26 @@ public class JavaClass { @IFoo.IBar.Anno(value = {IFoo.IBar.IZoo.class, Foo.Bar.class}) +/** + * public final class Test1 : Foo.Bar, IFoo.IBar, IFoo.IBar.IZoo { + * + * // signature: (LFoo$Bar$Zoo;)V + * public constructor(zoo: Foo.Bar.Zoo) + * + * // signature: a()Ljava/lang/Thread$State; + * public final fun a(): java/lang/Thread.State + * + * // signature: b(LJavaClass$Foo;LJavaClass$Foo$Bar;)V + * public final fun b(foo: JavaClass.Foo, bar: JavaClass.Foo.Bar): kotlin/Unit + * + * // field: zoo:LFoo$Bar$Zoo; + * // getter: getZoo()LFoo$Bar$Zoo; + * public final val zoo: Foo.Bar.Zoo + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test1 extends Foo.Bar implements IFoo.IBar, IFoo.IBar.IZoo { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/nestedClassesNonRootPackage.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/nestedClassesNonRootPackage.ir.txt index 51d4e4a4db1..2ddac78a90a 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/nestedClassesNonRootPackage.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/nestedClassesNonRootPackage.ir.txt @@ -1,5 +1,62 @@ package test; +/** + * public final class test/A$B : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: c:Ltest/A$B$C; + * public final lateinit var c: test/A$B.C + * public final get + * public final set + * + * // field: de:Ltest/A$B$D$E; + * public final lateinit var de: test/A$B.D$E + * public final get + * public final set + * + * // field: dee:Ltest/A$B$D$$E; + * public final lateinit var dee: test/A$B.D$$E + * public final get + * public final set + * + * // field: deee:Ltest/A$B$D$$$E; + * public final lateinit var deee: test/A$B.D$$$E + * public final get + * public final set + * + * // field: jc:Ltest/J$B$C; + * public final lateinit var jc: test/J$B.C + * public final get + * public final set + * + * // field: jde:Ltest/J$B$D$E; + * public final lateinit var jde: test/J$B.D$E + * public final get + * public final set + * + * // field: jdee:Ltest/J$B$D$$E; + * public final lateinit var jdee: test/J$B.D$$E + * public final get + * public final set + * + * // field: jdeee:Ltest/J$B$D$$$E; + * public final lateinit var jdeee: test/J$B.D$$$E + * public final get + * public final set + * + * // nested class: C + * + * // nested class: D$$$E + * + * // nested class: D$$E + * + * // nested class: D$E + * + * // module name: main + * } + */ @kotlin.Metadata() public final class A$B { @kotlin.jvm.JvmField() @@ -23,6 +80,15 @@ public final class A$B { super(); } + /** + * public final class test/A$B.C : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class C { @@ -31,6 +97,15 @@ public final class A$B { } } + /** + * public final class test/A$B.D$$$E : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class D$$$E { @@ -39,6 +114,15 @@ public final class A$B { } } + /** + * public final class test/A$B.D$$E : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class D$$E { @@ -47,6 +131,39 @@ public final class A$B { } } + /** + * public final class test/A$B.D$E : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: f:Ltest/A$B$D$E$F; + * public final lateinit var f: test/A$B.D$E.F + * public final get + * public final set + * + * // field: fg:Ltest/A$B$D$E$F$G; + * public final lateinit var fg: test/A$B.D$E.F$G + * public final get + * public final set + * + * // field: jf:Ltest/J$B$D$E$F; + * public final lateinit var jf: test/J$B.D$E.F + * public final get + * public final set + * + * // field: jfg:Ltest/J$B$D$E$F$G; + * public final lateinit var jfg: test/J$B.D$E.F$G + * public final get + * public final set + * + * // nested class: F + * + * // nested class: F$G + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class D$E { @kotlin.jvm.JvmField() @@ -62,6 +179,15 @@ public final class A$B { super(); } + /** + * public final class test/A$B.D$E.F : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class F { @@ -70,6 +196,15 @@ public final class A$B { } } + /** + * public final class test/A$B.D$E.F$G : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class F$G { @@ -84,6 +219,19 @@ public final class A$B { package test; +/** + * public final class test/Experiment : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: Group + * + * // nested class: Type + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Experiment { @@ -92,6 +240,35 @@ public final class Experiment { } @test.Experiment.Type() + /** + * public final data class test/Experiment.Group : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * public constructor(s: kotlin/String) + * + * // signature: component1()Ljava/lang/String; + * public final (* synthesized *) operator fun component1(): kotlin/String + * + * // signature: copy(Ljava/lang/String;)Ltest/Experiment$Group; + * public final (* synthesized *) fun copy(s: kotlin/String (* = ... *)): test/Experiment.Group + * + * // signature: equals(Ljava/lang/Object;)Z + * public open (* synthesized *) operator fun equals(other: kotlin/Any?): kotlin/Boolean + * + * // signature: hashCode()I + * public open (* synthesized *) fun hashCode(): kotlin/Int + * + * // signature: toString()Ljava/lang/String; + * public open (* synthesized *) fun toString(): kotlin/String + * + * // field: s:Ljava/lang/String; + * // getter: getS()Ljava/lang/String; + * public final val s: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Group { @org.jetbrains.annotations.NotNull() @@ -137,6 +314,15 @@ public final class Experiment { } @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) + /** + * public final annotation class test/Experiment.Type : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract @interface Type { } @@ -146,6 +332,17 @@ public final class Experiment { package test; +/** + * public final class test/Foo : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: Bar + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { @@ -153,6 +350,17 @@ public final class Foo { super(); } + /** + * public open class test/Foo.Bar : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: Zoo + * + * // module name: main + * } + */ @kotlin.Metadata() public static class Bar { @@ -160,6 +368,15 @@ public final class Foo { super(); } + /** + * public final object test/Foo.Bar.Zoo : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Zoo { @org.jetbrains.annotations.NotNull() @@ -176,13 +393,44 @@ public final class Foo { package test; +/** + * public abstract interface test/IFoo : kotlin/Any { + * + * // nested class: IBar + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface IFoo { + /** + * public abstract interface test/IFoo.IBar : kotlin/Any { + * + * // nested class: Anno + * + * // nested class: IZoo + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract interface IBar { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) + /** + * public final annotation class test/IFoo.IBar.Anno : kotlin/Annotation { + * + * // signature: (Lkotlin/Array;)V + * public constructor(vararg value: kotlin/reflect/KClass<*> (* kotlin/Array> *)) + * + * // getter: value()[Ljava/lang/Class; + * public final val value: kotlin/Array> + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract @interface Anno { @@ -190,6 +438,12 @@ public abstract interface IFoo { } @test.IFoo.IBar.Anno(value = {test.IFoo.IBar.IZoo.class}) + /** + * public abstract interface test/IFoo.IBar.IZoo : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract interface IZoo { } @@ -279,6 +533,26 @@ class JavaClass { package test; @test.IFoo.IBar.Anno(value = {test.IFoo.IBar.IZoo.class, test.Foo.Bar.class}) +/** + * public final class test/Test1 : test/Foo.Bar, test/IFoo.IBar, test/IFoo.IBar.IZoo { + * + * // signature: (Ltest/Foo$Bar$Zoo;)V + * public constructor(zoo: test/Foo.Bar.Zoo) + * + * // signature: a()Ljava/lang/Thread$State; + * public final fun a(): java/lang/Thread.State + * + * // signature: b(Ltest/JavaClass$Foo;Ltest/JavaClass$Foo$Bar;)V + * public final fun b(foo: test/JavaClass.Foo, bar: test/JavaClass.Foo.Bar): kotlin/Unit + * + * // field: zoo:Ltest/Foo$Bar$Zoo; + * // getter: getZoo()Ltest/Foo$Bar$Zoo; + * public final val zoo: test/Foo.Bar.Zoo + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test1 extends test.Foo.Bar implements test.IFoo.IBar, test.IFoo.IBar.IZoo { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/nestedClassesNonRootPackage.txt b/plugins/kapt3/kapt3-compiler/testData/converter/nestedClassesNonRootPackage.txt index 46f18b611cd..35f584c7fe9 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/nestedClassesNonRootPackage.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/nestedClassesNonRootPackage.txt @@ -1,5 +1,62 @@ package test; +/** + * public final class test/A$B : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: c:Ltest/A$B$C; + * public final lateinit var c: test/A$B.C + * public final get + * public final set + * + * // field: de:Ltest/A$B$D$E; + * public final lateinit var de: test/A$B.D$E + * public final get + * public final set + * + * // field: dee:Ltest/A$B$D$$E; + * public final lateinit var dee: test/A$B.D$$E + * public final get + * public final set + * + * // field: deee:Ltest/A$B$D$$$E; + * public final lateinit var deee: test/A$B.D$$$E + * public final get + * public final set + * + * // field: jc:Ltest/J$B$C; + * public final lateinit var jc: test/J$B.C + * public final get + * public final set + * + * // field: jde:Ltest/J$B$D$E; + * public final lateinit var jde: test/J$B.D$E + * public final get + * public final set + * + * // field: jdee:Ltest/J$B$D$$E; + * public final lateinit var jdee: test/J$B.D$$E + * public final get + * public final set + * + * // field: jdeee:Ltest/J$B$D$$$E; + * public final lateinit var jdeee: test/J$B.D$$$E + * public final get + * public final set + * + * // nested class: C + * + * // nested class: D$$$E + * + * // nested class: D$$E + * + * // nested class: D$E + * + * // module name: main + * } + */ @kotlin.Metadata() public final class A$B { @kotlin.jvm.JvmField() @@ -23,6 +80,15 @@ public final class A$B { super(); } + /** + * public final class test/A$B.C : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class C { @@ -31,6 +97,39 @@ public final class A$B { } } + /** + * public final class test/A$B.D$E : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: f:Ltest/A$B$D$E$F; + * public final lateinit var f: test/A$B.D$E.F + * public final get + * public final set + * + * // field: fg:Ltest/A$B$D$E$F$G; + * public final lateinit var fg: test/A$B.D$E.F$G + * public final get + * public final set + * + * // field: jf:Ltest/J$B$D$E$F; + * public final lateinit var jf: test/J$B.D$E.F + * public final get + * public final set + * + * // field: jfg:Ltest/J$B$D$E$F$G; + * public final lateinit var jfg: test/J$B.D$E.F$G + * public final get + * public final set + * + * // nested class: F + * + * // nested class: F$G + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class D$E { @kotlin.jvm.JvmField() @@ -46,6 +145,15 @@ public final class A$B { super(); } + /** + * public final class test/A$B.D$E.F : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class F { @@ -54,6 +162,15 @@ public final class A$B { } } + /** + * public final class test/A$B.D$E.F$G : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class F$G { @@ -63,6 +180,15 @@ public final class A$B { } } + /** + * public final class test/A$B.D$$E : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class D$$E { @@ -71,6 +197,15 @@ public final class A$B { } } + /** + * public final class test/A$B.D$$$E : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class D$$$E { @@ -84,6 +219,19 @@ public final class A$B { package test; +/** + * public final class test/Experiment : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: Group + * + * // nested class: Type + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Experiment { @@ -92,11 +240,49 @@ public final class Experiment { } @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) + /** + * public final annotation class test/Experiment.Type : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract @interface Type { } @test.Experiment.Type() + /** + * public final data class test/Experiment.Group : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * public constructor(s: kotlin/String) + * + * // signature: component1()Ljava/lang/String; + * public final (* synthesized *) operator fun component1(): kotlin/String + * + * // signature: copy(Ljava/lang/String;)Ltest/Experiment$Group; + * public final (* synthesized *) fun copy(s: kotlin/String (* = ... *)): test/Experiment.Group + * + * // signature: equals(Ljava/lang/Object;)Z + * public open (* synthesized *) operator fun equals(other: kotlin/Any?): kotlin/Boolean + * + * // signature: hashCode()I + * public open (* synthesized *) fun hashCode(): kotlin/Int + * + * // signature: toString()Ljava/lang/String; + * public open (* synthesized *) fun toString(): kotlin/String + * + * // field: s:Ljava/lang/String; + * // getter: getS()Ljava/lang/String; + * public final val s: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Group { @org.jetbrains.annotations.NotNull() @@ -146,6 +332,17 @@ public final class Experiment { package test; +/** + * public final class test/Foo : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: Bar + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { @@ -153,6 +350,17 @@ public final class Foo { super(); } + /** + * public open class test/Foo.Bar : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // nested class: Zoo + * + * // module name: main + * } + */ @kotlin.Metadata() public static class Bar { @@ -160,6 +368,15 @@ public final class Foo { super(); } + /** + * public final object test/Foo.Bar.Zoo : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public static final class Zoo { @org.jetbrains.annotations.NotNull() @@ -176,13 +393,44 @@ public final class Foo { package test; +/** + * public abstract interface test/IFoo : kotlin/Any { + * + * // nested class: IBar + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface IFoo { + /** + * public abstract interface test/IFoo.IBar : kotlin/Any { + * + * // nested class: Anno + * + * // nested class: IZoo + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract interface IBar { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) + /** + * public final annotation class test/IFoo.IBar.Anno : kotlin/Annotation { + * + * // signature: (Lkotlin/Array;)V + * public constructor(vararg value: kotlin/reflect/KClass<*> (* kotlin/Array> *)) + * + * // getter: value()[Ljava/lang/Class; + * public final val value: kotlin/Array> + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract @interface Anno { @@ -190,6 +438,12 @@ public abstract interface IFoo { } @test.IFoo.IBar.Anno(value = {test.IFoo.IBar.IZoo.class}) + /** + * public abstract interface test/IFoo.IBar.IZoo : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public static abstract interface IZoo { } @@ -279,6 +533,26 @@ class JavaClass { package test; @test.IFoo.IBar.Anno(value = {test.IFoo.IBar.IZoo.class, test.Foo.Bar.class}) +/** + * public final class test/Test1 : test/Foo.Bar, test/IFoo.IBar, test/IFoo.IBar.IZoo { + * + * // signature: (Ltest/Foo$Bar$Zoo;)V + * public constructor(zoo: test/Foo.Bar.Zoo) + * + * // signature: a()Ljava/lang/Thread$State; + * public final fun a(): java/lang/Thread.State + * + * // signature: b(Ltest/JavaClass$Foo;Ltest/JavaClass$Foo$Bar;)V + * public final fun b(foo: test/JavaClass.Foo, bar: test/JavaClass.Foo.Bar): kotlin/Unit + * + * // field: zoo:Ltest/Foo$Bar$Zoo; + * // getter: getZoo()Ltest/Foo$Bar$Zoo; + * public final val zoo: test/Foo.Bar.Zoo + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test1 extends test.Foo.Bar implements test.IFoo.IBar, test.IFoo.IBar.IZoo { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClass.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClass.fir.txt index baa68443707..8cc6d139af6 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClass.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClass.fir.txt @@ -1,3 +1,42 @@ +/** + * public final object NonExistentType : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // signature: a(Lerror/NonExistentClass;Ljava/lang/String;)Lerror/NonExistentClass; + * public final fun a(a: error/NonExistentClass, s: kotlin/String): error/NonExistentClass + * + * // signature: b(Ljava/lang/String;)Lerror/NonExistentClass; + * public final fun b(s: kotlin/String): error/NonExistentClass + * + * // field: a:Lerror/NonExistentClass; + * // getter: getA()Lerror/NonExistentClass; + * public final val a: error/NonExistentClass + * public final get + * + * // field: b:Ljava/util/List; + * // getter: getB()Ljava/util/List; + * public final val b: kotlin/collections/List? + * public final get + * + * // field: c:Lkotlin/jvm/functions/Function1; + * // getter: getC()Lkotlin/jvm/functions/Function1; + * public final val c: kotlin/Function1 + * public final get + * + * // field: d:Lerror/NonExistentClass; + * // getter: getD()Lerror/NonExistentClass; + * public final val d: error/NonExistentClass + * public final get + * + * // getter: getFoo()Lerror/NonExistentClass; + * public final val foo: error/NonExistentClass + * public final (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) public final class NonExistentType { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClass.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClass.ir.txt index a564bb5d998..290b8523afc 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClass.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClass.ir.txt @@ -1,3 +1,42 @@ +/** + * public final object NonExistentType : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // signature: a(Lerror/NonExistentClass;Ljava/lang/String;)Lerror/NonExistentClass; + * public final fun a(a: error/NonExistentClass, s: kotlin/String): error/NonExistentClass + * + * // signature: b(Ljava/lang/String;)Lerror/NonExistentClass; + * public final fun b(s: kotlin/String): error/NonExistentClass + * + * // field: a:Lerror/NonExistentClass; + * // getter: getA()Lerror/NonExistentClass; + * public final val a: error/NonExistentClass + * public final get + * + * // field: b:Ljava/util/List; + * // getter: getB()Ljava/util/List; + * public final val b: kotlin/collections/List? + * public final get + * + * // field: c:Lkotlin/jvm/functions/Function1; + * // getter: getC()Lkotlin/jvm/functions/Function1; + * public final val c: kotlin/Function1 + * public final get + * + * // field: d:Lerror/NonExistentClass; + * // getter: getD()Lerror/NonExistentClass; + * public final val d: error/NonExistentClass + * public final get + * + * // getter: getFoo()Lerror/NonExistentClass; + * public final val foo: error/NonExistentClass + * public final (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) public final class NonExistentType { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClass.txt b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClass.txt index c2ee028ab6f..ca85ffa06c8 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClass.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClass.txt @@ -1,3 +1,42 @@ +/** + * public final object NonExistentType : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // signature: a(Lerror/NonExistentClass;Ljava/lang/String;)Lerror/NonExistentClass; + * public final fun a(a: error/NonExistentClass, s: kotlin/String): error/NonExistentClass + * + * // signature: b(Ljava/lang/String;)Lerror/NonExistentClass; + * public final fun b(s: kotlin/String): error/NonExistentClass + * + * // field: a:Lerror/NonExistentClass; + * // getter: getA()Lerror/NonExistentClass; + * public final val a: error/NonExistentClass + * public final get + * + * // field: b:Ljava/util/List; + * // getter: getB()Ljava/util/List; + * public final val b: kotlin/collections/List? + * public final get + * + * // field: c:Lkotlin/jvm/functions/Function1; + * // getter: getC()Lkotlin/jvm/functions/Function1; + * public final val c: kotlin/Function1 + * public final get + * + * // field: d:Lerror/NonExistentClass; + * // getter: getD()Lerror/NonExistentClass; + * public final val d: error/NonExistentClass + * public final get + * + * // getter: getFoo()Lerror/NonExistentClass; + * public final val foo: error/NonExistentClass + * public final (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) public final class NonExistentType { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassTypesConversion.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassTypesConversion.ir.txt index d095164d167..26d93ba6ae1 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassTypesConversion.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassTypesConversion.ir.txt @@ -2,6 +2,31 @@ import java.util.Calendar; import kotlin.reflect.KClass; @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class Anno : kotlin/Annotation { + * + * // signature: (Lkotlin/reflect/KClass;Lkotlin/Array;Lkotlin/Array;Lkotlin/Array;)V + * public constructor(a: kotlin/reflect/KClass<*>, b: kotlin/Array>, c: kotlin/Array>, vararg d: kotlin/reflect/KClass<*> (* kotlin/Array> *)) + * + * // getter: a()Ljava/lang/Class; + * public final val a: kotlin/reflect/KClass<*> + * public final get + * + * // getter: b()[Ljava/lang/Class; + * public final val b: kotlin/Array> + * public final get + * + * // getter: c()[Ljava/lang/Class; + * public final val c: kotlin/Array> + * public final get + * + * // getter: d()[Ljava/lang/Class; + * public final val d: kotlin/Array> + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno { @@ -20,6 +45,15 @@ public abstract @interface Anno { import java.util.Calendar; import kotlin.reflect.KClass; +/** + * public final class MyType : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class MyType { @@ -34,6 +68,22 @@ public final class MyType { import java.util.Calendar; import kotlin.reflect.KClass; +/** + * package { + * + * public typealias Coocoo = error/NonExistentClass (* = error/NonExistentClass *) + * + * public typealias Coocoo2 = error/NonExistentClass (* = error/NonExistentClass *) + * + * public typealias Coocoo3 = error/NonExistentClass (* = error/NonExistentClass *) + * + * public typealias Nested1 = error/NonExistentClass (* = error/NonExistentClass *) + * + * public typealias Nested2 = Nested1^ (* = error/NonExistentClass *) + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE", "ANNOTATION_ARGUMENT_MUST_BE_CONST", "NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION", "UNSUPPORTED_FEATURE"}) public final class NonExistentClassTypesConversionKt { @@ -46,6 +96,181 @@ import java.util.Calendar; import kotlin.reflect.KClass; @Anno(a = Blah.class, b = {NoFoo1.class, NoBar1.class}, c = {NoFoo2.class, kotlin.String.class}, d = {kotlin.Boolean.class, NoBar3.class}) +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: f1(Lerror/NonExistentClass;)Lerror/NonExistentClass; + * public final fun f1(a: error/NonExistentClass): error/NonExistentClass + * + * // signature: f2(Lerror/NonExistentClass;)V + * public final fun f2(a: error/NonExistentClass): kotlin/Unit + * + * // signature: f3(Lerror/NonExistentClass;I)J + * public final fun f3(a: error/NonExistentClass, b: kotlin/Int): kotlin/Long + * + * // signature: f4()Lerror/NonExistentClass; + * public final fun f4(): error/NonExistentClass + * + * // signature: f5(LMyType;)Ljava/lang/Class; + * public final fun MyType.f5(): java/lang/Class>? + * + * // field: a:Lerror/NonExistentClass; + * // getter: getA()Lerror/NonExistentClass; + * // setter: setA(Lerror/NonExistentClass;)V + * public final lateinit var a: error/NonExistentClass + * public final get + * public final set + * + * // field: b:Lerror/NonExistentClass; + * // getter: getB()Lerror/NonExistentClass; + * public final val b: error/NonExistentClass + * public final get + * + * // field: c:Ljava/util/List; + * // getter: getC()Ljava/util/List; + * public final val c: kotlin/collections/List? + * public final get + * + * // field: coocoo:Lerror/NonExistentClass; + * // getter: getCoocoo()Lerror/NonExistentClass; + * // setter: setCoocoo(Lerror/NonExistentClass;)V + * public final lateinit var coocoo: error/NonExistentClass + * public final get + * public final set + * + * // field: coocoo2:Lerror/NonExistentClass; + * // getter: getCoocoo2()Lerror/NonExistentClass; + * // setter: setCoocoo2(Lerror/NonExistentClass;)V + * public final lateinit var coocoo2: error/NonExistentClass + * public final get + * public final set + * + * // field: coocoo21:Lerror/NonExistentClass; + * // getter: getCoocoo21()Lerror/NonExistentClass; + * // setter: setCoocoo21(Lerror/NonExistentClass;)V + * public final lateinit var coocoo21: error/NonExistentClass + * public final get + * public final set + * + * // field: coocoo3:Lerror/NonExistentClass; + * // getter: getCoocoo3()Lerror/NonExistentClass; + * // setter: setCoocoo3(Lerror/NonExistentClass;)V + * public final lateinit var coocoo3: error/NonExistentClass + * public final get + * public final set + * + * // field: coocoo31:Lerror/NonExistentClass; + * // getter: getCoocoo31()Lerror/NonExistentClass; + * // setter: setCoocoo31(Lerror/NonExistentClass;)V + * public final lateinit var coocoo31: error/NonExistentClass + * public final get + * public final set + * + * // field: d:Ljava/util/List; + * // getter: getD()Ljava/util/List; + * public final val d: kotlin/collections/List>? + * public final get + * + * // field: e:Ljava/util/List; + * // getter: getE()Ljava/util/List; + * // setter: setE(Ljava/util/List;)V + * public final lateinit var e: kotlin/collections/List?> + * public final get + * public final set + * + * // field: f:Lerror/NonExistentClass; + * // getter: getF()Lerror/NonExistentClass; + * // setter: setF(Lerror/NonExistentClass;)V + * public final lateinit var f: error/NonExistentClass + * public final get + * public final set + * + * // field: g:Ljava/util/List; + * // getter: getG()Ljava/util/List; + * // setter: setG(Ljava/util/List;)V + * public final lateinit var g: kotlin/collections/List<*> + * public final get + * public final set + * + * // field: h:Lerror/NonExistentClass; + * // getter: getH()Lerror/NonExistentClass; + * // setter: setH(Lerror/NonExistentClass;)V + * public final lateinit var h: error/NonExistentClass + * public final get + * public final set + * + * // field: i:Lkotlin/jvm/functions/Function2; + * // getter: getI()Lkotlin/jvm/functions/Function2; + * // setter: setI(Lkotlin/jvm/functions/Function2;)V + * public final lateinit var i: kotlin/Function2, error/NonExistentClass> + * public final get + * public final set + * + * // field: j:Lkotlin/jvm/functions/Function0; + * // getter: getJ()Lkotlin/jvm/functions/Function0; + * // setter: setJ(Lkotlin/jvm/functions/Function0;)V + * public final lateinit var j: kotlin/Function0 + * public final get + * public final set + * + * // field: k:Lkotlin/jvm/functions/Function2; + * // getter: getK()Lkotlin/jvm/functions/Function2; + * // setter: setK(Lkotlin/jvm/functions/Function2;)V + * public final lateinit var k: @kotlin/ExtensionFunctionType kotlin/Function2, error/NonExistentClass> + * public final get + * public final set + * + * // field: l:Lerror/NonExistentClass; + * // getter: getL()Lerror/NonExistentClass; + * // setter: setL(Lerror/NonExistentClass;)V + * public final lateinit var l: error/NonExistentClass + * public final get + * public final set + * + * // field: m:Lerror/NonExistentClass; + * // getter: getM()Lerror/NonExistentClass; + * public final val m: error/NonExistentClass + * public final get + * + * // field: n:Ljava/lang/String; + * // getter: getN()Ljava/lang/String; + * public final val n: kotlin/String (* = ... *) + * public final get + * + * // field: nested:Lerror/NonExistentClass; + * // getter: getNested()Lerror/NonExistentClass; + * // setter: setNested(Lerror/NonExistentClass;)V + * public final lateinit var nested: error/NonExistentClass + * public final get + * public final set + * + * // field: o10:Ljava/util/List; + * // getter: getO10()Ljava/util/List; + * // setter: setO10(Ljava/util/List;)V + * public final lateinit var o10: kotlin/collections/List>>>>>>>> + * public final get + * public final set + * + * // field: o11:Ljava/util/List; + * // getter: getO11()Ljava/util/List; + * // setter: setO11(Ljava/util/List;)V + * public final lateinit var o11: kotlin/collections/List>>>>>>>>> + * public final get + * public final set + * + * // field: p:Ljava/util/Calendar$Builder; + * // getter: getP()Ljava/util/Calendar$Builder; + * // setter: setP(Ljava/util/Calendar$Builder;)V + * public final lateinit var p: java/util/Calendar.Builder + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { public ABC a; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassTypesConversion.txt b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassTypesConversion.txt index f8d17736fbd..044a74f0dcd 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassTypesConversion.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassTypesConversion.txt @@ -2,6 +2,31 @@ import java.util.Calendar; import kotlin.reflect.KClass; @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class Anno : kotlin/Annotation { + * + * // signature: (Lkotlin/reflect/KClass;Lkotlin/Array;Lkotlin/Array;Lkotlin/Array;)V + * public constructor(a: kotlin/reflect/KClass<*>, b: kotlin/Array>, c: kotlin/Array>, vararg d: kotlin/reflect/KClass<*> (* kotlin/Array> *)) + * + * // getter: a()Ljava/lang/Class; + * public final val a: kotlin/reflect/KClass<*> + * public final get + * + * // getter: b()[Ljava/lang/Class; + * public final val b: kotlin/Array> + * public final get + * + * // getter: c()[Ljava/lang/Class; + * public final val c: kotlin/Array> + * public final get + * + * // getter: d()[Ljava/lang/Class; + * public final val d: kotlin/Array> + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno { @@ -20,6 +45,15 @@ public abstract @interface Anno { import java.util.Calendar; import kotlin.reflect.KClass; +/** + * public final class MyType : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class MyType { @@ -34,6 +68,22 @@ public final class MyType { import java.util.Calendar; import kotlin.reflect.KClass; +/** + * package { + * + * public typealias Coocoo = error/NonExistentClass (* = error/NonExistentClass *) + * + * public typealias Coocoo2 = error/NonExistentClass (* = error/NonExistentClass *) + * + * public typealias Coocoo3 = error/NonExistentClass (* = error/NonExistentClass *) + * + * public typealias Nested1 = error/NonExistentClass (* = error/NonExistentClass *) + * + * public typealias Nested2 = Nested1^ (* = error/NonExistentClass *) + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE", "ANNOTATION_ARGUMENT_MUST_BE_CONST", "NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION", "UNSUPPORTED_FEATURE"}) public final class NonExistentClassTypesConversionKt { @@ -46,6 +96,181 @@ import java.util.Calendar; import kotlin.reflect.KClass; @Anno(a = Blah.class, b = {NoFoo1.class, NoBar1.class}, c = {NoFoo2.class, kotlin.String.class}, d = {kotlin.Boolean.class, NoBar3.class}) +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: f1(Lerror/NonExistentClass;)Lerror/NonExistentClass; + * public final fun f1(a: error/NonExistentClass): error/NonExistentClass + * + * // signature: f2(Lerror/NonExistentClass;)V + * public final fun f2(a: error/NonExistentClass): kotlin/Unit + * + * // signature: f3(Lerror/NonExistentClass;I)J + * public final fun f3(a: error/NonExistentClass, b: kotlin/Int): kotlin/Long + * + * // signature: f4()Lerror/NonExistentClass; + * public final fun f4(): error/NonExistentClass + * + * // signature: f5(LMyType;)Ljava/lang/Class; + * public final fun MyType.f5(): java/lang/Class>? + * + * // field: a:Lerror/NonExistentClass; + * // getter: getA()Lerror/NonExistentClass; + * // setter: setA(Lerror/NonExistentClass;)V + * public final lateinit var a: error/NonExistentClass + * public final get + * public final set + * + * // field: b:Lerror/NonExistentClass; + * // getter: getB()Lerror/NonExistentClass; + * public final val b: error/NonExistentClass + * public final get + * + * // field: c:Ljava/util/List; + * // getter: getC()Ljava/util/List; + * public final val c: kotlin/collections/List? + * public final get + * + * // field: coocoo:Lerror/NonExistentClass; + * // getter: getCoocoo()Lerror/NonExistentClass; + * // setter: setCoocoo(Lerror/NonExistentClass;)V + * public final lateinit var coocoo: error/NonExistentClass + * public final get + * public final set + * + * // field: coocoo2:Lerror/NonExistentClass; + * // getter: getCoocoo2()Lerror/NonExistentClass; + * // setter: setCoocoo2(Lerror/NonExistentClass;)V + * public final lateinit var coocoo2: error/NonExistentClass + * public final get + * public final set + * + * // field: coocoo21:Lerror/NonExistentClass; + * // getter: getCoocoo21()Lerror/NonExistentClass; + * // setter: setCoocoo21(Lerror/NonExistentClass;)V + * public final lateinit var coocoo21: error/NonExistentClass + * public final get + * public final set + * + * // field: coocoo3:Lerror/NonExistentClass; + * // getter: getCoocoo3()Lerror/NonExistentClass; + * // setter: setCoocoo3(Lerror/NonExistentClass;)V + * public final lateinit var coocoo3: error/NonExistentClass + * public final get + * public final set + * + * // field: coocoo31:Lerror/NonExistentClass; + * // getter: getCoocoo31()Lerror/NonExistentClass; + * // setter: setCoocoo31(Lerror/NonExistentClass;)V + * public final lateinit var coocoo31: error/NonExistentClass + * public final get + * public final set + * + * // field: d:Ljava/util/List; + * // getter: getD()Ljava/util/List; + * public final val d: kotlin/collections/List>? + * public final get + * + * // field: e:Ljava/util/List; + * // getter: getE()Ljava/util/List; + * // setter: setE(Ljava/util/List;)V + * public final lateinit var e: kotlin/collections/List?> + * public final get + * public final set + * + * // field: f:Lerror/NonExistentClass; + * // getter: getF()Lerror/NonExistentClass; + * // setter: setF(Lerror/NonExistentClass;)V + * public final lateinit var f: error/NonExistentClass + * public final get + * public final set + * + * // field: g:Ljava/util/List; + * // getter: getG()Ljava/util/List; + * // setter: setG(Ljava/util/List;)V + * public final lateinit var g: kotlin/collections/List<*> + * public final get + * public final set + * + * // field: h:Lerror/NonExistentClass; + * // getter: getH()Lerror/NonExistentClass; + * // setter: setH(Lerror/NonExistentClass;)V + * public final lateinit var h: error/NonExistentClass + * public final get + * public final set + * + * // field: i:Lkotlin/jvm/functions/Function2; + * // getter: getI()Lkotlin/jvm/functions/Function2; + * // setter: setI(Lkotlin/jvm/functions/Function2;)V + * public final lateinit var i: kotlin/Function2, error/NonExistentClass> + * public final get + * public final set + * + * // field: j:Lkotlin/jvm/functions/Function0; + * // getter: getJ()Lkotlin/jvm/functions/Function0; + * // setter: setJ(Lkotlin/jvm/functions/Function0;)V + * public final lateinit var j: kotlin/Function0 + * public final get + * public final set + * + * // field: k:Lkotlin/jvm/functions/Function2; + * // getter: getK()Lkotlin/jvm/functions/Function2; + * // setter: setK(Lkotlin/jvm/functions/Function2;)V + * public final lateinit var k: @kotlin/ExtensionFunctionType kotlin/Function2, error/NonExistentClass> + * public final get + * public final set + * + * // field: l:Lerror/NonExistentClass; + * // getter: getL()Lerror/NonExistentClass; + * // setter: setL(Lerror/NonExistentClass;)V + * public final lateinit var l: error/NonExistentClass + * public final get + * public final set + * + * // field: m:Lerror/NonExistentClass; + * // getter: getM()Lerror/NonExistentClass; + * public final val m: error/NonExistentClass + * public final get + * + * // field: n:Ljava/lang/String; + * // getter: getN()Ljava/lang/String; + * public final val n: kotlin/String (* = ... *) + * public final get + * + * // field: nested:Lerror/NonExistentClass; + * // getter: getNested()Lerror/NonExistentClass; + * // setter: setNested(Lerror/NonExistentClass;)V + * public final lateinit var nested: error/NonExistentClass + * public final get + * public final set + * + * // field: o10:Ljava/util/List; + * // getter: getO10()Ljava/util/List; + * // setter: setO10(Ljava/util/List;)V + * public final lateinit var o10: kotlin/collections/List>>>>>>>> + * public final get + * public final set + * + * // field: o11:Ljava/util/List; + * // getter: getO11()Ljava/util/List; + * // setter: setO11(Ljava/util/List;)V + * public final lateinit var o11: kotlin/collections/List>>>>>>>>> + * public final get + * public final set + * + * // field: p:Ljava/util/Calendar$Builder; + * // getter: getP()Ljava/util/Calendar$Builder; + * // setter: setP(Ljava/util/Calendar$Builder;)V + * public final lateinit var p: java/util/Calendar.Builder + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { public ABC a; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassWIthoutCorrection.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassWIthoutCorrection.fir.txt index 07198c11dd4..39e76e3cc39 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassWIthoutCorrection.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassWIthoutCorrection.fir.txt @@ -1,3 +1,17 @@ +/** + * package { + * + * public typealias Coocoo = error/NonExistentClass (* = error/NonExistentClass *) + * + * public typealias Coocoo2 = error/NonExistentClass (* = error/NonExistentClass *) + * + * public typealias Coocoo3 = error/NonExistentClass (* = error/NonExistentClass *) + * + * public typealias String2 = kotlin/String (* = kotlin/String *) + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) public final class NonExistentClassWIthoutCorrectionKt { @@ -6,6 +20,83 @@ public final class NonExistentClassWIthoutCorrectionKt { //////////////////// +/** + * public final object NonExistentType : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // signature: a(Lerror/NonExistentClass;Ljava/lang/String;)Lerror/NonExistentClass; + * public final fun a(a: error/NonExistentClass, s: kotlin/String): error/NonExistentClass + * + * // signature: b(Ljava/lang/String;)Lerror/NonExistentClass; + * public final fun b(s: kotlin/String): error/NonExistentClass + * + * // field: a:Lerror/NonExistentClass; + * // getter: getA()Lerror/NonExistentClass; + * public final val a: error/NonExistentClass + * public final get + * + * // field: b:Ljava/util/List; + * // getter: getB()Ljava/util/List; + * public final val b: kotlin/collections/List? + * public final get + * + * // field: c:Lkotlin/jvm/functions/Function1; + * // getter: getC()Lkotlin/jvm/functions/Function1; + * public final val c: kotlin/Function1 + * public final get + * + * // field: coocoo:Lerror/NonExistentClass; + * // getter: getCoocoo()Lerror/NonExistentClass; + * // setter: setCoocoo(Lerror/NonExistentClass;)V + * public final lateinit var coocoo: error/NonExistentClass (* = Coocoo^ *) + * public final get + * public final set + * + * // field: coocoo2:Lerror/NonExistentClass; + * // getter: getCoocoo2()Lerror/NonExistentClass; + * // setter: setCoocoo2(Lerror/NonExistentClass;)V + * public final lateinit var coocoo2: error/NonExistentClass (* = Coocoo2^ *) + * public final get + * public final set + * + * // field: coocoo21:Lerror/NonExistentClass; + * // getter: getCoocoo21()Lerror/NonExistentClass; + * // setter: setCoocoo21(Lerror/NonExistentClass;)V + * public final lateinit var coocoo21: error/NonExistentClass (* = Coocoo2^ *) + * public final get + * public final set + * + * // field: coocoo3:Lerror/NonExistentClass; + * // getter: getCoocoo3()Lerror/NonExistentClass; + * // setter: setCoocoo3(Lerror/NonExistentClass;)V + * public final lateinit var coocoo3: error/NonExistentClass (* = Coocoo3^ *) + * public final get + * public final set + * + * // field: coocoo31:Lerror/NonExistentClass; + * // getter: getCoocoo31()Lerror/NonExistentClass; + * // setter: setCoocoo31(Lerror/NonExistentClass;)V + * public final lateinit var coocoo31: error/NonExistentClass (* = Coocoo3^ *)> *) + * public final get + * public final set + * + * // field: d:Lerror/NonExistentClass; + * // getter: getD()Lerror/NonExistentClass; + * public final val d: error/NonExistentClass + * public final get + * + * // field: string2:Ljava/lang/String; + * // getter: getString2()Ljava/lang/String; + * // setter: setString2(Ljava/lang/String;)V + * public final lateinit var string2: kotlin/String (* = String2^ *) + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public final class NonExistentType { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassWIthoutCorrection.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassWIthoutCorrection.ir.txt index 9201bf3f8e2..936e159752b 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassWIthoutCorrection.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassWIthoutCorrection.ir.txt @@ -1,3 +1,17 @@ +/** + * package { + * + * public typealias Coocoo = error/NonExistentClass (* = error/NonExistentClass *) + * + * public typealias Coocoo2 = error/NonExistentClass (* = error/NonExistentClass *) + * + * public typealias Coocoo3 = error/NonExistentClass (* = error/NonExistentClass *) + * + * public typealias String2 = kotlin/String (* = kotlin/String *) + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) public final class NonExistentClassWIthoutCorrectionKt { @@ -6,6 +20,83 @@ public final class NonExistentClassWIthoutCorrectionKt { //////////////////// +/** + * public final object NonExistentType : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // signature: a(Lerror/NonExistentClass;Ljava/lang/String;)Lerror/NonExistentClass; + * public final fun a(a: error/NonExistentClass, s: kotlin/String): error/NonExistentClass + * + * // signature: b(Ljava/lang/String;)Lerror/NonExistentClass; + * public final fun b(s: kotlin/String): error/NonExistentClass + * + * // field: a:Lerror/NonExistentClass; + * // getter: getA()Lerror/NonExistentClass; + * public final val a: error/NonExistentClass + * public final get + * + * // field: b:Ljava/util/List; + * // getter: getB()Ljava/util/List; + * public final val b: kotlin/collections/List? + * public final get + * + * // field: c:Lkotlin/jvm/functions/Function1; + * // getter: getC()Lkotlin/jvm/functions/Function1; + * public final val c: kotlin/Function1 + * public final get + * + * // field: coocoo:Lerror/NonExistentClass; + * // getter: getCoocoo()Lerror/NonExistentClass; + * // setter: setCoocoo(Lerror/NonExistentClass;)V + * public final lateinit var coocoo: error/NonExistentClass + * public final get + * public final set + * + * // field: coocoo2:Lerror/NonExistentClass; + * // getter: getCoocoo2()Lerror/NonExistentClass; + * // setter: setCoocoo2(Lerror/NonExistentClass;)V + * public final lateinit var coocoo2: error/NonExistentClass + * public final get + * public final set + * + * // field: coocoo21:Lerror/NonExistentClass; + * // getter: getCoocoo21()Lerror/NonExistentClass; + * // setter: setCoocoo21(Lerror/NonExistentClass;)V + * public final lateinit var coocoo21: error/NonExistentClass + * public final get + * public final set + * + * // field: coocoo3:Lerror/NonExistentClass; + * // getter: getCoocoo3()Lerror/NonExistentClass; + * // setter: setCoocoo3(Lerror/NonExistentClass;)V + * public final lateinit var coocoo3: error/NonExistentClass + * public final get + * public final set + * + * // field: coocoo31:Lerror/NonExistentClass; + * // getter: getCoocoo31()Lerror/NonExistentClass; + * // setter: setCoocoo31(Lerror/NonExistentClass;)V + * public final lateinit var coocoo31: error/NonExistentClass + * public final get + * public final set + * + * // field: d:Lerror/NonExistentClass; + * // getter: getD()Lerror/NonExistentClass; + * public final val d: error/NonExistentClass + * public final get + * + * // field: string2:Ljava/lang/String; + * // getter: getString2()Ljava/lang/String; + * // setter: setString2(Ljava/lang/String;)V + * public final lateinit var string2: kotlin/String (* = String2^ *) + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public final class NonExistentType { @org.jetbrains.annotations.Nullable() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassWIthoutCorrection.txt b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassWIthoutCorrection.txt index 86935614147..d7360cee0df 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassWIthoutCorrection.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/nonExistentClassWIthoutCorrection.txt @@ -1,3 +1,17 @@ +/** + * package { + * + * public typealias Coocoo = error/NonExistentClass (* = error/NonExistentClass *) + * + * public typealias Coocoo2 = error/NonExistentClass (* = error/NonExistentClass *) + * + * public typealias Coocoo3 = error/NonExistentClass (* = error/NonExistentClass *) + * + * public typealias String2 = kotlin/String (* = kotlin/String *) + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) public final class NonExistentClassWIthoutCorrectionKt { @@ -6,6 +20,83 @@ public final class NonExistentClassWIthoutCorrectionKt { //////////////////// +/** + * public final object NonExistentType : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // signature: a(Lerror/NonExistentClass;Ljava/lang/String;)Lerror/NonExistentClass; + * public final fun a(a: error/NonExistentClass, s: kotlin/String): error/NonExistentClass + * + * // signature: b(Ljava/lang/String;)Lerror/NonExistentClass; + * public final fun b(s: kotlin/String): error/NonExistentClass + * + * // field: a:Lerror/NonExistentClass; + * // getter: getA()Lerror/NonExistentClass; + * public final val a: error/NonExistentClass + * public final get + * + * // field: b:Ljava/util/List; + * // getter: getB()Ljava/util/List; + * public final val b: kotlin/collections/List? + * public final get + * + * // field: c:Lkotlin/jvm/functions/Function1; + * // getter: getC()Lkotlin/jvm/functions/Function1; + * public final val c: kotlin/Function1 + * public final get + * + * // field: coocoo:Lerror/NonExistentClass; + * // getter: getCoocoo()Lerror/NonExistentClass; + * // setter: setCoocoo(Lerror/NonExistentClass;)V + * public final lateinit var coocoo: error/NonExistentClass + * public final get + * public final set + * + * // field: coocoo2:Lerror/NonExistentClass; + * // getter: getCoocoo2()Lerror/NonExistentClass; + * // setter: setCoocoo2(Lerror/NonExistentClass;)V + * public final lateinit var coocoo2: error/NonExistentClass + * public final get + * public final set + * + * // field: coocoo21:Lerror/NonExistentClass; + * // getter: getCoocoo21()Lerror/NonExistentClass; + * // setter: setCoocoo21(Lerror/NonExistentClass;)V + * public final lateinit var coocoo21: error/NonExistentClass + * public final get + * public final set + * + * // field: coocoo3:Lerror/NonExistentClass; + * // getter: getCoocoo3()Lerror/NonExistentClass; + * // setter: setCoocoo3(Lerror/NonExistentClass;)V + * public final lateinit var coocoo3: error/NonExistentClass + * public final get + * public final set + * + * // field: coocoo31:Lerror/NonExistentClass; + * // getter: getCoocoo31()Lerror/NonExistentClass; + * // setter: setCoocoo31(Lerror/NonExistentClass;)V + * public final lateinit var coocoo31: error/NonExistentClass + * public final get + * public final set + * + * // field: d:Lerror/NonExistentClass; + * // getter: getD()Lerror/NonExistentClass; + * public final val d: error/NonExistentClass + * public final get + * + * // field: string2:Ljava/lang/String; + * // getter: getString2()Ljava/lang/String; + * // setter: setString2(Ljava/lang/String;)V + * public final lateinit var string2: kotlin/String (* = String2^ *) + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public final class NonExistentType { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/primitiveTypes.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/primitiveTypes.fir.txt index 8a81236442c..9c9d57ee9fd 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/primitiveTypes.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/primitiveTypes.fir.txt @@ -1,3 +1,144 @@ +/** + * public final object PrimitiveTypes : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // field: booleanFalse:Z + * public final const val booleanFalse: kotlin/Boolean (* = ... *) + * public final get + * + * // field: booleanTrue:Z + * public final const val booleanTrue: kotlin/Boolean (* = ... *) + * public final get + * + * // field: byte0:B + * public final const val byte0: kotlin/Byte (* = ... *) + * public final get + * + * // field: byte50:B + * public final const val byte50: kotlin/Byte (* = ... *) + * public final get + * + * // field: char0:C + * public final const val char0: kotlin/Char (* = ... *) + * public final get + * + * // field: char10:C + * public final const val char10: kotlin/Char (* = ... *) + * public final get + * + * // field: char13:C + * public final const val char13: kotlin/Char (* = ... *) + * public final get + * + * // field: charC:C + * public final const val charC: kotlin/Char (* = ... *) + * public final get + * + * // field: double54:D + * public final const val double54: kotlin/Double (* = ... *) + * public final get + * + * // field: float54:F + * public final const val float54: kotlin/Float (* = ... *) + * public final get + * + * // field: doubleMaxValue:D + * // getter: getDoubleMaxValue()D + * public final val doubleMaxValue: kotlin/Double (* = ... *) + * public final get + * + * // field: doubleNan:D + * // getter: getDoubleNan()D + * public final val doubleNan: kotlin/Double (* = ... *) + * public final get + * + * // field: doubleNegativeInfinity:D + * // getter: getDoubleNegativeInfinity()D + * public final val doubleNegativeInfinity: kotlin/Double (* = ... *) + * public final get + * + * // field: doublePositiveInfinity:D + * // getter: getDoublePositiveInfinity()D + * public final val doublePositiveInfinity: kotlin/Double (* = ... *) + * public final get + * + * // field: floatMaxValue:F + * // getter: getFloatMaxValue()F + * public final val floatMaxValue: kotlin/Float (* = ... *) + * public final get + * + * // field: floatNan:F + * // getter: getFloatNan()F + * public final val floatNan: kotlin/Float (* = ... *) + * public final get + * + * // field: floatNegativeInfinity:F + * // getter: getFloatNegativeInfinity()F + * public final val floatNegativeInfinity: kotlin/Float (* = ... *) + * public final get + * + * // field: floatPositiveInfinity:F + * // getter: getFloatPositiveInfinity()F + * public final val floatPositiveInfinity: kotlin/Float (* = ... *) + * public final get + * + * // field: int0:I + * public final const val int0: kotlin/Int (* = ... *) + * public final get + * + * // field: intHex:I + * public final const val intHex: kotlin/Int (* = ... *) + * public final get + * + * // field: intMaxValue:I + * public final const val intMaxValue: kotlin/Int (* = ... *) + * public final get + * + * // field: intMinValue:I + * public final const val intMinValue: kotlin/Int (* = ... *) + * public final get + * + * // field: intMinus1000:I + * public final const val intMinus1000: kotlin/Int (* = ... *) + * public final get + * + * // field: long0:J + * public final const val long0: kotlin/Long (* = ... *) + * public final get + * + * // field: longHex:J + * public final const val longHex: kotlin/Long (* = ... *) + * public final get + * + * // field: longMaxValue:J + * public final const val longMaxValue: kotlin/Long (* = ... *) + * public final get + * + * // field: longMinValue:J + * public final const val longMinValue: kotlin/Long (* = ... *) + * public final get + * + * // field: short5:S + * public final const val short5: kotlin/Short (* = ... *) + * public final get + * + * // field: stringHelloWorld:Ljava/lang/String; + * public final const val stringHelloWorld: kotlin/String (* = ... *) + * public final get + * + * // field: stringQuotes:Ljava/lang/String; + * public final const val stringQuotes: kotlin/String (* = ... *) + * public final get + * + * // field: stringRN:Ljava/lang/String; + * public final const val stringRN: kotlin/String (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class PrimitiveTypes { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/primitiveTypes.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/primitiveTypes.ir.txt index 8298f0feb06..c6e16f79a54 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/primitiveTypes.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/primitiveTypes.ir.txt @@ -1,3 +1,144 @@ +/** + * public final object PrimitiveTypes : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // field: booleanFalse:Z + * public final const val booleanFalse: kotlin/Boolean (* = ... *) + * public final get + * + * // field: booleanTrue:Z + * public final const val booleanTrue: kotlin/Boolean (* = ... *) + * public final get + * + * // field: byte0:B + * public final const val byte0: kotlin/Byte (* = ... *) + * public final get + * + * // field: byte50:B + * public final const val byte50: kotlin/Byte (* = ... *) + * public final get + * + * // field: char0:C + * public final const val char0: kotlin/Char (* = ... *) + * public final get + * + * // field: char10:C + * public final const val char10: kotlin/Char (* = ... *) + * public final get + * + * // field: char13:C + * public final const val char13: kotlin/Char (* = ... *) + * public final get + * + * // field: charC:C + * public final const val charC: kotlin/Char (* = ... *) + * public final get + * + * // field: double54:D + * public final const val double54: kotlin/Double (* = ... *) + * public final get + * + * // field: float54:F + * public final const val float54: kotlin/Float (* = ... *) + * public final get + * + * // field: doubleMaxValue:D + * // getter: getDoubleMaxValue()D + * public final val doubleMaxValue: kotlin/Double (* = ... *) + * public final get + * + * // field: doubleNan:D + * // getter: getDoubleNan()D + * public final val doubleNan: kotlin/Double (* = ... *) + * public final get + * + * // field: doubleNegativeInfinity:D + * // getter: getDoubleNegativeInfinity()D + * public final val doubleNegativeInfinity: kotlin/Double (* = ... *) + * public final get + * + * // field: doublePositiveInfinity:D + * // getter: getDoublePositiveInfinity()D + * public final val doublePositiveInfinity: kotlin/Double (* = ... *) + * public final get + * + * // field: floatMaxValue:F + * // getter: getFloatMaxValue()F + * public final val floatMaxValue: kotlin/Float (* = ... *) + * public final get + * + * // field: floatNan:F + * // getter: getFloatNan()F + * public final val floatNan: kotlin/Float (* = ... *) + * public final get + * + * // field: floatNegativeInfinity:F + * // getter: getFloatNegativeInfinity()F + * public final val floatNegativeInfinity: kotlin/Float (* = ... *) + * public final get + * + * // field: floatPositiveInfinity:F + * // getter: getFloatPositiveInfinity()F + * public final val floatPositiveInfinity: kotlin/Float (* = ... *) + * public final get + * + * // field: int0:I + * public final const val int0: kotlin/Int (* = ... *) + * public final get + * + * // field: intHex:I + * public final const val intHex: kotlin/Int (* = ... *) + * public final get + * + * // field: intMaxValue:I + * public final const val intMaxValue: kotlin/Int (* = ... *) + * public final get + * + * // field: intMinValue:I + * public final const val intMinValue: kotlin/Int (* = ... *) + * public final get + * + * // field: intMinus1000:I + * public final const val intMinus1000: kotlin/Int (* = ... *) + * public final get + * + * // field: long0:J + * public final const val long0: kotlin/Long (* = ... *) + * public final get + * + * // field: longHex:J + * public final const val longHex: kotlin/Long (* = ... *) + * public final get + * + * // field: longMaxValue:J + * public final const val longMaxValue: kotlin/Long (* = ... *) + * public final get + * + * // field: longMinValue:J + * public final const val longMinValue: kotlin/Long (* = ... *) + * public final get + * + * // field: short5:S + * public final const val short5: kotlin/Short (* = ... *) + * public final get + * + * // field: stringHelloWorld:Ljava/lang/String; + * public final const val stringHelloWorld: kotlin/String (* = ... *) + * public final get + * + * // field: stringQuotes:Ljava/lang/String; + * public final const val stringQuotes: kotlin/String (* = ... *) + * public final get + * + * // field: stringRN:Ljava/lang/String; + * public final const val stringRN: kotlin/String (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class PrimitiveTypes { public static final boolean booleanFalse = false; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/primitiveTypes.txt b/plugins/kapt3/kapt3-compiler/testData/converter/primitiveTypes.txt index 8a81236442c..9c9d57ee9fd 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/primitiveTypes.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/primitiveTypes.txt @@ -1,3 +1,144 @@ +/** + * public final object PrimitiveTypes : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // field: booleanFalse:Z + * public final const val booleanFalse: kotlin/Boolean (* = ... *) + * public final get + * + * // field: booleanTrue:Z + * public final const val booleanTrue: kotlin/Boolean (* = ... *) + * public final get + * + * // field: byte0:B + * public final const val byte0: kotlin/Byte (* = ... *) + * public final get + * + * // field: byte50:B + * public final const val byte50: kotlin/Byte (* = ... *) + * public final get + * + * // field: char0:C + * public final const val char0: kotlin/Char (* = ... *) + * public final get + * + * // field: char10:C + * public final const val char10: kotlin/Char (* = ... *) + * public final get + * + * // field: char13:C + * public final const val char13: kotlin/Char (* = ... *) + * public final get + * + * // field: charC:C + * public final const val charC: kotlin/Char (* = ... *) + * public final get + * + * // field: double54:D + * public final const val double54: kotlin/Double (* = ... *) + * public final get + * + * // field: float54:F + * public final const val float54: kotlin/Float (* = ... *) + * public final get + * + * // field: doubleMaxValue:D + * // getter: getDoubleMaxValue()D + * public final val doubleMaxValue: kotlin/Double (* = ... *) + * public final get + * + * // field: doubleNan:D + * // getter: getDoubleNan()D + * public final val doubleNan: kotlin/Double (* = ... *) + * public final get + * + * // field: doubleNegativeInfinity:D + * // getter: getDoubleNegativeInfinity()D + * public final val doubleNegativeInfinity: kotlin/Double (* = ... *) + * public final get + * + * // field: doublePositiveInfinity:D + * // getter: getDoublePositiveInfinity()D + * public final val doublePositiveInfinity: kotlin/Double (* = ... *) + * public final get + * + * // field: floatMaxValue:F + * // getter: getFloatMaxValue()F + * public final val floatMaxValue: kotlin/Float (* = ... *) + * public final get + * + * // field: floatNan:F + * // getter: getFloatNan()F + * public final val floatNan: kotlin/Float (* = ... *) + * public final get + * + * // field: floatNegativeInfinity:F + * // getter: getFloatNegativeInfinity()F + * public final val floatNegativeInfinity: kotlin/Float (* = ... *) + * public final get + * + * // field: floatPositiveInfinity:F + * // getter: getFloatPositiveInfinity()F + * public final val floatPositiveInfinity: kotlin/Float (* = ... *) + * public final get + * + * // field: int0:I + * public final const val int0: kotlin/Int (* = ... *) + * public final get + * + * // field: intHex:I + * public final const val intHex: kotlin/Int (* = ... *) + * public final get + * + * // field: intMaxValue:I + * public final const val intMaxValue: kotlin/Int (* = ... *) + * public final get + * + * // field: intMinValue:I + * public final const val intMinValue: kotlin/Int (* = ... *) + * public final get + * + * // field: intMinus1000:I + * public final const val intMinus1000: kotlin/Int (* = ... *) + * public final get + * + * // field: long0:J + * public final const val long0: kotlin/Long (* = ... *) + * public final get + * + * // field: longHex:J + * public final const val longHex: kotlin/Long (* = ... *) + * public final get + * + * // field: longMaxValue:J + * public final const val longMaxValue: kotlin/Long (* = ... *) + * public final get + * + * // field: longMinValue:J + * public final const val longMinValue: kotlin/Long (* = ... *) + * public final get + * + * // field: short5:S + * public final const val short5: kotlin/Short (* = ... *) + * public final get + * + * // field: stringHelloWorld:Ljava/lang/String; + * public final const val stringHelloWorld: kotlin/String (* = ... *) + * public final get + * + * // field: stringQuotes:Ljava/lang/String; + * public final const val stringQuotes: kotlin/String (* = ... *) + * public final get + * + * // field: stringRN:Ljava/lang/String; + * public final const val stringRN: kotlin/String (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class PrimitiveTypes { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/properties.kt b/plugins/kapt3/kapt3-compiler/testData/converter/properties.kt index e5b5336a681..50da27a6c01 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/properties.kt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/properties.kt @@ -1,3 +1,6 @@ +// STRIP_METADATA +// TODO: Re-enable metadata generation + class Test { val simple: String = "123" diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/properties.txt b/plugins/kapt3/kapt3-compiler/testData/converter/properties.txt index 1d2c329aa30..7051aff1a9e 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/properties.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/properties.txt @@ -1,4 +1,3 @@ -@kotlin.Metadata() public final class Test { @org.jetbrains.annotations.NotNull() private final java.lang.String simple = "123"; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/propertyAnnotations.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/propertyAnnotations.fir.txt index ee706804dfa..b242cdafbc9 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/propertyAnnotations.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/propertyAnnotations.fir.txt @@ -1,3 +1,12 @@ +/** + * public final annotation class Anno : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface Anno { @@ -6,6 +15,15 @@ public abstract @interface Anno { //////////////////// +/** + * public final annotation class Anno2 : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.PROPERTY, kotlin.annotation.AnnotationTarget.CLASS}) @java.lang.annotation.Target(value = {java.lang.annotation.ElementType.TYPE}) @@ -16,6 +34,21 @@ public abstract @interface Anno2 { //////////////////// +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: prop:Ljava/lang/String; + * // getter: getProp()Ljava/lang/String; + * // synthetic method for annotations: getProp$annotations()V + * public final val prop: kotlin/String (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/propertyAnnotations.txt b/plugins/kapt3/kapt3-compiler/testData/converter/propertyAnnotations.txt index cb06aec8540..eedc2f8035e 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/propertyAnnotations.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/propertyAnnotations.txt @@ -1,4 +1,13 @@ @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class Anno : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno { } @@ -9,6 +18,15 @@ public abstract @interface Anno { @kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.PROPERTY, kotlin.annotation.AnnotationTarget.CLASS}) @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(value = {java.lang.annotation.ElementType.TYPE}) +/** + * public final annotation class Anno2 : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno2 { } @@ -16,6 +34,21 @@ public abstract @interface Anno2 { //////////////////// +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: prop:Ljava/lang/String; + * // getter: getProp()Ljava/lang/String; + * // synthetic method for annotations: getProp$annotations()V + * public final val prop: kotlin/String (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/recentlyNullable.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/recentlyNullable.fir.txt index 95a75bd4ed8..0169b1ea605 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/recentlyNullable.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/recentlyNullable.fir.txt @@ -21,6 +21,23 @@ import java.lang.annotation.*; package app; +/** + * public final class app/KBox : androidx/annotation/Box { + * + * // signature: (Landroidx/annotation/Box;)V + * public constructor(delegate: androidx/annotation/Box) + * + * // signature: foo()Ljava/lang/String; + * public open (* delegation *) fun foo(): kotlin/String! + * + * // field: delegate:Landroidx/annotation/Box; + * // getter: getDelegate()Landroidx/annotation/Box; + * public final val delegate: androidx/annotation/Box + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class KBox implements androidx.annotation.Box { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/recentlyNullable.txt b/plugins/kapt3/kapt3-compiler/testData/converter/recentlyNullable.txt index 455cb3dd652..5cc21c7effa 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/recentlyNullable.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/recentlyNullable.txt @@ -21,6 +21,23 @@ import java.lang.annotation.*; package app; +/** + * public final class app/KBox : androidx/annotation/Box { + * + * // signature: (Landroidx/annotation/Box;)V + * public constructor(delegate: androidx/annotation/Box) + * + * // signature: foo()Ljava/lang/String; + * public open (* delegation *) fun foo(): kotlin/String! + * + * // field: delegate:Landroidx/annotation/Box; + * // getter: getDelegate()Landroidx/annotation/Box; + * public final val delegate: androidx/annotation/Box + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class KBox implements androidx.annotation.Box { @org.jetbrains.annotations.NotNull() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/repeatableAnnotations.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/repeatableAnnotations.fir.txt index 5c187203029..aa7a69d0298 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/repeatableAnnotations.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/repeatableAnnotations.fir.txt @@ -1,3 +1,20 @@ +/** + * public final annotation class AnnoArray : kotlin/Annotation { + * + * // signature: (ILkotlin/Array;)V + * public constructor(x: kotlin/Int, a: kotlin/Array) + * + * // getter: a()[Ljava/lang/String; + * public final val a: kotlin/Array + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface AnnoArray { @@ -10,6 +27,23 @@ public abstract @interface AnnoArray { //////////////////// +/** + * public final annotation class AnnoBoolean : kotlin/Annotation { + * + * // signature: (IZ)V + * public constructor(x: kotlin/Int, bool: kotlin/Boolean) + * + * // getter: bool()Z + * public final val bool: kotlin/Boolean + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface AnnoBoolean { @@ -22,6 +56,23 @@ public abstract @interface AnnoBoolean { //////////////////// +/** + * public final annotation class AnnoChar : kotlin/Annotation { + * + * // signature: (IC)V + * public constructor(x: kotlin/Int, chr: kotlin/Char) + * + * // getter: chr()C + * public final val chr: kotlin/Char + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface AnnoChar { @@ -34,6 +85,23 @@ public abstract @interface AnnoChar { //////////////////// +/** + * public final annotation class AnnoClass : kotlin/Annotation { + * + * // signature: (ILkotlin/reflect/KClass;)V + * public constructor(x: kotlin/Int, c: kotlin/reflect/KClass) + * + * // getter: c()Ljava/lang/Class; + * public final val c: kotlin/reflect/KClass + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface AnnoClass { @@ -46,6 +114,23 @@ public abstract @interface AnnoClass { //////////////////// +/** + * public final annotation class AnnoDouble : kotlin/Annotation { + * + * // signature: (ID)V + * public constructor(x: kotlin/Int, dbl: kotlin/Double) + * + * // getter: dbl()D + * public final val dbl: kotlin/Double + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface AnnoDouble { @@ -58,6 +143,23 @@ public abstract @interface AnnoDouble { //////////////////// +/** + * public final annotation class AnnoEnum : kotlin/Annotation { + * + * // signature: (ILColor;)V + * public constructor(x: kotlin/Int, c: Color) + * + * // getter: c()LColor; + * public final val c: Color + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface AnnoEnum { @@ -70,6 +172,23 @@ public abstract @interface AnnoEnum { //////////////////// +/** + * public final annotation class AnnoFloat : kotlin/Annotation { + * + * // signature: (IF)V + * public constructor(x: kotlin/Int, flt: kotlin/Float) + * + * // getter: flt()F + * public final val flt: kotlin/Float + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface AnnoFloat { @@ -82,6 +201,23 @@ public abstract @interface AnnoFloat { //////////////////// +/** + * public final annotation class AnnoInt : kotlin/Annotation { + * + * // signature: (II)V + * public constructor(x: kotlin/Int, i: kotlin/Int) + * + * // getter: i()I + * public final val i: kotlin/Int + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface AnnoInt { @@ -94,6 +230,23 @@ public abstract @interface AnnoInt { //////////////////// +/** + * public final annotation class AnnoIntArray : kotlin/Annotation { + * + * // signature: (I[I)V + * public constructor(x: kotlin/Int, b: kotlin/IntArray) + * + * // getter: b()[I + * public final val b: kotlin/IntArray + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface AnnoIntArray { @@ -106,6 +259,23 @@ public abstract @interface AnnoIntArray { //////////////////// +/** + * public final annotation class AnnoLong : kotlin/Annotation { + * + * // signature: (IJ)V + * public constructor(x: kotlin/Int, l: kotlin/Long) + * + * // getter: l()J + * public final val l: kotlin/Long + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface AnnoLong { @@ -118,6 +288,23 @@ public abstract @interface AnnoLong { //////////////////// +/** + * public final annotation class AnnoLongArray : kotlin/Annotation { + * + * // signature: (I[J)V + * public constructor(x: kotlin/Int, b: kotlin/LongArray) + * + * // getter: b()[J + * public final val b: kotlin/LongArray + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface AnnoLongArray { @@ -130,6 +317,23 @@ public abstract @interface AnnoLongArray { //////////////////// +/** + * public final annotation class AnnoString : kotlin/Annotation { + * + * // signature: (ILjava/lang/String;)V + * public constructor(x: kotlin/Int, s: kotlin/String) + * + * // getter: s()Ljava/lang/String; + * public final val s: kotlin/String + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface AnnoString { @@ -142,6 +346,19 @@ public abstract @interface AnnoString { //////////////////// +/** + * public final enum class Color : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * BLACK, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Color { /*public static final*/ BLACK /* = new Color() */; @@ -158,6 +375,21 @@ public enum Color { //////////////////// +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: value:Ljava/lang/String; + * // getter: getValue()Ljava/lang/String; + * // synthetic method for annotations: getValue$annotations()V + * public final val value: kotlin/String (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { @org.jetbrains.annotations.NotNull() @@ -183,6 +415,15 @@ public final class Test { //////////////////// +/** + * public final class Test2 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @AnnoChar(x = 100, chr = 'c') @AnnoBoolean(x = 100, bool = false) diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/repeatableAnnotations.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/repeatableAnnotations.ir.txt index c35f80de679..33440881235 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/repeatableAnnotations.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/repeatableAnnotations.ir.txt @@ -1,4 +1,21 @@ @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoArray : kotlin/Annotation { + * + * // signature: (ILkotlin/Array;)V + * public constructor(x: kotlin/Int, a: kotlin/Array) + * + * // getter: a()[Ljava/lang/String; + * public final val a: kotlin/Array + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoArray { @@ -11,6 +28,23 @@ public abstract @interface AnnoArray { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoBoolean : kotlin/Annotation { + * + * // signature: (IZ)V + * public constructor(x: kotlin/Int, bool: kotlin/Boolean) + * + * // getter: bool()Z + * public final val bool: kotlin/Boolean + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoBoolean { @@ -23,6 +57,23 @@ public abstract @interface AnnoBoolean { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoChar : kotlin/Annotation { + * + * // signature: (IC)V + * public constructor(x: kotlin/Int, chr: kotlin/Char) + * + * // getter: chr()C + * public final val chr: kotlin/Char + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoChar { @@ -35,6 +86,23 @@ public abstract @interface AnnoChar { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoClass : kotlin/Annotation { + * + * // signature: (ILkotlin/reflect/KClass;)V + * public constructor(x: kotlin/Int, c: kotlin/reflect/KClass) + * + * // getter: c()Ljava/lang/Class; + * public final val c: kotlin/reflect/KClass + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoClass { @@ -47,6 +115,23 @@ public abstract @interface AnnoClass { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoDouble : kotlin/Annotation { + * + * // signature: (ID)V + * public constructor(x: kotlin/Int, dbl: kotlin/Double) + * + * // getter: dbl()D + * public final val dbl: kotlin/Double + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoDouble { @@ -59,6 +144,23 @@ public abstract @interface AnnoDouble { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoEnum : kotlin/Annotation { + * + * // signature: (ILColor;)V + * public constructor(x: kotlin/Int, c: Color) + * + * // getter: c()LColor; + * public final val c: Color + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoEnum { @@ -71,6 +173,23 @@ public abstract @interface AnnoEnum { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoFloat : kotlin/Annotation { + * + * // signature: (IF)V + * public constructor(x: kotlin/Int, flt: kotlin/Float) + * + * // getter: flt()F + * public final val flt: kotlin/Float + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoFloat { @@ -83,6 +202,23 @@ public abstract @interface AnnoFloat { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoInt : kotlin/Annotation { + * + * // signature: (II)V + * public constructor(x: kotlin/Int, i: kotlin/Int) + * + * // getter: i()I + * public final val i: kotlin/Int + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoInt { @@ -95,6 +231,23 @@ public abstract @interface AnnoInt { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoIntArray : kotlin/Annotation { + * + * // signature: (I[I)V + * public constructor(x: kotlin/Int, b: kotlin/IntArray) + * + * // getter: b()[I + * public final val b: kotlin/IntArray + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoIntArray { @@ -107,6 +260,23 @@ public abstract @interface AnnoIntArray { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoLong : kotlin/Annotation { + * + * // signature: (IJ)V + * public constructor(x: kotlin/Int, l: kotlin/Long) + * + * // getter: l()J + * public final val l: kotlin/Long + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoLong { @@ -119,6 +289,23 @@ public abstract @interface AnnoLong { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoLongArray : kotlin/Annotation { + * + * // signature: (I[J)V + * public constructor(x: kotlin/Int, b: kotlin/LongArray) + * + * // getter: b()[J + * public final val b: kotlin/LongArray + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoLongArray { @@ -131,6 +318,23 @@ public abstract @interface AnnoLongArray { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoString : kotlin/Annotation { + * + * // signature: (ILjava/lang/String;)V + * public constructor(x: kotlin/Int, s: kotlin/String) + * + * // getter: s()Ljava/lang/String; + * public final val s: kotlin/String + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoString { @@ -142,6 +346,19 @@ public abstract @interface AnnoString { //////////////////// +/** + * public final enum class Color : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * BLACK, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Color { /*public static final*/ BLACK /* = new Color() */; @@ -158,6 +375,21 @@ public enum Color { //////////////////// +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: value:Ljava/lang/String; + * // getter: getValue()Ljava/lang/String; + * // synthetic method for annotations: getValue$annotations()V + * public final val value: kotlin/String (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { @org.jetbrains.annotations.NotNull() @@ -193,6 +425,15 @@ public final class Test { @AnnoLongArray(x = lib.R.id.textView, b = {1L, 3L}) @AnnoArray(x = lib.R.id.textView, a = {"A", "B"}) @AnnoClass(x = lib.R.id.textView, c = Color.class) +/** + * public final class Test2 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test2 { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/repeatableAnnotations.txt b/plugins/kapt3/kapt3-compiler/testData/converter/repeatableAnnotations.txt index 5b93e0a3410..34029db5039 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/repeatableAnnotations.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/repeatableAnnotations.txt @@ -1,4 +1,21 @@ @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoArray : kotlin/Annotation { + * + * // signature: (ILkotlin/Array;)V + * public constructor(x: kotlin/Int, a: kotlin/Array) + * + * // getter: a()[Ljava/lang/String; + * public final val a: kotlin/Array + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoArray { @@ -11,6 +28,23 @@ public abstract @interface AnnoArray { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoBoolean : kotlin/Annotation { + * + * // signature: (IZ)V + * public constructor(x: kotlin/Int, bool: kotlin/Boolean) + * + * // getter: bool()Z + * public final val bool: kotlin/Boolean + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoBoolean { @@ -23,6 +57,23 @@ public abstract @interface AnnoBoolean { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoChar : kotlin/Annotation { + * + * // signature: (IC)V + * public constructor(x: kotlin/Int, chr: kotlin/Char) + * + * // getter: chr()C + * public final val chr: kotlin/Char + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoChar { @@ -35,6 +86,23 @@ public abstract @interface AnnoChar { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoClass : kotlin/Annotation { + * + * // signature: (ILkotlin/reflect/KClass;)V + * public constructor(x: kotlin/Int, c: kotlin/reflect/KClass) + * + * // getter: c()Ljava/lang/Class; + * public final val c: kotlin/reflect/KClass + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoClass { @@ -47,6 +115,23 @@ public abstract @interface AnnoClass { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoDouble : kotlin/Annotation { + * + * // signature: (ID)V + * public constructor(x: kotlin/Int, dbl: kotlin/Double) + * + * // getter: dbl()D + * public final val dbl: kotlin/Double + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoDouble { @@ -59,6 +144,23 @@ public abstract @interface AnnoDouble { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoEnum : kotlin/Annotation { + * + * // signature: (ILColor;)V + * public constructor(x: kotlin/Int, c: Color) + * + * // getter: c()LColor; + * public final val c: Color + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoEnum { @@ -71,6 +173,23 @@ public abstract @interface AnnoEnum { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoFloat : kotlin/Annotation { + * + * // signature: (IF)V + * public constructor(x: kotlin/Int, flt: kotlin/Float) + * + * // getter: flt()F + * public final val flt: kotlin/Float + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoFloat { @@ -83,6 +202,23 @@ public abstract @interface AnnoFloat { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoInt : kotlin/Annotation { + * + * // signature: (II)V + * public constructor(x: kotlin/Int, i: kotlin/Int) + * + * // getter: i()I + * public final val i: kotlin/Int + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoInt { @@ -95,6 +231,23 @@ public abstract @interface AnnoInt { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoIntArray : kotlin/Annotation { + * + * // signature: (I[I)V + * public constructor(x: kotlin/Int, b: kotlin/IntArray) + * + * // getter: b()[I + * public final val b: kotlin/IntArray + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoIntArray { @@ -107,6 +260,23 @@ public abstract @interface AnnoIntArray { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoLong : kotlin/Annotation { + * + * // signature: (IJ)V + * public constructor(x: kotlin/Int, l: kotlin/Long) + * + * // getter: l()J + * public final val l: kotlin/Long + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoLong { @@ -119,6 +289,23 @@ public abstract @interface AnnoLong { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoLongArray : kotlin/Annotation { + * + * // signature: (I[J)V + * public constructor(x: kotlin/Int, b: kotlin/LongArray) + * + * // getter: b()[J + * public final val b: kotlin/LongArray + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoLongArray { @@ -131,6 +318,23 @@ public abstract @interface AnnoLongArray { @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class AnnoString : kotlin/Annotation { + * + * // signature: (ILjava/lang/String;)V + * public constructor(x: kotlin/Int, s: kotlin/String) + * + * // getter: s()Ljava/lang/String; + * public final val s: kotlin/String + * public final get + * + * // getter: x()I + * public final val x: kotlin/Int + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface AnnoString { @@ -142,6 +346,19 @@ public abstract @interface AnnoString { //////////////////// +/** + * public final enum class Color : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * BLACK, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum Color { /*public static final*/ BLACK /* = new Color() */; @@ -153,6 +370,21 @@ public enum Color { //////////////////// +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: value:Ljava/lang/String; + * // getter: getValue()Ljava/lang/String; + * // synthetic method for annotations: getValue$annotations()V + * public final val value: kotlin/String (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { @org.jetbrains.annotations.NotNull() @@ -188,6 +420,15 @@ public final class Test { @AnnoLongArray(x = lib.R.id.textView, b = {1L, 3L}) @AnnoArray(x = lib.R.id.textView, a = {"A", "B"}) @AnnoClass(x = lib.R.id.textView, c = Color.class) +/** + * public final class Test2 : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test2 { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/secondaryConstructor.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/secondaryConstructor.fir.txt index 828b1df4c28..a3a7a345f96 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/secondaryConstructor.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/secondaryConstructor.fir.txt @@ -1,5 +1,15 @@ package secondary; +/** + * public abstract interface secondary/Named : kotlin/Any { + * + * // getter: getName()Ljava/lang/String; + * public abstract val name: kotlin/String? + * public abstract get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Named { @@ -11,6 +21,22 @@ public abstract interface Named { package secondary; +/** + * public final class secondary/Product2 : secondary/Named { + * + * // signature: (Ljava/lang/String;)V + * public (* secondary *) constructor(otherName: kotlin/String) + * + * // field: name:Ljava/lang/String; + * // getter: getName()Ljava/lang/String; + * // setter: setName(Ljava/lang/String;)V + * public open var name: kotlin/String? + * public open get + * public open set + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Product2 implements secondary.Named { @org.jetbrains.annotations.Nullable() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/secondaryConstructor.txt b/plugins/kapt3/kapt3-compiler/testData/converter/secondaryConstructor.txt index 5731f7934a0..4ba5d209449 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/secondaryConstructor.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/secondaryConstructor.txt @@ -1,5 +1,15 @@ package secondary; +/** + * public abstract interface secondary/Named : kotlin/Any { + * + * // getter: getName()Ljava/lang/String; + * public abstract val name: kotlin/String? + * public abstract get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Named { @@ -11,6 +21,22 @@ public abstract interface Named { package secondary; +/** + * public final class secondary/Product2 : secondary/Named { + * + * // signature: (Ljava/lang/String;)V + * public (* secondary *) constructor(otherName: kotlin/String) + * + * // field: name:Ljava/lang/String; + * // getter: getName()Ljava/lang/String; + * // setter: setName(Ljava/lang/String;)V + * public open var name: kotlin/String? + * public open get + * public open set + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Product2 implements secondary.Named { @org.jetbrains.annotations.Nullable() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/severalPackageParts.txt b/plugins/kapt3/kapt3-compiler/testData/converter/severalPackageParts.txt index 34af72c4d62..36674875312 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/severalPackageParts.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/severalPackageParts.txt @@ -1,5 +1,14 @@ package test; +/** + * package { + * + * // signature: foo()V + * public final fun foo(): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public final class AKt { @@ -15,6 +24,15 @@ public final class AKt { package test; +/** + * package { + * + * // signature: bar()V + * public final fun bar(): kotlin/Unit + * + * // module name: main + * } + */ @kotlin.Metadata() public final class BKt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/starImports.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/starImports.fir.txt index 5472ee113b5..315e14563cc 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/starImports.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/starImports.fir.txt @@ -1,3 +1,16 @@ +/** + * package { + * + * // field: base64:Lkotlin/io/encoding/Base64; + * // getter: getBase64()Lkotlin/io/encoding/Base64; + * // setter: setBase64(Lkotlin/io/encoding/Base64;)V + * public final var base64: kotlin/io/encoding/Base64? + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public final class ResolvedKt { @@ -22,6 +35,19 @@ public final class ResolvedKt { import kotlin.io.encoding.*; +/** + * package { + * + * // field: base65:Lerror/NonExistentClass; + * // getter: getBase65()Lerror/NonExistentClass; + * // setter: setBase65(Lerror/NonExistentClass;)V + * public final var base65: error/NonExistentClass + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) public final class UnresolvedKt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/starImports.txt b/plugins/kapt3/kapt3-compiler/testData/converter/starImports.txt index 58d867c1778..a4e409ebe5c 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/starImports.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/starImports.txt @@ -1,5 +1,18 @@ import kotlin.io.encoding.*; +/** + * package { + * + * // field: base64:Lkotlin/io/encoding/Base64; + * // getter: getBase64()Lkotlin/io/encoding/Base64; + * // setter: setBase64(Lkotlin/io/encoding/Base64;)V + * public final var base64: kotlin/io/encoding/Base64? + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() public final class ResolvedKt { @@ -24,6 +37,19 @@ public final class ResolvedKt { import kotlin.io.encoding.*; +/** + * package { + * + * // field: base65:Lerror/NonExistentClass; + * // getter: getBase65()Lerror/NonExistentClass; + * // setter: setBase65(Lerror/NonExistentClass;)V + * public final var base65: error/NonExistentClass + * public final get + * public final set + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) public final class UnresolvedKt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/strangeIdentifiers.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/strangeIdentifiers.fir.txt index f15a7f6dbe4..296868a9a78 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/strangeIdentifiers.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/strangeIdentifiers.fir.txt @@ -1,3 +1,24 @@ +/** + * public final annotation class Anno : kotlin/Annotation { + * + * // signature: (LStrangeEnum;Ljava/lang/String;Ljava/lang/String;)V + * public constructor(size: StrangeEnum, name: kotlin/String, A B: kotlin/String) + * + * // getter: A B()Ljava/lang/String; + * public final val A B: kotlin/String + * public final get + * + * // getter: name()Ljava/lang/String; + * public final val name: kotlin/String + * public final get + * + * // getter: size()LStrangeEnum; + * public final val size: StrangeEnum + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface Anno { @@ -10,6 +31,30 @@ public abstract @interface Anno { //////////////////// +/** + * public final enum class StrangeEnum : kotlin/Enum { + * + * // signature: (Ljava/lang/String;ILjava/lang/String;)V + * private constructor(size: kotlin/String) + * + * // field: size:Ljava/lang/String; + * // getter: getSize()Ljava/lang/String; + * public final val size: kotlin/String + * public final get + * + * 60x60, + * + * 70x70, + * + * 80x80, + * + * InvalidFieldName, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum StrangeEnum { /*public static final*/ InvalidFieldName /* = new StrangeEnum() */; @@ -33,6 +78,39 @@ public enum StrangeEnum { //////////////////// +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: simpleFun()V + * public final fun simpleFun(): kotlin/Unit + * + * // signature: simpleFun2(Ljava/lang/String;Ljava/lang/String;)V + * public final fun simpleFun2(a: kotlin/String, b: kotlin/String): kotlin/Unit + * + * // signature: strange!Fun()V + * public final fun strange!Fun(): kotlin/Unit + * + * // signature: strangeFun4(Ljava/lang/String;Ljava/lang/String;)V + * public final fun strangeFun4(a: kotlin/String, A()B(): kotlin/String): kotlin/Unit + * + * // field: simpleName:Ljava/lang/String; + * // getter: getSimpleName()Ljava/lang/String; + * public final lateinit val simpleName: kotlin/String + * public final get + * + * // field: strange name:Ljava/lang/String; + * // getter: getStrange name()Ljava/lang/String; + * public final lateinit val strange name: kotlin/String + * public final get + * + * // nested class: (^_^) + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { public final java.lang.String simpleName = null; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/strangeIdentifiers.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/strangeIdentifiers.ir.txt index 2b54af5bff0..4362686a05f 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/strangeIdentifiers.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/strangeIdentifiers.ir.txt @@ -1,4 +1,25 @@ @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class Anno : kotlin/Annotation { + * + * // signature: (LStrangeEnum;Ljava/lang/String;Ljava/lang/String;)V + * public constructor(size: StrangeEnum, name: kotlin/String, A B: kotlin/String) + * + * // getter: A B()Ljava/lang/String; + * public final val A B: kotlin/String + * public final get + * + * // getter: name()Ljava/lang/String; + * public final val name: kotlin/String + * public final get + * + * // getter: size()LStrangeEnum; + * public final val size: StrangeEnum + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno { @@ -10,6 +31,30 @@ public abstract @interface Anno { //////////////////// +/** + * public final enum class StrangeEnum : kotlin/Enum { + * + * // signature: (Ljava/lang/String;ILjava/lang/String;)V + * private constructor(size: kotlin/String) + * + * // field: size:Ljava/lang/String; + * // getter: getSize()Ljava/lang/String; + * public final val size: kotlin/String + * public final get + * + * 60x60, + * + * 70x70, + * + * 80x80, + * + * InvalidFieldName, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum StrangeEnum { /*public static final*/ InvalidFieldName /* = new StrangeEnum() */; @@ -33,6 +78,39 @@ public enum StrangeEnum { //////////////////// +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: simpleFun()V + * public final fun simpleFun(): kotlin/Unit + * + * // signature: simpleFun2(Ljava/lang/String;Ljava/lang/String;)V + * public final fun simpleFun2(a: kotlin/String, b: kotlin/String): kotlin/Unit + * + * // signature: strange!Fun()V + * public final fun strange!Fun(): kotlin/Unit + * + * // signature: strangeFun4(Ljava/lang/String;Ljava/lang/String;)V + * public final fun strangeFun4(a: kotlin/String, A()B(): kotlin/String): kotlin/Unit + * + * // field: simpleName:Ljava/lang/String; + * // getter: getSimpleName()Ljava/lang/String; + * public final lateinit val simpleName: kotlin/String + * public final get + * + * // field: strange name:Ljava/lang/String; + * // getter: getStrange name()Ljava/lang/String; + * public final lateinit val strange name: kotlin/String + * public final get + * + * // nested class: (^_^) + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { public final java.lang.String simpleName = null; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/strangeIdentifiers.txt b/plugins/kapt3/kapt3-compiler/testData/converter/strangeIdentifiers.txt index 39a26abc7dd..8d649a028b4 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/strangeIdentifiers.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/strangeIdentifiers.txt @@ -1,4 +1,25 @@ @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class Anno : kotlin/Annotation { + * + * // signature: (LStrangeEnum;Ljava/lang/String;Ljava/lang/String;)V + * public constructor(size: StrangeEnum, name: kotlin/String, A B: kotlin/String) + * + * // getter: A B()Ljava/lang/String; + * public final val A B: kotlin/String + * public final get + * + * // getter: name()Ljava/lang/String; + * public final val name: kotlin/String + * public final get + * + * // getter: size()LStrangeEnum; + * public final val size: StrangeEnum + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno { @@ -10,6 +31,30 @@ public abstract @interface Anno { //////////////////// +/** + * public final enum class StrangeEnum : kotlin/Enum { + * + * // signature: (Ljava/lang/String;ILjava/lang/String;)V + * private constructor(size: kotlin/String) + * + * // field: size:Ljava/lang/String; + * // getter: getSize()Ljava/lang/String; + * public final val size: kotlin/String + * public final get + * + * 60x60, + * + * 70x70, + * + * 80x80, + * + * InvalidFieldName, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum StrangeEnum { /*public static final*/ InvalidFieldName /* = new StrangeEnum() */; @@ -28,6 +73,39 @@ public enum StrangeEnum { //////////////////// +/** + * public final class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: simpleFun()V + * public final fun simpleFun(): kotlin/Unit + * + * // signature: simpleFun2(Ljava/lang/String;Ljava/lang/String;)V + * public final fun simpleFun2(a: kotlin/String, b: kotlin/String): kotlin/Unit + * + * // signature: strange!Fun()V + * public final fun strange!Fun(): kotlin/Unit + * + * // signature: strangeFun4(Ljava/lang/String;Ljava/lang/String;)V + * public final fun strangeFun4(a: kotlin/String, A()B(): kotlin/String): kotlin/Unit + * + * // field: simpleName:Ljava/lang/String; + * // getter: getSimpleName()Ljava/lang/String; + * public final lateinit val simpleName: kotlin/String + * public final get + * + * // field: strange name:Ljava/lang/String; + * // getter: getStrange name()Ljava/lang/String; + * public final lateinit val strange name: kotlin/String + * public final get + * + * // nested class: (^_^) + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Test { public java.lang.String simpleName; diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/superConstructorCall.txt b/plugins/kapt3/kapt3-compiler/testData/converter/superConstructorCall.txt index e8babc9fe82..b5aa4067275 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/superConstructorCall.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/superConstructorCall.txt @@ -1,5 +1,19 @@ package test; +/** + * public abstract class test/A : kotlin/Any { + * + * // signature: (Ljava/lang/String;)V + * public constructor(s: kotlin/String) + * + * // field: s:Ljava/lang/String; + * // getter: getS()Ljava/lang/String; + * public final val s: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract class A { @org.jetbrains.annotations.NotNull() @@ -20,6 +34,15 @@ public abstract class A { package test; +/** + * public final class test/B : test/A { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public final class B extends test.A { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/suspendArgName.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/suspendArgName.ir.txt index c318450885c..b4e39f76ee2 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/suspendArgName.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/suspendArgName.ir.txt @@ -1,3 +1,24 @@ +/** + * public open class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: getTest(Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + * public open suspend fun getTest(text: kotlin/String): kotlin/String + * + * // signature: getTestInvalid(Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + * public open suspend fun getTestInvalid(te xt: kotlin/String): kotlin/String + * + * // signature: getTestNoSuspend(Ljava/lang/String;)Ljava/lang/String; + * public open fun getTestNoSuspend(text: kotlin/String): kotlin/String + * + * // signature: getTestNoSuspendInvalid(Ljava/lang/String;)Ljava/lang/String; + * public open fun getTestNoSuspendInvalid(te xt: kotlin/String): kotlin/String + * + * // module name: main + * } + */ @kotlin.Metadata() public class Test { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/suspendArgName.txt b/plugins/kapt3/kapt3-compiler/testData/converter/suspendArgName.txt index b594d1a5f65..e7a99bab6f1 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/suspendArgName.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/suspendArgName.txt @@ -1,3 +1,24 @@ +/** + * public open class Test : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: getTest(Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + * public open suspend fun getTest(text: kotlin/String): kotlin/String + * + * // signature: getTestInvalid(Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + * public open suspend fun getTestInvalid(te xt: kotlin/String): kotlin/String + * + * // signature: getTestNoSuspend(Ljava/lang/String;)Ljava/lang/String; + * public open fun getTestNoSuspend(text: kotlin/String): kotlin/String + * + * // signature: getTestNoSuspendInvalid(Ljava/lang/String;)Ljava/lang/String; + * public open fun getTestNoSuspendInvalid(te xt: kotlin/String): kotlin/String + * + * // module name: main + * } + */ @kotlin.Metadata() public class Test { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/suspendErrorTypes.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/suspendErrorTypes.fir.txt index e4f63320339..5f1190e68af 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/suspendErrorTypes.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/suspendErrorTypes.fir.txt @@ -1,3 +1,18 @@ +/** + * public final class Foo : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: a(Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + * public final suspend fun a(): error/NonExistentClass + * + * // signature: b()Lkotlin/Result; + * public final suspend fun b(): kotlin/Result + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/suspendErrorTypes.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/suspendErrorTypes.ir.txt index 5f10c1ac8f5..46f6946ed90 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/suspendErrorTypes.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/suspendErrorTypes.ir.txt @@ -1,3 +1,20 @@ +/** + * public final class Foo : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: a(Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + * public final suspend fun a(): error/NonExistentClass + * + * // requires language version 1.4.0 (level=ERROR) + * // requires compiler version 1.4.30 (level=ERROR) + * // signature: b-IoAF18A(Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + * public final suspend fun b(): kotlin/Result + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/suspendErrorTypes.txt b/plugins/kapt3/kapt3-compiler/testData/converter/suspendErrorTypes.txt index cfe4df1d7b7..a6ff85ddfa4 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/suspendErrorTypes.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/suspendErrorTypes.txt @@ -1,3 +1,20 @@ +/** + * public final class Foo : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // signature: a(Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + * public final suspend fun a(): error/NonExistentClass + * + * // requires language version 1.4.0 (level=ERROR) + * // requires compiler version 1.4.30 (level=ERROR) + * // signature: b-IoAF18A(Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + * public final suspend fun b(): kotlin/Result + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/suspendFunctionSupertype.txt b/plugins/kapt3/kapt3-compiler/testData/converter/suspendFunctionSupertype.txt index c5e0f2ccddd..fb19237247e 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/suspendFunctionSupertype.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/suspendFunctionSupertype.txt @@ -1,3 +1,9 @@ +/** + * public abstract interface SomeInterface : suspend kotlin/Function3, kotlin/Boolean, kotlin/coroutines/Continuation>, kotlin/Any?> { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface SomeInterface extends kotlin.jvm.functions.Function3, java.lang.Boolean, kotlin.coroutines.Continuation>, java.lang.Object> { } diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/suspendFunctionWithBigArity.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/suspendFunctionWithBigArity.ir.txt index 8767c79c71c..9088281458e 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/suspendFunctionWithBigArity.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/suspendFunctionWithBigArity.ir.txt @@ -1,3 +1,9 @@ +/** + * public abstract interface Flow : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Flow { } @@ -5,6 +11,15 @@ public abstract interface Flow { //////////////////// +/** + * package { + * + * // signature: combine(LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;Lkotlin/jvm/functions/FunctionN;)LFlow; + * public final fun combine(flow: Flow, flow2: Flow, flow3: Flow, flow4: Flow, flow5: Flow, flow6: Flow, flow7: Flow, flow8: Flow, flow9: Flow, flow10: Flow, flow11: Flow, flow12: Flow, flow13: Flow, flow14: Flow, flow15: Flow, flow16: Flow, flow17: Flow, flow18: Flow, flow19: Flow, flow20: Flow, flow21: Flow, flow22: Flow, flow23: Flow, transform: suspend kotlin/Function24, kotlin/Any?>): Flow + * + * // module name: main + * } + */ @kotlin.Metadata() public final class SuspendFunctionWithBigArityKt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/suspendFunctionWithBigArity.txt b/plugins/kapt3/kapt3-compiler/testData/converter/suspendFunctionWithBigArity.txt index 06219c88244..ebee02b7c06 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/suspendFunctionWithBigArity.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/suspendFunctionWithBigArity.txt @@ -1,3 +1,9 @@ +/** + * public abstract interface Flow : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface Flow { } @@ -5,6 +11,15 @@ public abstract interface Flow { //////////////////// +/** + * package { + * + * // signature: combine(LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;LFlow;Lkotlin/jvm/functions/FunctionN;)LFlow; + * public final fun combine(flow: Flow, flow2: Flow, flow3: Flow, flow4: Flow, flow5: Flow, flow6: Flow, flow7: Flow, flow8: Flow, flow9: Flow, flow10: Flow, flow11: Flow, flow12: Flow, flow13: Flow, flow14: Flow, flow15: Flow, flow16: Flow, flow17: Flow, flow18: Flow, flow19: Flow, flow20: Flow, flow21: Flow, flow22: Flow, flow23: Flow, transform: suspend kotlin/Function24, kotlin/Any?>): Flow + * + * // module name: main + * } + */ @kotlin.Metadata() public final class SuspendFunctionWithBigArityKt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/topLevel.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/topLevel.fir.txt index 382806c7857..67bb1b00f74 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/topLevel.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/topLevel.fir.txt @@ -1,5 +1,18 @@ package test.another; +/** + * public final annotation class test/another/Anno : kotlin/Annotation { + * + * // signature: (Ljava/lang/String;)V + * public constructor(value: kotlin/String) + * + * // getter: value()Ljava/lang/String; + * public final val value: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) public abstract @interface Anno { @@ -11,6 +24,41 @@ public abstract @interface Anno { package test.another; +/** + * package { + * + * // signature: extensionFunction(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V + * public final fun kotlin/String.extensionFunction(a: kotlin/String, b: kotlin/String): kotlin/Unit + * + * // signature: topLevelFunction()Ljava/lang/String; + * public final fun topLevelFunction(): kotlin/String? + * + * // signature: topLevelGenericFunction()Ljava/util/List; + * public final fun > topLevelGenericFunction(): T#1? + * + * // getter: getExtensionProperty(Ljava/lang/Object;)Ljava/lang/String; + * // setter: setExtensionProperty(Ljava/lang/Object;Ljava/lang/String;)V + * // synthetic method for annotations: getExtensionProperty$annotations(Ljava/lang/Object;)V + * public final var T#0.extensionProperty: kotlin/String + * public final (* non-default *) get + * public final (* non-default *) set(setParamName: kotlin/String) + * + * // field: topLevelProperty:I + * // getter: getTopLevelProperty()I + * public final val topLevelProperty: kotlin/Int (* = ... *) + * public final get + * + * // getter: getTopLevelProperty2()Ljava/lang/String; + * public final val topLevelProperty2: kotlin/String + * public final (* non-default *) get + * + * // field: topLevelConstProperty:I + * public final const val topLevelConstProperty: kotlin/Int (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TopLevelKt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/topLevel.txt b/plugins/kapt3/kapt3-compiler/testData/converter/topLevel.txt index b7cfd7fd419..c8d3b969aaf 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/topLevel.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/topLevel.txt @@ -1,6 +1,19 @@ package test.another; @java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class test/another/Anno : kotlin/Annotation { + * + * // signature: (Ljava/lang/String;)V + * public constructor(value: kotlin/String) + * + * // getter: value()Ljava/lang/String; + * public final val value: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract @interface Anno { @@ -11,6 +24,41 @@ public abstract @interface Anno { package test.another; +/** + * package { + * + * // signature: extensionFunction(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V + * public final fun kotlin/String.extensionFunction(a: kotlin/String, b: kotlin/String): kotlin/Unit + * + * // signature: topLevelFunction()Ljava/lang/String; + * public final fun topLevelFunction(): kotlin/String? + * + * // signature: topLevelGenericFunction()Ljava/util/List; + * public final fun > topLevelGenericFunction(): T#1? + * + * // getter: getExtensionProperty(Ljava/lang/Object;)Ljava/lang/String; + * // setter: setExtensionProperty(Ljava/lang/Object;Ljava/lang/String;)V + * // synthetic method for annotations: getExtensionProperty$annotations(Ljava/lang/Object;)V + * public final var T#0.extensionProperty: kotlin/String + * public final (* non-default *) get + * public final (* non-default *) set(setParamName: kotlin/String) + * + * // field: topLevelProperty:I + * // getter: getTopLevelProperty()I + * public final val topLevelProperty: kotlin/Int (* = ... *) + * public final get + * + * // getter: getTopLevelProperty2()Ljava/lang/String; + * public final val topLevelProperty2: kotlin/String + * public final (* non-default *) get + * + * // field: topLevelConstProperty:I + * public final const val topLevelConstProperty: kotlin/Int (* = ... *) + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class TopLevelKt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.fir.txt new file mode 100644 index 00000000000..76dc88e397b --- /dev/null +++ b/plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.fir.txt @@ -0,0 +1,132 @@ +/** + * public final class B : error/NonExistentClass { + * + * // signature: ()V + * public constructor() + * + * // field: a$delegate:Ljava/lang/String; + * // getter: getA()Ljava/lang/String; + * // synthetic method for annotations: getA$annotations()V + * public final (* delegated *) val a: kotlin/String + * public final (* non-default *) get + * + * // module name: main + * } + */ +@kotlin.Metadata() +@kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) +public final class B implements NonExisting { + @org.jetbrains.annotations.NotNull() + private final java.lang.String a$delegate = null; + + public B() { + super(); + } + + @org.jetbrains.annotations.NotNull() + public final java.lang.String getA() { + return null; + } + + @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE_WRONG_RECEIVER"}) + @java.lang.Deprecated() + public static void getA$annotations() { + } +} + +//////////////////// + + +/** + * public open class C : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ +@kotlin.Metadata() +public class C { + + public C() { + super(); + } +} + +//////////////////// + + +/** + * public final class D : I { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ +@kotlin.Metadata() +@kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) +public final class D implements I { + + public D() { + super(); + } +} + +//////////////////// + + +/** + * public final class E : error/NonExistentClass { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ +@kotlin.Metadata() +@kotlin.Suppress(names = {"UNRESOLVED_REFERENCE", "DELEGATION_NOT_TO_INTERFACE"}) +public final class E implements NonExisting { + + public E() { + super(); + } +} + +//////////////////// + + +/** + * public abstract interface I : kotlin/Any { + * + * // module name: main + * } + */ +@kotlin.Metadata() +public abstract interface I { +} + +//////////////////// + + +/** + * package { + * + * // signature: flaf(LC;)Ljava/lang/String; + * public final fun C.flaf(): kotlin/String + * + * // module name: main + * } + */ +@kotlin.Metadata() +public final class UnresolvedDelegateExpressionKt { + + @org.jetbrains.annotations.NotNull() + public static final java.lang.String flaf(@org.jetbrains.annotations.NotNull() + C $this$flaf) { + return null; + } +} diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.ir.txt index 040f330c39d..9e0241dd690 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.ir.txt @@ -1,3 +1,18 @@ +/** + * public final class B : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: a$delegate:Lerror/NonExistentClass; + * // getter: getA()Ljava/lang/String; + * // synthetic method for annotations: getA$annotations()V + * public final (* delegated *) val a: kotlin/String + * public final (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) public final class B implements NonExisting { @@ -22,6 +37,15 @@ public final class B implements NonExisting { //////////////////// +/** + * public open class C : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public class C { @@ -33,6 +57,15 @@ public class C { //////////////////// +/** + * public final class D : I { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) public final class D implements I { @@ -45,6 +78,15 @@ public final class D implements I { //////////////////// +/** + * public final class E : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE", "DELEGATION_NOT_TO_INTERFACE"}) public final class E implements NonExisting { @@ -57,6 +99,12 @@ public final class E implements NonExisting { //////////////////// +/** + * public abstract interface I : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface I { } @@ -64,6 +112,15 @@ public abstract interface I { //////////////////// +/** + * package { + * + * // signature: flaf(LC;)Ljava/lang/String; + * public final fun C.flaf(): kotlin/String + * + * // module name: main + * } + */ @kotlin.Metadata() public final class UnresolvedDelegateExpressionKt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.txt b/plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.txt index 66b806c1e98..c0dc17f5890 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/unresolvedDelegateExpression.txt @@ -1,3 +1,18 @@ +/** + * public final class B : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: a$delegate:Lerror/NonExistentClass; + * // getter: getA()Ljava/lang/String; + * // synthetic method for annotations: getA$annotations()V + * public final (* delegated *) val a: kotlin/String + * public final (* non-default *) get + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) public final class B implements NonExisting { @@ -22,6 +37,15 @@ public final class B implements NonExisting { //////////////////// +/** + * public open class C : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() public class C { @@ -33,6 +57,15 @@ public class C { //////////////////// +/** + * public final class D : I { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"}) public final class D implements I { @@ -45,6 +78,15 @@ public final class D implements I { //////////////////// +/** + * public final class E : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ @kotlin.Metadata() @kotlin.Suppress(names = {"UNRESOLVED_REFERENCE", "DELEGATION_NOT_TO_INTERFACE"}) public final class E implements NonExisting { @@ -57,6 +99,12 @@ public final class E implements NonExisting { //////////////////// +/** + * public abstract interface I : kotlin/Any { + * + * // module name: main + * } + */ @kotlin.Metadata() public abstract interface I { } @@ -64,6 +112,15 @@ public abstract interface I { //////////////////// +/** + * package { + * + * // signature: flaf(LC;)Ljava/lang/String; + * public final fun C.flaf(): kotlin/String + * + * // module name: main + * } + */ @kotlin.Metadata() public final class UnresolvedDelegateExpressionKt { diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/unsafePropertyInitializers.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/unsafePropertyInitializers.fir.txt index d09cf2a22d1..6110f0629ce 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/unsafePropertyInitializers.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/unsafePropertyInitializers.fir.txt @@ -1,3 +1,20 @@ +/** + * public final object Boo : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // signature: foo()Ljava/lang/String; + * public final fun foo(): kotlin/String + * + * // field: z:Ljava/lang/String; + * // getter: getZ()Ljava/lang/String; + * public final val z: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Boo { @org.jetbrains.annotations.NotNull() @@ -23,6 +40,87 @@ public final class Boo { //////////////////// +/** + * public final object Foo : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // field: aInt:I + * public final const val aInt: kotlin/Int (* = ... *) + * public final get + * + * // field: aString:Ljava/lang/String; + * public final const val aString: kotlin/String (* = ... *) + * public final get + * + * // field: bInt:I + * // getter: getBInt()I + * public final val bInt: kotlin/Int (* = ... *) + * public final get + * + * // field: bString:Ljava/lang/String; + * // getter: getBString()Ljava/lang/String; + * public final val bString: kotlin/String (* = ... *) + * public final get + * + * // field: cInt:I + * // getter: getCInt()I + * // setter: setCInt(I)V + * public final var cInt: kotlin/Int + * public final get + * public final set + * + * // field: cString:Ljava/lang/String; + * // getter: getCString()Ljava/lang/String; + * // setter: setCString(Ljava/lang/String;)V + * public final var cString: kotlin/String + * public final get + * public final set + * + * // field: d:Ljava/lang/String; + * // getter: getD()Ljava/lang/String; + * public final val d: kotlin/String + * public final get + * + * // field: e:I + * // getter: getE()I + * public final val e: kotlin/Int + * public final get + * + * // field: f:I + * // getter: getF()I + * public final val f: kotlin/Int + * public final get + * + * // field: g:Ljava/lang/String; + * // getter: getG()Ljava/lang/String; + * public final val g: kotlin/String + * public final get + * + * // field: h:I + * // getter: getH()I + * public final val h: kotlin/Int (* = ... *) + * public final get + * + * // field: i:I + * // getter: getI()I + * public final val i: kotlin/Int (* = ... *) + * public final get + * + * // field: j:Ljava/lang/String; + * // getter: getJ()Ljava/lang/String; + * public final val j: kotlin/String + * public final get + * + * // field: k:Ljava/lang/String; + * // getter: getK()Ljava/lang/String; + * public final val k: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { @org.jetbrains.annotations.NotNull() @@ -118,6 +216,80 @@ public final class Foo { //////////////////// +/** + * public final class HavingState : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: anonymous:Lkotlin/reflect/KClass; + * // getter: getAnonymous()Lkotlin/reflect/KClass; + * public final val anonymous: kotlin/reflect/KClass (* = ... *) + * public final get + * + * // field: clazz:Lkotlin/reflect/KClass; + * // getter: getClazz()Lkotlin/reflect/KClass; + * public final val clazz: kotlin/reflect/KClass (* = ... *) + * public final get + * + * // field: floatArray:[F + * // getter: getFloatArray()[F + * public final val floatArray: kotlin/FloatArray (* = ... *) + * public final get + * + * // field: intArray:[Ljava/lang/Integer; + * // getter: getIntArray()[Ljava/lang/Integer; + * public final val intArray: kotlin/Array (* = ... *) + * public final get + * + * // field: intList:Ljava/util/List; + * // getter: getIntList()Ljava/util/List; + * public final val intList: kotlin/collections/List + * public final get + * + * // field: javaClass:Ljava/lang/Class; + * // getter: getJavaClass()Ljava/lang/Class; + * public final val javaClass: java/lang/Class + * public final get + * + * // field: state:LState; + * // getter: getState()LState; + * public final val state: State (* = ... *) + * public final get + * + * // field: stateArray:[LState; + * // getter: getStateArray()[LState; + * public final val stateArray: kotlin/Array (* = ... *) + * public final get + * + * // field: stringArray:[Ljava/lang/String; + * // getter: getStringArray()[Ljava/lang/String; + * public final val stringArray: kotlin/Array (* = ... *) + * public final get + * + * // field: stringList:Ljava/util/List; + * // getter: getStringList()Ljava/util/List; + * public final val stringList: kotlin/collections/List + * public final get + * + * // field: uint:I + * // getter: getUint()I + * public final val uint: kotlin/UInt (* = ... *) + * public final get + * + * // field: uintArray:[Lkotlin/UInt; + * // getter: getUintArray()[Lkotlin/UInt; + * public final val uintArray: kotlin/Array (* = ... *) + * public final get + * + * // field: uintList:Ljava/util/List; + * // getter: getUintList()Ljava/util/List; + * public final val uintList: kotlin/collections/List + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class HavingState { @org.jetbrains.annotations.NotNull() @@ -218,6 +390,21 @@ public final class HavingState { //////////////////// +/** + * public final enum class State : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * START, + * + * FINISH, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum State { /*public static final*/ START /* = new State() */, diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/unsafePropertyInitializers.ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/unsafePropertyInitializers.ir.txt index 2582d853e6f..bdc68fd7bd4 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/unsafePropertyInitializers.ir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/unsafePropertyInitializers.ir.txt @@ -1,3 +1,20 @@ +/** + * public final object Boo : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // signature: foo()Ljava/lang/String; + * public final fun foo(): kotlin/String + * + * // field: z:Ljava/lang/String; + * // getter: getZ()Ljava/lang/String; + * public final val z: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Boo { @org.jetbrains.annotations.NotNull() @@ -23,6 +40,87 @@ public final class Boo { //////////////////// +/** + * public final object Foo : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // field: aInt:I + * public final const val aInt: kotlin/Int (* = ... *) + * public final get + * + * // field: aString:Ljava/lang/String; + * public final const val aString: kotlin/String (* = ... *) + * public final get + * + * // field: bInt:I + * // getter: getBInt()I + * public final val bInt: kotlin/Int (* = ... *) + * public final get + * + * // field: bString:Ljava/lang/String; + * // getter: getBString()Ljava/lang/String; + * public final val bString: kotlin/String (* = ... *) + * public final get + * + * // field: cInt:I + * // getter: getCInt()I + * // setter: setCInt(I)V + * public final var cInt: kotlin/Int + * public final get + * public final set + * + * // field: cString:Ljava/lang/String; + * // getter: getCString()Ljava/lang/String; + * // setter: setCString(Ljava/lang/String;)V + * public final var cString: kotlin/String + * public final get + * public final set + * + * // field: d:Ljava/lang/String; + * // getter: getD()Ljava/lang/String; + * public final val d: kotlin/String + * public final get + * + * // field: e:I + * // getter: getE()I + * public final val e: kotlin/Int + * public final get + * + * // field: f:I + * // getter: getF()I + * public final val f: kotlin/Int (* = ... *) + * public final get + * + * // field: g:Ljava/lang/String; + * // getter: getG()Ljava/lang/String; + * public final val g: kotlin/String (* = ... *) + * public final get + * + * // field: h:I + * // getter: getH()I + * public final val h: kotlin/Int (* = ... *) + * public final get + * + * // field: i:I + * // getter: getI()I + * public final val i: kotlin/Int (* = ... *) + * public final get + * + * // field: j:Ljava/lang/String; + * // getter: getJ()Ljava/lang/String; + * public final val j: kotlin/String + * public final get + * + * // field: k:Ljava/lang/String; + * // getter: getK()Ljava/lang/String; + * public final val k: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { @org.jetbrains.annotations.NotNull() @@ -118,6 +216,82 @@ public final class Foo { //////////////////// +/** + * public final class HavingState : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: anonymous:Lkotlin/reflect/KClass; + * // getter: getAnonymous()Lkotlin/reflect/KClass; + * public final val anonymous: kotlin/reflect/KClass + * public final get + * + * // field: clazz:Lkotlin/reflect/KClass; + * // getter: getClazz()Lkotlin/reflect/KClass; + * public final val clazz: kotlin/reflect/KClass + * public final get + * + * // field: floatArray:[F + * // getter: getFloatArray()[F + * public final val floatArray: kotlin/FloatArray + * public final get + * + * // field: intArray:[Ljava/lang/Integer; + * // getter: getIntArray()[Ljava/lang/Integer; + * public final val intArray: kotlin/Array + * public final get + * + * // field: intList:Ljava/util/List; + * // getter: getIntList()Ljava/util/List; + * public final val intList: kotlin/collections/List + * public final get + * + * // field: javaClass:Ljava/lang/Class; + * // getter: getJavaClass()Ljava/lang/Class; + * public final val javaClass: java/lang/Class + * public final get + * + * // field: state:LState; + * // getter: getState()LState; + * public final val state: State + * public final get + * + * // field: stateArray:[LState; + * // getter: getStateArray()[LState; + * public final val stateArray: kotlin/Array + * public final get + * + * // field: stringArray:[Ljava/lang/String; + * // getter: getStringArray()[Ljava/lang/String; + * public final val stringArray: kotlin/Array + * public final get + * + * // field: stringList:Ljava/util/List; + * // getter: getStringList()Ljava/util/List; + * public final val stringList: kotlin/collections/List + * public final get + * + * // requires compiler version 1.4.30 (level=ERROR) + * // requires language version 1.4.0 (level=ERROR) + * // field: uint:I + * // getter: getUint-pVg5ArA()I + * public final val uint: kotlin/UInt (* = ... *) + * public final get + * + * // field: uintArray:[Lkotlin/UInt; + * // getter: getUintArray()[Lkotlin/UInt; + * public final val uintArray: kotlin/Array + * public final get + * + * // field: uintList:Ljava/util/List; + * // getter: getUintList()Ljava/util/List; + * public final val uintList: kotlin/collections/List + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class HavingState { @org.jetbrains.annotations.NotNull() @@ -214,6 +388,21 @@ public final class HavingState { //////////////////// +/** + * public final enum class State : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * START, + * + * FINISH, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum State { /*public static final*/ START /* = new State() */, diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/unsafePropertyInitializers.txt b/plugins/kapt3/kapt3-compiler/testData/converter/unsafePropertyInitializers.txt index dccafed6ed9..5918dcf1821 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/unsafePropertyInitializers.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/unsafePropertyInitializers.txt @@ -1,3 +1,20 @@ +/** + * public final object Boo : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // signature: foo()Ljava/lang/String; + * public final fun foo(): kotlin/String + * + * // field: z:Ljava/lang/String; + * // getter: getZ()Ljava/lang/String; + * public final val z: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Boo { @org.jetbrains.annotations.NotNull() @@ -23,6 +40,87 @@ public final class Boo { //////////////////// +/** + * public final object Foo : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // field: aInt:I + * public final const val aInt: kotlin/Int (* = ... *) + * public final get + * + * // field: aString:Ljava/lang/String; + * public final const val aString: kotlin/String (* = ... *) + * public final get + * + * // field: bInt:I + * // getter: getBInt()I + * public final val bInt: kotlin/Int (* = ... *) + * public final get + * + * // field: bString:Ljava/lang/String; + * // getter: getBString()Ljava/lang/String; + * public final val bString: kotlin/String (* = ... *) + * public final get + * + * // field: cInt:I + * // getter: getCInt()I + * // setter: setCInt(I)V + * public final var cInt: kotlin/Int + * public final get + * public final set + * + * // field: cString:Ljava/lang/String; + * // getter: getCString()Ljava/lang/String; + * // setter: setCString(Ljava/lang/String;)V + * public final var cString: kotlin/String + * public final get + * public final set + * + * // field: d:Ljava/lang/String; + * // getter: getD()Ljava/lang/String; + * public final val d: kotlin/String + * public final get + * + * // field: e:I + * // getter: getE()I + * public final val e: kotlin/Int + * public final get + * + * // field: f:I + * // getter: getF()I + * public final val f: kotlin/Int (* = ... *) + * public final get + * + * // field: g:Ljava/lang/String; + * // getter: getG()Ljava/lang/String; + * public final val g: kotlin/String (* = ... *) + * public final get + * + * // field: h:I + * // getter: getH()I + * public final val h: kotlin/Int (* = ... *) + * public final get + * + * // field: i:I + * // getter: getI()I + * public final val i: kotlin/Int (* = ... *) + * public final get + * + * // field: j:Ljava/lang/String; + * // getter: getJ()Ljava/lang/String; + * public final val j: kotlin/String + * public final get + * + * // field: k:Ljava/lang/String; + * // getter: getK()Ljava/lang/String; + * public final val k: kotlin/String + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class Foo { @org.jetbrains.annotations.NotNull() @@ -118,6 +216,82 @@ public final class Foo { //////////////////// +/** + * public final class HavingState : kotlin/Any { + * + * // signature: ()V + * public constructor() + * + * // field: anonymous:Lkotlin/reflect/KClass; + * // getter: getAnonymous()Lkotlin/reflect/KClass; + * public final val anonymous: kotlin/reflect/KClass + * public final get + * + * // field: clazz:Lkotlin/reflect/KClass; + * // getter: getClazz()Lkotlin/reflect/KClass; + * public final val clazz: kotlin/reflect/KClass + * public final get + * + * // field: floatArray:[F + * // getter: getFloatArray()[F + * public final val floatArray: kotlin/FloatArray + * public final get + * + * // field: intArray:[Ljava/lang/Integer; + * // getter: getIntArray()[Ljava/lang/Integer; + * public final val intArray: kotlin/Array + * public final get + * + * // field: intList:Ljava/util/List; + * // getter: getIntList()Ljava/util/List; + * public final val intList: kotlin/collections/List + * public final get + * + * // field: javaClass:Ljava/lang/Class; + * // getter: getJavaClass()Ljava/lang/Class; + * public final val javaClass: java/lang/Class + * public final get + * + * // field: state:LState; + * // getter: getState()LState; + * public final val state: State + * public final get + * + * // field: stateArray:[LState; + * // getter: getStateArray()[LState; + * public final val stateArray: kotlin/Array + * public final get + * + * // field: stringArray:[Ljava/lang/String; + * // getter: getStringArray()[Ljava/lang/String; + * public final val stringArray: kotlin/Array + * public final get + * + * // field: stringList:Ljava/util/List; + * // getter: getStringList()Ljava/util/List; + * public final val stringList: kotlin/collections/List + * public final get + * + * // requires compiler version 1.4.30 (level=ERROR) + * // requires language version 1.4.0 (level=ERROR) + * // field: uint:I + * // getter: getUint-pVg5ArA()I + * public final val uint: kotlin/UInt (* = ... *) + * public final get + * + * // field: uintArray:[Lkotlin/UInt; + * // getter: getUintArray()[Lkotlin/UInt; + * public final val uintArray: kotlin/Array + * public final get + * + * // field: uintList:Ljava/util/List; + * // getter: getUintList()Ljava/util/List; + * public final val uintList: kotlin/collections/List + * public final get + * + * // module name: main + * } + */ @kotlin.Metadata() public final class HavingState { @org.jetbrains.annotations.NotNull() @@ -214,6 +388,21 @@ public final class HavingState { //////////////////// +/** + * public final enum class State : kotlin/Enum { + * + * // signature: (Ljava/lang/String;I)V + * private constructor() + * + * START, + * + * FINISH, + * + * // module name: main + * + * // has Enum.entries + * } + */ @kotlin.Metadata() public enum State { /*public static final*/ START /* = new State() */, diff --git a/plugins/kapt4/src/org/jetbrains/kotlin/kapt4/Kapt4StubGenerator.kt b/plugins/kapt4/src/org/jetbrains/kotlin/kapt4/Kapt4StubGenerator.kt index fbc6726277f..8da945165c3 100644 --- a/plugins/kapt4/src/org/jetbrains/kotlin/kapt4/Kapt4StubGenerator.kt +++ b/plugins/kapt4/src/org/jetbrains/kotlin/kapt4/Kapt4StubGenerator.kt @@ -7,6 +7,8 @@ package org.jetbrains.kotlin.kapt4 +import com.google.common.collect.HashMultimap +import com.google.common.collect.Multimap import com.intellij.psi.* import com.sun.tools.javac.code.Flags import com.sun.tools.javac.code.TypeTag @@ -19,9 +21,12 @@ import org.jetbrains.kotlin.analysis.api.symbols.KtClassOrObjectSymbol import org.jetbrains.kotlin.analysis.api.symbols.KtEnumEntrySymbol import org.jetbrains.kotlin.asJava.classes.KtLightClass import org.jetbrains.kotlin.asJava.classes.KtLightClassForFacade +import org.jetbrains.kotlin.asJava.elements.KtLightElement import org.jetbrains.kotlin.asJava.elements.KtLightElementBase import org.jetbrains.kotlin.base.kapt3.KaptFlag import org.jetbrains.kotlin.builtins.StandardNames +import org.jetbrains.kotlin.config.LanguageVersion +import org.jetbrains.kotlin.fileClasses.JvmFileClassUtil import org.jetbrains.kotlin.idea.references.KtReference import org.jetbrains.kotlin.kapt3.base.javac.kaptError import org.jetbrains.kotlin.kapt3.base.javac.reportKaptError @@ -29,16 +34,17 @@ import org.jetbrains.kotlin.kapt3.base.stubs.KaptStubLineInformation import org.jetbrains.kotlin.kapt3.base.util.TopLevelJava9Aware import org.jetbrains.kotlin.kapt3.stubs.MemberData import org.jetbrains.kotlin.kapt3.stubs.MembersPositionComparator +import org.jetbrains.kotlin.light.classes.symbol.classes.SymbolLightClassForNamedClassLike +import org.jetbrains.kotlin.load.java.JvmAnnotationNames.* +import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.SpecialNames import org.jetbrains.kotlin.name.isOneSegmentFQN -import org.jetbrains.kotlin.psi.KtDotQualifiedExpression -import org.jetbrains.kotlin.psi.KtFile -import org.jetbrains.kotlin.psi.KtNameReferenceExpression -import org.jetbrains.kotlin.psi.KtParameter +import org.jetbrains.kotlin.psi.* import org.jetbrains.kotlin.resolve.calls.util.getCalleeExpressionIfAny import org.jetbrains.kotlin.utils.addToStdlib.runIf import org.jetbrains.kotlin.utils.addToStdlib.runUnless +import org.jetbrains.kotlin.utils.toMetadataVersion import org.jetbrains.org.objectweb.asm.Opcodes import org.jetbrains.org.objectweb.asm.Type import java.io.File @@ -268,16 +274,15 @@ internal class Kapt4StubGenerator { } private fun convertMetadataAnnotation(metadata: Metadata): JCAnnotation { - val argumentsWithNames = mapOf( - "k" to metadata.kind, - "mv" to metadata.metadataVersion.toList(), - "bv" to metadata.bytecodeVersion.toList(), - "d1" to metadata.data1.toList(), - "d2" to metadata.data2.toList(), - "xs" to metadata.extraString, - "pn" to metadata.packageName, - "xi" to metadata.extraInt, - ) + val argumentsWithNames = mutableMapOf() + if (metadata.kind != 1) argumentsWithNames[KIND_FIELD_NAME] = metadata.kind + argumentsWithNames[METADATA_VERSION_FIELD_NAME] = metadata.metadataVersion.toList() + if (metadata.data1.isNotEmpty()) argumentsWithNames[METADATA_DATA_FIELD_NAME] = metadata.data1.toList() + if (metadata.data2.isNotEmpty()) argumentsWithNames[METADATA_STRINGS_FIELD_NAME] = metadata.data2.toList() + if (metadata.extraString.isNotEmpty()) argumentsWithNames[METADATA_EXTRA_STRING_FIELD_NAME] = metadata.extraString + if (metadata.packageName.isNotEmpty()) argumentsWithNames[METADATA_PACKAGE_NAME_FIELD_NAME] = metadata.packageName + if (metadata.extraInt != 0) argumentsWithNames[METADATA_EXTRA_INT_FIELD_NAME] = metadata.extraInt + val arguments = argumentsWithNames.map { (name, value) -> val jValue = convertLiteralExpression(value) treeMaker.Assign(treeMaker.SimpleName(name), jValue) @@ -904,10 +909,37 @@ internal class Kapt4StubGenerator { } } - @Suppress("UNUSED_PARAMETER") private fun calculateMetadata(lightClass: PsiClass): Metadata? { if (stripMetadata) return null - return Metadata() // TODO: calculate me + return with(analysisSession) { + when (lightClass) { + is KtLightClassForFacade -> + if (lightClass.multiFileClass) + lightClass.qualifiedName?.let { createMultifileClassMetadata(lightClass, it) } + else + lightClass.files.singleOrNull()?.calculateMetadata(elementMapping(lightClass)) + is SymbolLightClassForNamedClassLike -> + lightClass.kotlinOrigin?.calculateMetadata(elementMapping(lightClass)) + else -> null + } + } } -} \ No newline at end of file + + private fun createMultifileClassMetadata(lightClass: KtLightClassForFacade, qualifiedName: String): Metadata = + Metadata( + kind = KotlinClassHeader.Kind.MULTIFILE_CLASS.id, + metadataVersion = LanguageVersion.KOTLIN_2_0.toMetadataVersion().toArray(), + data1 = lightClass.files.map { + JvmFileClassUtil.manglePartName(qualifiedName.replace('.', '/'), it.name) + }.toTypedArray(), + extraInt = METADATA_JVM_IR_FLAG or METADATA_FIR_FLAG or METADATA_JVM_IR_STABLE_ABI_FLAG + ) + + private fun elementMapping(lightClass: PsiClass): Multimap = + HashMultimap.create().apply { + (lightClass.methods.asSequence() + lightClass.fields.asSequence() + lightClass.constructors.asSequence()).forEach { + put((it as KtLightElement<*, *>).kotlinOrigin, it) + } + } +} diff --git a/plugins/kapt4/test/org/jetbrains/kotlin/kapt4/Kapt4Handler.kt b/plugins/kapt4/test/org/jetbrains/kotlin/kapt4/Kapt4Handler.kt index c1436030db5..68756e8595b 100644 --- a/plugins/kapt4/test/org/jetbrains/kotlin/kapt4/Kapt4Handler.kt +++ b/plugins/kapt4/test/org/jetbrains/kotlin/kapt4/Kapt4Handler.kt @@ -32,6 +32,7 @@ import org.jetbrains.kotlin.test.utils.withExtension import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstance import java.io.File import java.util.* +import org.jetbrains.kotlin.kapt3.test.handlers.renderMetadata internal class Kapt4Handler(testServices: TestServices) : AnalysisHandler( testServices, @@ -115,7 +116,7 @@ internal class Kapt4Handler(testServices: TestServices) : AnalysisHandler { val (kaptContext, kaptStubs) = info val convertedFiles = kaptStubs.mapIndexed { index, stub -> - val sourceFile = createTempJavaFile("stub$index.java", stub.file.prettyPrint(kaptContext.context)) + val sourceFile = createTempJavaFile("stub$index.java", stub.file.prettyPrint(kaptContext.context, ::renderMetadata)) stub.writeMetadataIfNeeded(forSource = sourceFile) sourceFile }