FIR checker: pass expected array type in ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION
This is needed by the IDE quickfix to generate the correct `arrayOf` (or `intArrayOf`, etc`) wrapper call.
This commit is contained in:
+2
@@ -1475,12 +1475,14 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
}
|
||||
add(FirErrors.ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION.errorFactory) { firDiagnostic ->
|
||||
AssigningSingleElementToVarargInNamedFormFunctionErrorImpl(
|
||||
firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a),
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION.warningFactory) { firDiagnostic ->
|
||||
AssigningSingleElementToVarargInNamedFormFunctionWarningImpl(
|
||||
firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a),
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
|
||||
+2
@@ -1062,10 +1062,12 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
|
||||
abstract class AssigningSingleElementToVarargInNamedFormFunctionError : KtFirDiagnostic<KtExpression>() {
|
||||
override val diagnosticClass get() = AssigningSingleElementToVarargInNamedFormFunctionError::class
|
||||
abstract val expectedArrayType: KtType
|
||||
}
|
||||
|
||||
abstract class AssigningSingleElementToVarargInNamedFormFunctionWarning : KtFirDiagnostic<KtExpression>() {
|
||||
override val diagnosticClass get() = AssigningSingleElementToVarargInNamedFormFunctionWarning::class
|
||||
abstract val expectedArrayType: KtType
|
||||
}
|
||||
|
||||
abstract class AssigningSingleElementToVarargInNamedFormAnnotationError : KtFirDiagnostic<KtExpression>() {
|
||||
|
||||
+2
@@ -1270,11 +1270,13 @@ internal class SpreadOfNullableImpl(
|
||||
) : KtFirDiagnostic.SpreadOfNullable(), KtAbstractFirDiagnostic<PsiElement>
|
||||
|
||||
internal class AssigningSingleElementToVarargInNamedFormFunctionErrorImpl(
|
||||
override val expectedArrayType: KtType,
|
||||
override val firDiagnostic: KtPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
) : KtFirDiagnostic.AssigningSingleElementToVarargInNamedFormFunctionError(), KtAbstractFirDiagnostic<KtExpression>
|
||||
|
||||
internal class AssigningSingleElementToVarargInNamedFormFunctionWarningImpl(
|
||||
override val expectedArrayType: KtType,
|
||||
override val firDiagnostic: KtPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
) : KtFirDiagnostic.AssigningSingleElementToVarargInNamedFormFunctionWarning(), KtAbstractFirDiagnostic<KtExpression>
|
||||
|
||||
Reference in New Issue
Block a user