[FIR JS] Report rtti-related diagnostics
This commit is contained in:
+21
@@ -4960,6 +4960,27 @@ 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.DELEGATION_BY_DYNAMIC) { firDiagnostic ->
|
||||
DelegationByDynamicImpl(
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
|
||||
+15
@@ -3447,6 +3447,21 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
abstract val type: KtType
|
||||
}
|
||||
|
||||
abstract class CannotCheckForExternalInterface : KtFirDiagnostic<KtElement>() {
|
||||
override val diagnosticClass get() = CannotCheckForExternalInterface::class
|
||||
abstract val targetType: KtType
|
||||
}
|
||||
|
||||
abstract class UncheckedCastToExternalInterface : KtFirDiagnostic<KtElement>() {
|
||||
override val diagnosticClass get() = UncheckedCastToExternalInterface::class
|
||||
abstract val sourceType: KtType
|
||||
abstract val targetType: KtType
|
||||
}
|
||||
|
||||
abstract class ExternalInterfaceAsClassLiteral : KtFirDiagnostic<KtElement>() {
|
||||
override val diagnosticClass get() = ExternalInterfaceAsClassLiteral::class
|
||||
}
|
||||
|
||||
abstract class DelegationByDynamic : KtFirDiagnostic<KtElement>() {
|
||||
override val diagnosticClass get() = DelegationByDynamic::class
|
||||
}
|
||||
|
||||
+18
@@ -4172,6 +4172,24 @@ internal class NonExternalDeclarationInInappropriateFileImpl(
|
||||
override val token: KtLifetimeToken,
|
||||
) : KtFirDiagnostic.NonExternalDeclarationInInappropriateFile(), KtAbstractFirDiagnostic<KtElement>
|
||||
|
||||
internal class CannotCheckForExternalInterfaceImpl(
|
||||
override val targetType: KtType,
|
||||
override val firDiagnostic: KtPsiDiagnostic,
|
||||
override val token: KtLifetimeToken,
|
||||
) : KtFirDiagnostic.CannotCheckForExternalInterface(), KtAbstractFirDiagnostic<KtElement>
|
||||
|
||||
internal class UncheckedCastToExternalInterfaceImpl(
|
||||
override val sourceType: KtType,
|
||||
override val targetType: KtType,
|
||||
override val firDiagnostic: KtPsiDiagnostic,
|
||||
override val token: KtLifetimeToken,
|
||||
) : KtFirDiagnostic.UncheckedCastToExternalInterface(), KtAbstractFirDiagnostic<KtElement>
|
||||
|
||||
internal class ExternalInterfaceAsClassLiteralImpl(
|
||||
override val firDiagnostic: KtPsiDiagnostic,
|
||||
override val token: KtLifetimeToken,
|
||||
) : KtFirDiagnostic.ExternalInterfaceAsClassLiteral(), KtAbstractFirDiagnostic<KtElement>
|
||||
|
||||
internal class DelegationByDynamicImpl(
|
||||
override val firDiagnostic: KtPsiDiagnostic,
|
||||
override val token: KtLifetimeToken,
|
||||
|
||||
Reference in New Issue
Block a user