[K2] Warn about deprecation and opt-in markers for overrides of Any
^KT-62620 Fixed Include opt-in markers in the diagnostics
This commit is contained in:
committed by
Space Team
parent
6afe716238
commit
b9b15cba08
+6
@@ -1195,6 +1195,12 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.POTENTIALLY_NON_REPORTED_ANNOTATION) { firDiagnostic ->
|
||||
PotentiallyNonReportedAnnotationImpl(
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirJsErrors.WRONG_JS_QUALIFIER) { firDiagnostic ->
|
||||
WrongJsQualifierImpl(
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
|
||||
+4
@@ -867,6 +867,10 @@ sealed interface KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
override val diagnosticClass get() = NonSourceAnnotationOnInlinedLambdaExpression::class
|
||||
}
|
||||
|
||||
interface PotentiallyNonReportedAnnotation : KtFirDiagnostic<KtAnnotationEntry> {
|
||||
override val diagnosticClass get() = PotentiallyNonReportedAnnotation::class
|
||||
}
|
||||
|
||||
interface WrongJsQualifier : KtFirDiagnostic<KtElement> {
|
||||
override val diagnosticClass get() = WrongJsQualifier::class
|
||||
}
|
||||
|
||||
+5
@@ -1038,6 +1038,11 @@ internal class NonSourceAnnotationOnInlinedLambdaExpressionImpl(
|
||||
token: KtLifetimeToken,
|
||||
) : KtAbstractFirDiagnostic<KtAnnotationEntry>(firDiagnostic, token), KtFirDiagnostic.NonSourceAnnotationOnInlinedLambdaExpression
|
||||
|
||||
internal class PotentiallyNonReportedAnnotationImpl(
|
||||
firDiagnostic: KtPsiDiagnostic,
|
||||
token: KtLifetimeToken,
|
||||
) : KtAbstractFirDiagnostic<KtAnnotationEntry>(firDiagnostic, token), KtFirDiagnostic.PotentiallyNonReportedAnnotation
|
||||
|
||||
internal class WrongJsQualifierImpl(
|
||||
firDiagnostic: KtPsiDiagnostic,
|
||||
token: KtLifetimeToken,
|
||||
|
||||
+6
@@ -1878,6 +1878,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/Deprecated.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("DeprecationOnAny.kt")
|
||||
public void testDeprecationOnAny() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/DeprecationOnAny.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("dontReportWarningAboutChangingExecutionOrderForVararg.kt")
|
||||
public void testDontReportWarningAboutChangingExecutionOrderForVararg() throws Exception {
|
||||
|
||||
+6
@@ -1878,6 +1878,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/Deprecated.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("DeprecationOnAny.kt")
|
||||
public void testDeprecationOnAny() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/DeprecationOnAny.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("dontReportWarningAboutChangingExecutionOrderForVararg.kt")
|
||||
public void testDontReportWarningAboutChangingExecutionOrderForVararg() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user