From 3e88fc80d2ff7f16c04d73277679776ac63c41aa Mon Sep 17 00:00:00 2001 From: Svyatoslav Kuzmich Date: Tue, 21 Nov 2023 15:57:40 +0100 Subject: [PATCH] [AA] Regenerate AA after moving diagnostics from js to web.common --- .../diagnostics/KtFirDataClassConverters.kt | 80 +++++++++---------- .../api/fir/diagnostics/KtFirDiagnostics.kt | 56 ++++++------- .../fir/diagnostics/KtFirDiagnosticsImpl.kt | 68 ++++++++-------- 3 files changed, 102 insertions(+), 102 deletions(-) diff --git a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/diagnostics/KtFirDataClassConverters.kt b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/diagnostics/KtFirDataClassConverters.kt index 51996fedea6..ad428dd2f39 100644 --- a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/diagnostics/KtFirDataClassConverters.kt +++ b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/diagnostics/KtFirDataClassConverters.kt @@ -1188,12 +1188,6 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert token, ) } - add(FirJsErrors.WRONG_JS_QUALIFIER) { firDiagnostic -> - WrongJsQualifierImpl( - firDiagnostic as KtPsiDiagnostic, - token, - ) - } add(FirJsErrors.JS_MODULE_PROHIBITED_ON_VAR) { firDiagnostic -> JsModuleProhibitedOnVarImpl( firDiagnostic as KtPsiDiagnostic, @@ -1355,6 +1349,12 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert token, ) } + add(FirWebCommonErrors.WRONG_JS_QUALIFIER) { firDiagnostic -> + WrongJsQualifierImpl( + firDiagnostic as KtPsiDiagnostic, + token, + ) + } add(FirErrors.OPT_IN_USAGE) { firDiagnostic -> OptInUsageImpl( firDiagnostic.a, @@ -5545,27 +5545,6 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert token, ) } - add(FirJsErrors.CANNOT_CHECK_FOR_EXTERNAL_INTERFACE) { firDiagnostic -> - CannotCheckForExternalInterfaceImpl( - firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), - firDiagnostic as KtPsiDiagnostic, - token, - ) - } - add(FirJsErrors.UNCHECKED_CAST_TO_EXTERNAL_INTERFACE) { firDiagnostic -> - UncheckedCastToExternalInterfaceImpl( - firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), - firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b), - firDiagnostic as KtPsiDiagnostic, - token, - ) - } - add(FirJsErrors.EXTERNAL_INTERFACE_AS_CLASS_LITERAL) { firDiagnostic -> - ExternalInterfaceAsClassLiteralImpl( - firDiagnostic as KtPsiDiagnostic, - token, - ) - } add(FirJsErrors.JS_EXTERNAL_INHERITORS_ONLY) { firDiagnostic -> JsExternalInheritorsOnlyImpl( firSymbolBuilder.classifierBuilder.buildClassLikeSymbol(firDiagnostic.a), @@ -5581,19 +5560,6 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert token, ) } - add(FirJsErrors.EXTERNAL_INTERFACE_AS_REIFIED_TYPE_ARGUMENT) { firDiagnostic -> - ExternalInterfaceAsReifiedTypeArgumentImpl( - firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), - firDiagnostic as KtPsiDiagnostic, - token, - ) - } - add(FirJsErrors.NESTED_JS_EXPORT) { firDiagnostic -> - NestedJsExportImpl( - firDiagnostic as KtPsiDiagnostic, - token, - ) - } add(FirJsErrors.WRONG_EXPORTED_DECLARATION) { firDiagnostic -> WrongExportedDeclarationImpl( firDiagnostic.a, @@ -5616,6 +5582,12 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert token, ) } + add(FirWebCommonErrors.NESTED_JS_EXPORT) { firDiagnostic -> + NestedJsExportImpl( + firDiagnostic as KtPsiDiagnostic, + token, + ) + } add(FirJsErrors.DELEGATION_BY_DYNAMIC) { firDiagnostic -> DelegationByDynamicImpl( firDiagnostic as KtPsiDiagnostic, @@ -5721,6 +5693,34 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert token, ) } + add(FirWebCommonErrors.CANNOT_CHECK_FOR_EXTERNAL_INTERFACE) { firDiagnostic -> + CannotCheckForExternalInterfaceImpl( + firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), + firDiagnostic as KtPsiDiagnostic, + token, + ) + } + add(FirWebCommonErrors.UNCHECKED_CAST_TO_EXTERNAL_INTERFACE) { firDiagnostic -> + UncheckedCastToExternalInterfaceImpl( + firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), + firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b), + firDiagnostic as KtPsiDiagnostic, + token, + ) + } + add(FirWebCommonErrors.EXTERNAL_INTERFACE_AS_CLASS_LITERAL) { firDiagnostic -> + ExternalInterfaceAsClassLiteralImpl( + firDiagnostic as KtPsiDiagnostic, + token, + ) + } + add(FirWebCommonErrors.EXTERNAL_INTERFACE_AS_REIFIED_TYPE_ARGUMENT) { firDiagnostic -> + ExternalInterfaceAsReifiedTypeArgumentImpl( + firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), + firDiagnostic as KtPsiDiagnostic, + token, + ) + } add(FirWebCommonErrors.JSCODE_ARGUMENT_NON_CONST_EXPRESSION) { firDiagnostic -> JscodeArgumentNonConstExpressionImpl( firDiagnostic as KtPsiDiagnostic, diff --git a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/diagnostics/KtFirDiagnostics.kt b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/diagnostics/KtFirDiagnostics.kt index 26569950378..e54d9fcdf1c 100644 --- a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/diagnostics/KtFirDiagnostics.kt +++ b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/diagnostics/KtFirDiagnostics.kt @@ -861,10 +861,6 @@ sealed interface KtFirDiagnostic : KtDiagnosticWithPsi { override val diagnosticClass get() = PotentiallyNonReportedAnnotation::class } - interface WrongJsQualifier : KtFirDiagnostic { - override val diagnosticClass get() = WrongJsQualifier::class - } - interface JsModuleProhibitedOnVar : KtFirDiagnostic { override val diagnosticClass get() = JsModuleProhibitedOnVar::class } @@ -974,6 +970,10 @@ sealed interface KtFirDiagnostic : KtDiagnosticWithPsi { val existing: List } + interface WrongJsQualifier : KtFirDiagnostic { + override val diagnosticClass get() = WrongJsQualifier::class + } + interface OptInUsage : KtFirDiagnostic { override val diagnosticClass get() = OptInUsage::class val optInMarkerFqName: FqName @@ -3856,21 +3856,6 @@ sealed interface KtFirDiagnostic : KtDiagnosticWithPsi { val type: KtType } - interface CannotCheckForExternalInterface : KtFirDiagnostic { - override val diagnosticClass get() = CannotCheckForExternalInterface::class - val targetType: KtType - } - - interface UncheckedCastToExternalInterface : KtFirDiagnostic { - override val diagnosticClass get() = UncheckedCastToExternalInterface::class - val sourceType: KtType - val targetType: KtType - } - - interface ExternalInterfaceAsClassLiteral : KtFirDiagnostic { - override val diagnosticClass get() = ExternalInterfaceAsClassLiteral::class - } - interface JsExternalInheritorsOnly : KtFirDiagnostic { override val diagnosticClass get() = JsExternalInheritorsOnly::class val parent: KtClassLikeSymbol @@ -3882,15 +3867,6 @@ sealed interface KtFirDiagnostic : KtDiagnosticWithPsi { val argType: KtType } - interface ExternalInterfaceAsReifiedTypeArgument : KtFirDiagnostic { - override val diagnosticClass get() = ExternalInterfaceAsReifiedTypeArgument::class - val typeArgument: KtType - } - - interface NestedJsExport : KtFirDiagnostic { - override val diagnosticClass get() = NestedJsExport::class - } - interface WrongExportedDeclaration : KtFirDiagnostic { override val diagnosticClass get() = WrongExportedDeclaration::class val kind: String @@ -3907,6 +3883,10 @@ sealed interface KtFirDiagnostic : KtDiagnosticWithPsi { val name: String } + interface NestedJsExport : KtFirDiagnostic { + override val diagnosticClass get() = NestedJsExport::class + } + interface DelegationByDynamic : KtFirDiagnostic { override val diagnosticClass get() = DelegationByDynamic::class } @@ -3978,6 +3958,26 @@ sealed interface KtFirDiagnostic : KtDiagnosticWithPsi { override val diagnosticClass get() = WrongDefaultValueForExternalFunParameter::class } + interface CannotCheckForExternalInterface : KtFirDiagnostic { + override val diagnosticClass get() = CannotCheckForExternalInterface::class + val targetType: KtType + } + + interface UncheckedCastToExternalInterface : KtFirDiagnostic { + override val diagnosticClass get() = UncheckedCastToExternalInterface::class + val sourceType: KtType + val targetType: KtType + } + + interface ExternalInterfaceAsClassLiteral : KtFirDiagnostic { + override val diagnosticClass get() = ExternalInterfaceAsClassLiteral::class + } + + interface ExternalInterfaceAsReifiedTypeArgument : KtFirDiagnostic { + override val diagnosticClass get() = ExternalInterfaceAsReifiedTypeArgument::class + val typeArgument: KtType + } + interface JscodeArgumentNonConstExpression : KtFirDiagnostic { override val diagnosticClass get() = JscodeArgumentNonConstExpression::class } diff --git a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/diagnostics/KtFirDiagnosticsImpl.kt b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/diagnostics/KtFirDiagnosticsImpl.kt index 59c2485474f..bb720443987 100644 --- a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/diagnostics/KtFirDiagnosticsImpl.kt +++ b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/diagnostics/KtFirDiagnosticsImpl.kt @@ -1031,11 +1031,6 @@ internal class PotentiallyNonReportedAnnotationImpl( token: KtLifetimeToken, ) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.PotentiallyNonReportedAnnotation -internal class WrongJsQualifierImpl( - firDiagnostic: KtPsiDiagnostic, - token: KtLifetimeToken, -) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.WrongJsQualifier - internal class JsModuleProhibitedOnVarImpl( firDiagnostic: KtPsiDiagnostic, token: KtLifetimeToken, @@ -1169,6 +1164,11 @@ internal class JsFakeNameClashImpl( token: KtLifetimeToken, ) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.JsFakeNameClash +internal class WrongJsQualifierImpl( + firDiagnostic: KtPsiDiagnostic, + token: KtLifetimeToken, +) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.WrongJsQualifier + internal class OptInUsageImpl( override val optInMarkerFqName: FqName, override val message: String, @@ -4657,24 +4657,6 @@ internal class NonExternalDeclarationInInappropriateFileImpl( token: KtLifetimeToken, ) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.NonExternalDeclarationInInappropriateFile -internal class CannotCheckForExternalInterfaceImpl( - override val targetType: KtType, - firDiagnostic: KtPsiDiagnostic, - token: KtLifetimeToken, -) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.CannotCheckForExternalInterface - -internal class UncheckedCastToExternalInterfaceImpl( - override val sourceType: KtType, - override val targetType: KtType, - firDiagnostic: KtPsiDiagnostic, - token: KtLifetimeToken, -) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.UncheckedCastToExternalInterface - -internal class ExternalInterfaceAsClassLiteralImpl( - firDiagnostic: KtPsiDiagnostic, - token: KtLifetimeToken, -) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.ExternalInterfaceAsClassLiteral - internal class JsExternalInheritorsOnlyImpl( override val parent: KtClassLikeSymbol, override val kid: KtClassLikeSymbol, @@ -4688,17 +4670,6 @@ internal class JsExternalArgumentImpl( token: KtLifetimeToken, ) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.JsExternalArgument -internal class ExternalInterfaceAsReifiedTypeArgumentImpl( - override val typeArgument: KtType, - firDiagnostic: KtPsiDiagnostic, - token: KtLifetimeToken, -) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.ExternalInterfaceAsReifiedTypeArgument - -internal class NestedJsExportImpl( - firDiagnostic: KtPsiDiagnostic, - token: KtLifetimeToken, -) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.NestedJsExport - internal class WrongExportedDeclarationImpl( override val kind: String, firDiagnostic: KtPsiDiagnostic, @@ -4718,6 +4689,11 @@ internal class NonConsumableExportedIdentifierImpl( token: KtLifetimeToken, ) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.NonConsumableExportedIdentifier +internal class NestedJsExportImpl( + firDiagnostic: KtPsiDiagnostic, + token: KtLifetimeToken, +) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.NestedJsExport + internal class DelegationByDynamicImpl( firDiagnostic: KtPsiDiagnostic, token: KtLifetimeToken, @@ -4806,6 +4782,30 @@ internal class WrongDefaultValueForExternalFunParameterImpl( token: KtLifetimeToken, ) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.WrongDefaultValueForExternalFunParameter +internal class CannotCheckForExternalInterfaceImpl( + override val targetType: KtType, + firDiagnostic: KtPsiDiagnostic, + token: KtLifetimeToken, +) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.CannotCheckForExternalInterface + +internal class UncheckedCastToExternalInterfaceImpl( + override val sourceType: KtType, + override val targetType: KtType, + firDiagnostic: KtPsiDiagnostic, + token: KtLifetimeToken, +) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.UncheckedCastToExternalInterface + +internal class ExternalInterfaceAsClassLiteralImpl( + firDiagnostic: KtPsiDiagnostic, + token: KtLifetimeToken, +) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.ExternalInterfaceAsClassLiteral + +internal class ExternalInterfaceAsReifiedTypeArgumentImpl( + override val typeArgument: KtType, + firDiagnostic: KtPsiDiagnostic, + token: KtLifetimeToken, +) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.ExternalInterfaceAsReifiedTypeArgument + internal class JscodeArgumentNonConstExpressionImpl( firDiagnostic: KtPsiDiagnostic, token: KtLifetimeToken,