[AA] Add missing withValidityAssertion calls to scopes

^KT-58653
This commit is contained in:
Marco Pennekamp
2023-05-22 14:40:39 +02:00
committed by Space Team
parent 1d8eb6dc9e
commit 326b6fa7c2
5 changed files with 7 additions and 7 deletions
@@ -51,7 +51,7 @@ internal class KtFe10FileScope(
}
}
override fun getCallableSymbols(names: Collection<Name>): Sequence<KtCallableSymbol> {
override fun getCallableSymbols(names: Collection<Name>): Sequence<KtCallableSymbol> = withValidityAssertion {
if (names.isEmpty()) return emptySequence()
val namesSet = names.toSet()
return getCallableSymbols { it in namesSet }
@@ -71,7 +71,7 @@ internal class KtFe10FileScope(
}
}
override fun getClassifierSymbols(names: Collection<Name>): Sequence<KtClassifierSymbol> {
override fun getClassifierSymbols(names: Collection<Name>): Sequence<KtClassifierSymbol> = withValidityAssertion {
if (names.isEmpty()) return emptySequence()
val namesSet = names.toSet()
return getClassifierSymbols { it in namesSet }
@@ -34,7 +34,7 @@ internal abstract class KtFe10ScopeResolution : KtScope, KtLifetimeOwner {
.mapNotNull { it.toKtSymbol(analysisContext) as? KtCallableSymbol }
}
override fun getCallableSymbols(names: Collection<Name>): Sequence<KtCallableSymbol> {
override fun getCallableSymbols(names: Collection<Name>): Sequence<KtCallableSymbol> = withValidityAssertion {
if (names.isEmpty()) return emptySequence()
val namesSet = names.toSet()
return getCallableSymbols { it in namesSet }
@@ -48,7 +48,7 @@ internal abstract class KtFe10ScopeResolution : KtScope, KtLifetimeOwner {
.mapNotNull { it.toKtSymbol(analysisContext) as? KtClassifierSymbol }
}
override fun getClassifierSymbols(names: Collection<Name>): Sequence<KtClassifierSymbol> {
override fun getClassifierSymbols(names: Collection<Name>): Sequence<KtClassifierSymbol> = withValidityAssertion {
if (names.isEmpty()) return emptySequence()
val namesSet = names.toSet()
return getClassifierSymbols { it in namesSet }
@@ -56,7 +56,7 @@ private class KtFirResolveExtensionScope(
gelTopLevelDeclarations(nameFilter) { it.getTopLevelClassifiers() }
}
override fun getClassifierSymbols(names: Collection<Name>): Sequence<KtClassifierSymbol> {
override fun getClassifierSymbols(names: Collection<Name>): Sequence<KtClassifierSymbol> = withValidityAssertion {
if (names.isEmpty()) return emptySequence()
val namesSet = names.toSet()
return getClassifierSymbols { it in namesSet }
@@ -22,7 +22,7 @@ internal class KtFirDelegatedMemberScope(
return super.getCallableSymbols(nameFilter).filter { it.origin == KtSymbolOrigin.DELEGATED }
}
override fun getCallableSymbols(names: Collection<Name>): Sequence<KtCallableSymbol> {
override fun getCallableSymbols(names: Collection<Name>): Sequence<KtCallableSymbol> = withValidityAssertion {
return super.getCallableSymbols(names).filter { it.origin == KtSymbolOrigin.DELEGATED }
}
}
@@ -99,7 +99,7 @@ internal class KtFirFileScope(
}
}
override fun getClassifierSymbols(names: Collection<Name>): Sequence<KtClassifierSymbol> {
override fun getClassifierSymbols(names: Collection<Name>): Sequence<KtClassifierSymbol> = withValidityAssertion {
if (names.isEmpty()) return emptySequence()
val namesSet = names.toSet()
return getClassifierSymbols { it in namesSet }