[FIR] Add PLATFORM_CLASS_MAPPED_TO_KOTLIN

This commit is contained in:
Ivan Kochurkin
2021-11-23 18:08:35 +03:00
committed by TeamCityServer
parent 51b73bb6ae
commit f046f2964b
49 changed files with 180 additions and 127 deletions
@@ -1897,6 +1897,13 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
token,
)
}
add(FirErrors.PLATFORM_CLASS_MAPPED_TO_KOTLIN) { firDiagnostic ->
PlatformClassMappedToKotlinImpl(
firDiagnostic.a,
firDiagnostic as KtPsiDiagnostic,
token,
)
}
add(FirErrors.EXTENSION_IN_CLASS_REFERENCE_NOT_ALLOWED) { firDiagnostic ->
ExtensionInClassReferenceNotAllowedImpl(
firSymbolBuilder.callableBuilder.buildCallableSymbol(firDiagnostic.a.fir),
@@ -1352,6 +1352,11 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
override val diagnosticClass get() = RedundantNullable::class
}
abstract class PlatformClassMappedToKotlin : KtFirDiagnostic<PsiElement>() {
override val diagnosticClass get() = PlatformClassMappedToKotlin::class
abstract val kotlinClass: FqName
}
abstract class ExtensionInClassReferenceNotAllowed : KtFirDiagnostic<KtExpression>() {
override val diagnosticClass get() = ExtensionInClassReferenceNotAllowed::class
abstract val referencedDeclaration: KtCallableSymbol
@@ -1622,6 +1622,12 @@ internal class RedundantNullableImpl(
override val token: ValidityToken,
) : KtFirDiagnostic.RedundantNullable(), KtAbstractFirDiagnostic<KtTypeReference>
internal class PlatformClassMappedToKotlinImpl(
override val kotlinClass: FqName,
override val firDiagnostic: KtPsiDiagnostic,
override val token: ValidityToken,
) : KtFirDiagnostic.PlatformClassMappedToKotlin(), KtAbstractFirDiagnostic<PsiElement>
internal class ExtensionInClassReferenceNotAllowedImpl(
override val referencedDeclaration: KtCallableSymbol,
override val firDiagnostic: KtPsiDiagnostic,