diff --git a/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java b/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java index aa2497319b0..d3245abcf75 100644 --- a/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java +++ b/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java @@ -29,6 +29,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @TestMetadata("annotationUsedAsAnnotationArgument.kt") + public void testAnnotationUsedAsAnnotationArgument() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/annotationUsedAsAnnotationArgument.kt"); + } + @TestMetadata("asImports.kt") public void testAsImports() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/asImports.kt"); diff --git a/compiler/fir/analysis-tests/testData/resolve/annotationUsedAsAnnotationArgument.fir.txt b/compiler/fir/analysis-tests/testData/resolve/annotationUsedAsAnnotationArgument.fir.txt new file mode 100644 index 00000000000..d94e4fc3f3d --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolve/annotationUsedAsAnnotationArgument.fir.txt @@ -0,0 +1,27 @@ +FILE: annotationUsedAsAnnotationArgument.kt + public final annotation class Ann : R|kotlin/Annotation| { + public constructor(): R|Ann| { + super() + } + + } + public final annotation class Ann2 : R|kotlin/Annotation| { + public constructor(): R|Ann2| { + super() + } + + } + public final annotation class Ann3 : R|kotlin/Annotation| { + public constructor(arg: R|kotlin/Int|, s: R|kotlin/String|): R|Ann3| { + super() + } + + public final val arg: R|kotlin/Int| = R|/arg| + public get(): R|kotlin/Int| + + public final val s: R|kotlin/String| = R|/s| + public get(): R|kotlin/String| + + } + @R|Ann3|(@R|Ann3|(@R|Ann|() Int(5), String()) @R|Ann2|() Int(1), String()) public final val a: R|kotlin/Int| = Int(0) + public get(): R|kotlin/Int| diff --git a/compiler/fir/analysis-tests/testData/resolve/annotationUsedAsAnnotationArgument.kt b/compiler/fir/analysis-tests/testData/resolve/annotationUsedAsAnnotationArgument.kt new file mode 100644 index 00000000000..6bb87e3d5cd --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolve/annotationUsedAsAnnotationArgument.kt @@ -0,0 +1,11 @@ +annotation class Ann + +annotation class Ann2 + +annotation class Ann3(val arg: Int, val s: String) + +@Ann3( + @Ann3( + @Ann 5, "" + ) @Ann2 1, "" +) val a = 0 \ No newline at end of file diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestGenerated.java index f685115bdd7..927e22f09b6 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestGenerated.java @@ -26,6 +26,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test + @TestMetadata("annotationUsedAsAnnotationArgument.kt") + public void testAnnotationUsedAsAnnotationArgument() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/annotationUsedAsAnnotationArgument.kt"); + } + @Test @TestMetadata("asImports.kt") public void testAsImports() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java index eaff30a8cde..0ae16964aff 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java @@ -26,6 +26,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test + @TestMetadata("annotationUsedAsAnnotationArgument.kt") + public void testAnnotationUsedAsAnnotationArgument() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/annotationUsedAsAnnotationArgument.kt"); + } + @Test @TestMetadata("asImports.kt") public void testAsImports() throws Exception { diff --git a/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/Main.kt b/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/Main.kt index a55b5c8fefd..b2bb8942295 100644 --- a/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/Main.kt +++ b/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/Main.kt @@ -24,6 +24,7 @@ fun main(args: Array) { alias("WhenExpressionChecker") alias("ReturnExpressionChecker") alias("BlockChecker") + alias("AnnotationCallChecker") } val declarationPackage = "org.jetbrains.kotlin.fir.analysis.checkers.declaration" diff --git a/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt b/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt index ad6ac6c36cf..5721a87bed0 100644 --- a/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt +++ b/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt @@ -149,6 +149,7 @@ object DIAGNOSTICS_LIST : DiagnosticList() { val NULLABLE_TYPE_OF_ANNOTATION_MEMBER by error() val VAR_ANNOTATION_PARAMETER by error(PositioningStrategy.VAL_OR_VAR_NODE) val SUPERTYPES_FOR_ANNOTATION_CLASS by error(PositioningStrategy.SUPERTYPES_LIST) + val ANNOTATION_USED_AS_ANNOTATION_ARGUMENT by error() } val EXPOSED_VISIBILITY by object : DiagnosticGroup("Exposed visibility") { diff --git a/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/checkers/expression/ComposedExpressionCheckers.kt b/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/checkers/expression/ComposedExpressionCheckers.kt index c061aa57044..af8684e342c 100644 --- a/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/checkers/expression/ComposedExpressionCheckers.kt +++ b/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/checkers/expression/ComposedExpressionCheckers.kt @@ -29,6 +29,8 @@ internal class ComposedExpressionCheckers : ExpressionCheckers() { get() = _returnExpressionCheckers override val blockCheckers: Set get() = _blockCheckers + override val annotationCallCheckers: Set + get() = _annotationCallCheckers private val _basicExpressionCheckers: MutableSet = mutableSetOf() private val _qualifiedAccessCheckers: MutableSet = mutableSetOf() @@ -38,6 +40,7 @@ internal class ComposedExpressionCheckers : ExpressionCheckers() { private val _whenExpressionCheckers: MutableSet = mutableSetOf() private val _returnExpressionCheckers: MutableSet = mutableSetOf() private val _blockCheckers: MutableSet = mutableSetOf() + private val _annotationCallCheckers: MutableSet = mutableSetOf() @CheckersComponentInternal internal fun register(checkers: ExpressionCheckers) { @@ -49,5 +52,6 @@ internal class ComposedExpressionCheckers : ExpressionCheckers() { _whenExpressionCheckers += checkers.whenExpressionCheckers _returnExpressionCheckers += checkers.returnExpressionCheckers _blockCheckers += checkers.blockCheckers + _annotationCallCheckers += checkers.annotationCallCheckers } } diff --git a/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/checkers/expression/ExpressionCheckers.kt b/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/checkers/expression/ExpressionCheckers.kt index 74fea13924b..b3ec5405907 100644 --- a/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/checkers/expression/ExpressionCheckers.kt +++ b/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/checkers/expression/ExpressionCheckers.kt @@ -25,6 +25,7 @@ abstract class ExpressionCheckers { open val whenExpressionCheckers: Set = emptySet() open val returnExpressionCheckers: Set = emptySet() open val blockCheckers: Set = emptySet() + open val annotationCallCheckers: Set = emptySet() @CheckersComponentInternal internal val allBasicExpressionCheckers: Set get() = basicExpressionCheckers @CheckersComponentInternal internal val allQualifiedAccessCheckers: Set get() = qualifiedAccessCheckers + basicExpressionCheckers @@ -34,4 +35,5 @@ abstract class ExpressionCheckers { @CheckersComponentInternal internal val allWhenExpressionCheckers: Set get() = whenExpressionCheckers + basicExpressionCheckers @CheckersComponentInternal internal val allReturnExpressionCheckers: Set get() = returnExpressionCheckers + basicExpressionCheckers @CheckersComponentInternal internal val allBlockCheckers: Set get() = blockCheckers + basicExpressionCheckers + @CheckersComponentInternal internal val allAnnotationCallCheckers: Set get() = annotationCallCheckers + basicExpressionCheckers } diff --git a/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirExpressionCheckerAliases.kt b/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirExpressionCheckerAliases.kt index b7ce96f83d5..36bf7a857bf 100644 --- a/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirExpressionCheckerAliases.kt +++ b/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirExpressionCheckerAliases.kt @@ -10,6 +10,7 @@ package org.jetbrains.kotlin.fir.analysis.checkers.expression * DO NOT MODIFY IT MANUALLY */ +import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall import org.jetbrains.kotlin.fir.expressions.FirBlock import org.jetbrains.kotlin.fir.expressions.FirFunctionCall import org.jetbrains.kotlin.fir.expressions.FirQualifiedAccessExpression @@ -27,3 +28,4 @@ typealias FirTryExpressionChecker = FirExpressionChecker typealias FirWhenExpressionChecker = FirExpressionChecker typealias FirReturnExpressionChecker = FirExpressionChecker typealias FirBlockChecker = FirExpressionChecker +typealias FirAnnotationCallChecker = FirExpressionChecker diff --git a/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt b/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt index 5aea44cef15..6053ace81a7 100644 --- a/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt +++ b/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt @@ -32,6 +32,7 @@ import org.jetbrains.kotlin.fir.symbols.impl.FirVariableSymbol import org.jetbrains.kotlin.fir.types.ConeKotlinType import org.jetbrains.kotlin.lexer.KtModifierKeywordToken import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.psi.KtAnnotation import org.jetbrains.kotlin.psi.KtArrayAccessExpression import org.jetbrains.kotlin.psi.KtBinaryExpression import org.jetbrains.kotlin.psi.KtClass @@ -155,6 +156,7 @@ object FirErrors { val NULLABLE_TYPE_OF_ANNOTATION_MEMBER by error0() val VAR_ANNOTATION_PARAMETER by error0(SourceElementPositioningStrategies.VAL_OR_VAR_NODE) val SUPERTYPES_FOR_ANNOTATION_CLASS by error0(SourceElementPositioningStrategies.SUPERTYPES_LIST) + val ANNOTATION_USED_AS_ANNOTATION_ARGUMENT by error0() // Exposed visibility val EXPOSED_TYPEALIAS_EXPANDED_TYPE by error3(SourceElementPositioningStrategies.DECLARATION_NAME) diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirAnnotationUsedAsAnnotationArgumentChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirAnnotationUsedAsAnnotationArgumentChecker.kt new file mode 100644 index 00000000000..5814f0beae1 --- /dev/null +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirAnnotationUsedAsAnnotationArgumentChecker.kt @@ -0,0 +1,23 @@ +/* + * Copyright 2010-2021 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.fir.analysis.checkers.expression + +import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext +import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors +import org.jetbrains.kotlin.fir.analysis.diagnostics.reportOn +import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall + +object FirAnnotationUsedAsAnnotationArgumentChecker : FirAnnotationCallChecker() { + override fun check(expression: FirAnnotationCall, context: CheckerContext, reporter: DiagnosticReporter) { + val args = expression.argumentList.arguments + for (arg in args) { + for (ann in arg.annotations) { + reporter.reportOn(ann.source, FirErrors.ANNOTATION_USED_AS_ANNOTATION_ARGUMENT, context) + } + } + } +} \ No newline at end of file diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ExpressionCheckersDiagnosticComponent.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ExpressionCheckersDiagnosticComponent.kt index 111c777b0e4..ec1ee38292e 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ExpressionCheckersDiagnosticComponent.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ExpressionCheckersDiagnosticComponent.kt @@ -34,7 +34,7 @@ class ExpressionCheckersDiagnosticComponent( } override fun visitAnnotationCall(annotationCall: FirAnnotationCall, data: CheckerContext) { - checkers.allBasicExpressionCheckers.check(annotationCall, data, reporter) + checkers.allAnnotationCallCheckers.check(annotationCall, data, reporter) } override fun visitQualifiedAccessExpression(qualifiedAccessExpression: FirQualifiedAccessExpression, data: CheckerContext) { diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt index e3b16d91d0d..8f7f2fab8d9 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt @@ -36,6 +36,7 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ABSTRACT_SUPER_CA import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ANNOTATION_ARGUMENT_MUST_BE_CONST import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ANNOTATION_CLASS_MEMBER import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ANNOTATION_PARAMETER_DEFAULT_VALUE_MUST_BE_CONSTANT +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ANNOTATION_USED_AS_ANNOTATION_ARGUMENT import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ANONYMOUS_FUNCTION_PARAMETER_WITH_DEFAULT_VALUE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ARGUMENT_PASSED_TWICE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ARGUMENT_TYPE_MISMATCH @@ -374,6 +375,7 @@ class FirDefaultErrorMessages : DefaultErrorMessages.Extension { map.put(DATA_CLASS_NOT_PROPERTY_PARAMETER, "Data class primary constructor must have only property (val / var) parameters") // Annotations + map.put(ANNOTATION_USED_AS_ANNOTATION_ARGUMENT, "An annotation can't be used as the annotations argument") map.put(ANNOTATION_CLASS_MEMBER, "Members are not allowed in annotation class") map.put(ANNOTATION_ARGUMENT_MUST_BE_CONST, "An annotation argument must be a compile-time constant") map.put( diff --git a/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/checkers/CommonExpressionCheckers.kt b/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/checkers/CommonExpressionCheckers.kt index 2a7ddd267c2..99e6a5427f8 100644 --- a/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/checkers/CommonExpressionCheckers.kt +++ b/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/checkers/CommonExpressionCheckers.kt @@ -8,6 +8,11 @@ package org.jetbrains.kotlin.fir.checkers import org.jetbrains.kotlin.fir.analysis.checkers.expression.* object CommonExpressionCheckers : ExpressionCheckers() { + override val annotationCallCheckers: Set + get() = setOf( + FirAnnotationUsedAsAnnotationArgumentChecker, + ) + override val basicExpressionCheckers: Set get() = setOf( FirAnonymousFunctionChecker, diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt index 4c7d7ea5a27..f6f5c1adf91 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt @@ -19,6 +19,7 @@ import org.jetbrains.kotlin.fir.declarations.FirSimpleFunction import org.jetbrains.kotlin.fir.declarations.FirTypeParameter import org.jetbrains.kotlin.fir.declarations.FirVariable import org.jetbrains.kotlin.fir.psi +import org.jetbrains.kotlin.psi.KtAnnotation import org.jetbrains.kotlin.psi.KtArrayAccessExpression import org.jetbrains.kotlin.psi.KtBinaryExpression import org.jetbrains.kotlin.psi.KtClass @@ -500,6 +501,12 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert token, ) } + add(FirErrors.ANNOTATION_USED_AS_ANNOTATION_ARGUMENT) { firDiagnostic -> + AnnotationUsedAsAnnotationArgumentImpl( + firDiagnostic as FirPsiDiagnostic<*>, + token, + ) + } add(FirErrors.EXPOSED_TYPEALIAS_EXPANDED_TYPE) { firDiagnostic -> ExposedTypealiasExpandedTypeImpl( firDiagnostic.a, diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnostics.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnostics.kt index a98fdd6b930..803ca87abfd 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnostics.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnostics.kt @@ -25,6 +25,7 @@ import org.jetbrains.kotlin.idea.frontend.api.symbols.KtVariableSymbol import org.jetbrains.kotlin.idea.frontend.api.types.KtType import org.jetbrains.kotlin.lexer.KtModifierKeywordToken import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.psi.KtAnnotation import org.jetbrains.kotlin.psi.KtArrayAccessExpression import org.jetbrains.kotlin.psi.KtBinaryExpression import org.jetbrains.kotlin.psi.KtClass @@ -361,6 +362,10 @@ sealed class KtFirDiagnostic : KtDiagnosticWithPsi { override val diagnosticClass get() = SupertypesForAnnotationClass::class } + abstract class AnnotationUsedAsAnnotationArgument : KtFirDiagnostic() { + override val diagnosticClass get() = AnnotationUsedAsAnnotationArgument::class + } + abstract class ExposedTypealiasExpandedType : KtFirDiagnostic() { override val diagnosticClass get() = ExposedTypealiasExpandedType::class abstract val elementVisibility: EffectiveVisibility diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt index 240cb097fa9..582815d086f 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt @@ -27,6 +27,7 @@ import org.jetbrains.kotlin.idea.frontend.api.tokens.ValidityToken import org.jetbrains.kotlin.idea.frontend.api.types.KtType import org.jetbrains.kotlin.lexer.KtModifierKeywordToken import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.psi.KtAnnotation import org.jetbrains.kotlin.psi.KtArrayAccessExpression import org.jetbrains.kotlin.psi.KtBinaryExpression import org.jetbrains.kotlin.psi.KtClass @@ -581,6 +582,13 @@ internal class SupertypesForAnnotationClassImpl( override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) } +internal class AnnotationUsedAsAnnotationArgumentImpl( + firDiagnostic: FirPsiDiagnostic<*>, + override val token: ValidityToken, +) : KtFirDiagnostic.AnnotationUsedAsAnnotationArgument(), KtAbstractFirDiagnostic { + override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) +} + internal class ExposedTypealiasExpandedTypeImpl( override val elementVisibility: EffectiveVisibility, override val restrictingDeclaration: KtSymbol,