FIR nested classifier scope building: optimize companion search
This commit is contained in:
+2
-2
@@ -41,8 +41,8 @@ abstract class FirAbstractTreeTransformerWithSuperTypes(
|
||||
nestedClassifierScope(it.lookupTag.classId, session)
|
||||
}
|
||||
regularClass.addTypeParametersScope()
|
||||
val companionObjects = regularClass.declarations.filterIsInstance<FirRegularClass>().filter { it.isCompanion }
|
||||
for (companionObject in companionObjects) {
|
||||
val companionObject = regularClass.companionObject
|
||||
if (companionObject != null) {
|
||||
towerScope.scopes += nestedClassifierScope(companionObject)
|
||||
}
|
||||
towerScope.scopes += nestedClassifierScope(regularClass)
|
||||
|
||||
+2
-2
@@ -231,8 +231,8 @@ class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransformer)
|
||||
if (regularClass.symbol.classId.isLocal) {
|
||||
prepareLocalClassForBodyResolve(regularClass)
|
||||
}
|
||||
val companionObjects = regularClass.declarations.filterIsInstance<FirRegularClass>().filter { it.isCompanion }
|
||||
for (companionObject in companionObjects) {
|
||||
val companionObject = regularClass.companionObject
|
||||
if (companionObject != null) {
|
||||
topLevelScopes += nestedClassifierScope(companionObject)
|
||||
}
|
||||
topLevelScopes += nestedClassifierScope(regularClass)
|
||||
|
||||
Reference in New Issue
Block a user