K2: Get rid of last unhandled CheckerContext modification

Previously, it was necessary because otherwise reporting diagnostics
from a checker of FirFile level didn't work

Now, it has been fixed in the previous commit
This commit is contained in:
Denis.Zharkov
2023-02-08 11:15:54 +01:00
committed by Space Team
parent a71251d856
commit aa8885ddfc
@@ -232,8 +232,6 @@ object FirConflictsChecker : FirBasicDeclarationChecker() {
} }
} }
context.addDeclaration(declaration)
try {
inspector.declarationConflictingSymbols.forEach { (conflictingDeclaration, symbols) -> inspector.declarationConflictingSymbols.forEach { (conflictingDeclaration, symbols) ->
val source = conflictingDeclaration.source val source = conflictingDeclaration.source
if (source != null && symbols.isNotEmpty()) { if (source != null && symbols.isNotEmpty()) {
@@ -272,9 +270,6 @@ object FirConflictsChecker : FirBasicDeclarationChecker() {
} }
} }
} }
} finally {
context.dropDeclaration()
}
} }
private fun checkConflictingParameters(parameters: List<FirElement>, context: CheckerContext, reporter: DiagnosticReporter) { private fun checkConflictingParameters(parameters: List<FirElement>, context: CheckerContext, reporter: DiagnosticReporter) {
@@ -381,5 +376,3 @@ private fun FirRegularClass.onConstructors(action: (ctor: FirConstructor) -> Uni
acceptChildren(ClassConstructorVisitor()) acceptChildren(ClassConstructorVisitor())
} }
} }