[IR] Support ACTUAL_ANNOTATION_CONFLICTING_DEFAULT_ARGUMENT_VALUE in K2
It's implemented as IR checker because in K2 constant expressions are evaluated on backend. FIR diagnostic removed because isn't needed. "annotationViaActualTypeAlias" test has no `// FIR_IDENTICAL` because diagnostic reported on entire typealias declaration instead of its name. This is because in IR+LightTree we have only offsets, so can't navigate to typealias name element. ^KT-59940 Fixed
This commit is contained in:
committed by
Space Team
parent
ce666182a2
commit
ad4d1a5ba8
-7
@@ -3604,13 +3604,6 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.ACTUAL_ANNOTATION_CONFLICTING_DEFAULT_ARGUMENT_VALUE) { firDiagnostic ->
|
||||
ActualAnnotationConflictingDefaultArgumentValueImpl(
|
||||
firSymbolBuilder.variableLikeBuilder.buildVariableLikeSymbol(firDiagnostic.a),
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.EXPECTED_FUNCTION_SOURCE_WITH_DEFAULT_ARGUMENTS_NOT_FOUND) { firDiagnostic ->
|
||||
ExpectedFunctionSourceWithDefaultArgumentsNotFoundImpl(
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
|
||||
-5
@@ -2536,11 +2536,6 @@ sealed interface KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
val members: List<KtCallableSymbol>
|
||||
}
|
||||
|
||||
interface ActualAnnotationConflictingDefaultArgumentValue : KtFirDiagnostic<PsiElement> {
|
||||
override val diagnosticClass get() = ActualAnnotationConflictingDefaultArgumentValue::class
|
||||
val parameter: KtVariableLikeSymbol
|
||||
}
|
||||
|
||||
interface ExpectedFunctionSourceWithDefaultArgumentsNotFound : KtFirDiagnostic<PsiElement> {
|
||||
override val diagnosticClass get() = ExpectedFunctionSourceWithDefaultArgumentsNotFound::class
|
||||
}
|
||||
|
||||
-6
@@ -3057,12 +3057,6 @@ internal class DefaultArgumentsInExpectWithActualTypealiasImpl(
|
||||
token: KtLifetimeToken,
|
||||
) : KtAbstractFirDiagnostic<KtTypeAlias>(firDiagnostic, token), KtFirDiagnostic.DefaultArgumentsInExpectWithActualTypealias
|
||||
|
||||
internal class ActualAnnotationConflictingDefaultArgumentValueImpl(
|
||||
override val parameter: KtVariableLikeSymbol,
|
||||
firDiagnostic: KtPsiDiagnostic,
|
||||
token: KtLifetimeToken,
|
||||
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.ActualAnnotationConflictingDefaultArgumentValue
|
||||
|
||||
internal class ExpectedFunctionSourceWithDefaultArgumentsNotFoundImpl(
|
||||
firDiagnostic: KtPsiDiagnostic,
|
||||
token: KtLifetimeToken,
|
||||
|
||||
Reference in New Issue
Block a user