[FIR] mark empty file annotation container as resolved
To avoid redundant lazy resolve ^KT-56551
This commit is contained in:
committed by
Space Team
parent
622f9fb13c
commit
33140b7fcf
+10
-5
@@ -120,11 +120,12 @@ class DeclarationsConverter(
|
||||
this.sourceFile = sourceFile
|
||||
this.sourceFileLinesMapping = linesMapping
|
||||
this.packageDirective = packageDirective ?: buildPackageDirective { packageFqName = context.packageFqName }
|
||||
annotationsContainer = fileAnnotationContainer
|
||||
?: buildFileAnnotationsContainer {
|
||||
moduleData = baseModuleData
|
||||
containingFileSymbol = fileSymbol
|
||||
}
|
||||
annotationsContainer = fileAnnotationContainer ?: buildFileAnnotationsContainer {
|
||||
moduleData = baseModuleData
|
||||
containingFileSymbol = fileSymbol
|
||||
resolvePhase = FirResolvePhase.BODY_RESOLVE
|
||||
}
|
||||
|
||||
imports += importList
|
||||
declarations += firDeclarationList
|
||||
}
|
||||
@@ -329,6 +330,10 @@ class DeclarationsConverter(
|
||||
ANNOTATION_ENTRY -> container += convertAnnotationEntry(node)
|
||||
}
|
||||
}
|
||||
|
||||
annotations.ifEmpty {
|
||||
resolvePhase = FirResolvePhase.BODY_RESOLVE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1049,6 +1049,10 @@ open class RawFirBuilder(
|
||||
for (annotationEntry in file.annotationEntries) {
|
||||
annotations += annotationEntry.convert<FirAnnotation>()
|
||||
}
|
||||
|
||||
annotations.ifEmpty {
|
||||
resolvePhase = FirResolvePhase.BODY_RESOLVE
|
||||
}
|
||||
}
|
||||
|
||||
for (importDirective in file.importDirectives) {
|
||||
|
||||
Reference in New Issue
Block a user