[FIR] Add DNN checks
Merge-request: KT-MR-7000 Merged-by: Nikolay Lunyak <lunyak.kolya@mail.ru>
This commit is contained in:
+18
@@ -2015,6 +2015,24 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.INCORRECT_LEFT_COMPONENT_OF_INTERSECTION) { firDiagnostic ->
|
||||
IncorrectLeftComponentOfIntersectionImpl(
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.INCORRECT_RIGHT_COMPONENT_OF_INTERSECTION) { firDiagnostic ->
|
||||
IncorrectRightComponentOfIntersectionImpl(
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.NULLABLE_ON_DEFINITELY_NOT_NULLABLE) { firDiagnostic ->
|
||||
NullableOnDefinitelyNotNullableImpl(
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.EXTENSION_IN_CLASS_REFERENCE_NOT_ALLOWED) { firDiagnostic ->
|
||||
ExtensionInClassReferenceNotAllowedImpl(
|
||||
firSymbolBuilder.callableBuilder.buildCallableSymbol(firDiagnostic.a),
|
||||
|
||||
+12
@@ -1435,6 +1435,18 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
abstract val causingTypes: String
|
||||
}
|
||||
|
||||
abstract class IncorrectLeftComponentOfIntersection : KtFirDiagnostic<KtTypeReference>() {
|
||||
override val diagnosticClass get() = IncorrectLeftComponentOfIntersection::class
|
||||
}
|
||||
|
||||
abstract class IncorrectRightComponentOfIntersection : KtFirDiagnostic<KtTypeReference>() {
|
||||
override val diagnosticClass get() = IncorrectRightComponentOfIntersection::class
|
||||
}
|
||||
|
||||
abstract class NullableOnDefinitelyNotNullable : KtFirDiagnostic<KtTypeReference>() {
|
||||
override val diagnosticClass get() = NullableOnDefinitelyNotNullable::class
|
||||
}
|
||||
|
||||
abstract class ExtensionInClassReferenceNotAllowed : KtFirDiagnostic<KtExpression>() {
|
||||
override val diagnosticClass get() = ExtensionInClassReferenceNotAllowed::class
|
||||
abstract val referencedDeclaration: KtCallableSymbol
|
||||
|
||||
+15
@@ -1722,6 +1722,21 @@ internal class InferredTypeVariableIntoPossibleEmptyIntersectionImpl(
|
||||
override val token: KtLifetimeToken,
|
||||
) : KtFirDiagnostic.InferredTypeVariableIntoPossibleEmptyIntersection(), KtAbstractFirDiagnostic<PsiElement>
|
||||
|
||||
internal class IncorrectLeftComponentOfIntersectionImpl(
|
||||
override val firDiagnostic: KtPsiDiagnostic,
|
||||
override val token: KtLifetimeToken,
|
||||
) : KtFirDiagnostic.IncorrectLeftComponentOfIntersection(), KtAbstractFirDiagnostic<KtTypeReference>
|
||||
|
||||
internal class IncorrectRightComponentOfIntersectionImpl(
|
||||
override val firDiagnostic: KtPsiDiagnostic,
|
||||
override val token: KtLifetimeToken,
|
||||
) : KtFirDiagnostic.IncorrectRightComponentOfIntersection(), KtAbstractFirDiagnostic<KtTypeReference>
|
||||
|
||||
internal class NullableOnDefinitelyNotNullableImpl(
|
||||
override val firDiagnostic: KtPsiDiagnostic,
|
||||
override val token: KtLifetimeToken,
|
||||
) : KtFirDiagnostic.NullableOnDefinitelyNotNullable(), KtAbstractFirDiagnostic<KtTypeReference>
|
||||
|
||||
internal class ExtensionInClassReferenceNotAllowedImpl(
|
||||
override val referencedDeclaration: KtCallableSymbol,
|
||||
override val firDiagnostic: KtPsiDiagnostic,
|
||||
|
||||
Reference in New Issue
Block a user