[LL FIR] ContextCollector: optimize collector for file elements

We shouldn't trigger declaration processing if we want to check just
annotations/package/imports.
But currently, we still will iterate over the entire file
if there is an element somewhere inside package/import
(see `fileImportInside.kt` test case)

^KT-65344
^KT-65560 Fixed
This commit is contained in:
Dmitrii Gridin
2024-02-05 17:31:59 +01:00
committed by Space Team
parent 0c3a1dfd67
commit 47e8d987b9
7 changed files with 39 additions and 84 deletions
@@ -16,8 +16,8 @@ Tower Data Context:
Is all under: false
FILE: [ResolvedTo(IMPORTS)] fileImport.kt
@R|kotlin/annotation/Target|[Types](FILE#) public final [ResolvedTo(STATUS)] annotation class Anno : R|kotlin/Annotation| {
public [ResolvedTo(STATUS)] constructor(): R|foo/Anno| {
@Target[Unresolved](LAZY_EXPRESSION) public final? [ResolvedTo(RAW_FIR)] annotation class Anno : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] constructor(): R|foo/Anno| {
LAZY_super<R|kotlin/Any|>
}