FIR: fix lookup tracking in conflicts checker for LT

since it relies on the correct context declaration
This commit is contained in:
Ilya Chernikov
2021-12-28 15:50:13 +01:00
committed by teamcity
parent 0446a21b46
commit 2689ebf455
@@ -222,6 +222,8 @@ 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()) {
@@ -260,6 +262,9 @@ 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) {