K2: get rid of manual diagnostic suppression in checkers
This commit is contained in:
+2
@@ -14,6 +14,7 @@ import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext
|
||||
import org.jetbrains.kotlin.fir.analysis.collectors.components.AbstractDiagnosticCollectorComponent
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.resolve.SessionHolderImpl
|
||||
import org.jetbrains.kotlin.name.StandardClassIds
|
||||
|
||||
internal abstract class FileStructureElementDiagnosticRetriever {
|
||||
abstract fun retrieve(
|
||||
@@ -60,6 +61,7 @@ internal class SingleNonLocalDeclarationDiagnosticRetriever(
|
||||
return when {
|
||||
structureElementDeclaration !is FirRegularClass -> true
|
||||
structureElementDeclaration == declaration -> true
|
||||
declaration.hasAnnotation(StandardClassIds.Annotations.Suppress) -> true
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -4216,6 +4216,12 @@ public class DiagnosisCompilerFirTestdataTestGenerated extends AbstractDiagnosis
|
||||
public void testWithSuppression() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/suppress/withSuppression.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("withSuppression2.kt")
|
||||
public void testWithSuppression2() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/suppress/withSuppression2.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
|
||||
Reference in New Issue
Block a user