[FIR] Fix parameters constraints in FirDeclarationCollector<D>.collect

This commit is contained in:
Nikolay Lunyak
2023-10-25 15:11:35 +03:00
committed by Space Team
parent 44d6d10233
commit 008703c1dc
@@ -152,7 +152,7 @@ class FirDeclarationCollector<D : FirBasedSymbol<*>>(
fun FirDeclarationCollector<FirBasedSymbol<*>>.collectClassMembers(klass: FirRegularClassSymbol) {
val otherDeclarations = mutableMapOf<String, MutableList<FirBasedSymbol<*>>>()
val functionDeclarations = mutableMapOf<String, MutableList<FirBasedSymbol<*>>>()
val functionDeclarations = mutableMapOf<String, MutableList<FirFunctionSymbol<*>>>()
val declaredMemberScope = klass.declaredMemberScope(context)
val unsubstitutedScope = klass.unsubstitutedScope(context)
@@ -277,10 +277,10 @@ fun collectConflictingLocalFunctionsFrom(block: FirBlock, context: CheckerContex
return inspector.declarationConflictingSymbols
}
private fun <D : FirBasedSymbol<*>> FirDeclarationCollector<D>.collect(
declaration: D,
private fun <D : FirBasedSymbol<*>, S : D> FirDeclarationCollector<D>.collect(
declaration: S,
representation: String,
map: MutableMap<String, MutableList<D>>,
map: MutableMap<String, MutableList<S>>,
) {
map.getOrPut(representation, ::mutableListOf).also {
it.add(declaration)