K2: add ConeKotlinType argument for NULL_FOR_NONNULL_TYPE

This commit is contained in:
Mikhail Glukhikh
2023-06-22 16:45:05 +02:00
committed by Space Team
parent 9d9d7880af
commit 17da09bf17
14 changed files with 16 additions and 11 deletions
@@ -1718,6 +1718,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
}
add(FirErrors.NULL_FOR_NONNULL_TYPE) { firDiagnostic ->
NullForNonnullTypeImpl(
firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a),
firDiagnostic as KtPsiDiagnostic,
token,
)
@@ -1234,6 +1234,7 @@ sealed interface KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
interface NullForNonnullType : KtFirDiagnostic<PsiElement> {
override val diagnosticClass get() = NullForNonnullType::class
val expectedType: KtType
}
interface InapplicableLateinitModifier : KtFirDiagnostic<KtModifierListOwner> {
@@ -1479,6 +1479,7 @@ internal class ArgumentTypeMismatchImpl(
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.ArgumentTypeMismatch
internal class NullForNonnullTypeImpl(
override val expectedType: KtType,
firDiagnostic: KtPsiDiagnostic,
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.NullForNonnullType