[FIR] Type "top-level classifier names in package" as Name

- This is more consistent with "top-level callable names in package" and
  simplifies the set construction quite a bit, as we can avoid a lot of
  `asString` conversions.
This commit is contained in:
Marco Pennekamp
2023-10-19 19:21:45 +02:00
committed by Space Team
parent 8034d522b9
commit efe587691b
16 changed files with 43 additions and 41 deletions
@@ -62,11 +62,11 @@ class NativeForwardDeclarationsSymbolProvider(
}
}
private val includedForwardDeclarationsByPackage: Map<FqName, Set<String>> by lazy {
buildMap<FqName, MutableSet<String>> {
private val includedForwardDeclarationsByPackage: Map<FqName, Set<Name>> by lazy {
buildMap<FqName, MutableSet<Name>> {
for (classId in includedForwardDeclarations) {
getOrPut(classId.packageFqName) { mutableSetOf() }
.add(classId.shortClassName.asString())
.add(classId.shortClassName)
}
}
}
@@ -157,7 +157,7 @@ class NativeForwardDeclarationsSymbolProvider(
}
override val symbolNamesProvider: FirSymbolNamesProvider = object : FirSymbolNamesProviderWithoutCallables() {
override fun getTopLevelClassifierNamesInPackage(packageFqName: FqName): Set<String> =
override fun getTopLevelClassifierNamesInPackage(packageFqName: FqName): Set<Name> =
includedForwardDeclarationsByPackage[packageFqName].orEmpty()
}
}