namely, add them to importing scopes directly and according to the
schema used for other implicit imports, rather than adding them
to the regular script file imports. See KT-65982 for explanation.
#KT-65982 fixed
The base class in scripting considered obsolete and therefore supported
via some ad-hoc mechanisms. In particular parameters to the base class
c-tor are passed via script provided properties. But in combination
with the resolution logic, this leads to issues described in KT-60452
This commits filters out such parameters from script resolution
scope and avoids this problem for now.
Bot it should be noted that proper diagnostics for properties shadowing
should still be implemented - see #KT-65809
#KT-60452 fixed
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
Now we can resolve this generated property in the same way
as other regular properties.
This is the pre-step for independent script initializers
^KT-65344
^KT-65523
The main change – now we collect not only `FirRegularClass`, but also
`FirScript`.
This allows us to have a proper context collector for
diagnostics for scripts.
Also, this change fixes dangling files for scripts in `IGNORE_SELF`
as now we have the correct patcher for this case, so we won't resolve
the copied script
^KT-65345
^KT-62841 Fixed
Parent declarations of the file copy are typically unresolved in the
'IGNORE_SELF' mode, as the declaration designation contains declarations
from the original file.
Parameters, type parameters, and property accessors are not
self-sufficient declarations (their resolution depends on resolution
of their parent), so a proper designation path cannot be computed
for them.
Without a designation path, 'ContextCollector' performs analysis of the
whole file, which is inefficient.
Java resolving subsystem requires calculated visibility for correct disambiguation of supertypes.
But visibility remains `Unknown` for Kotlin class-like declarations during supertypes resolving because `STATUS` resolve phase is performed after `SUPER_TYPES` phase.
To fix the problem, the visibility should be initialized to public at the FIR building phase if no modifier is presented.
^KT-64127 Fixed
This bug spilled into reference shortener, and then to
"redundant qualifier inspection" and code completion from there;
it caused KTIJ-26024 to reproduce again (but only for anonymous objects)
^KT-64186 Fixed
This commit does two things:
- prioritize type parameter scopes against static scopes in body resolve
(effectively it's a revert of KT-58028 fix)
- consider type parameters as inapplicable callable, so during callable
resolve we can go up the tower and still resolve to static scope
This allows both KT-58028 and KT-63377 to work properly
#KT-63377 Fixed
This is required to have stable resolution order to avoid concurrent
modifications and correct resolution context.
This also fixes KT-63700 as a super call expands only during body
resolution in the case of secondary constructor
^KT-63042
^KT-63700 Fixed
This is required to have stable resolution order to avoid concurrent
modifications and correct resolution context.
E.g., this commit fixes the resolution behavior of delegate field for
ANNOTATION_ARGUMENTS phase – now annotation argument resolves in the
correct scope
^KT-63042
Completion in the IDE relies on correct scopes for KDoc positions.
So we add testData for `KtScopeProvider` and `ContextCollector`
to ensure that there are no regressions
Before this commit, we allowed access to outer class type parameters
during resolve of type parameter bounds of a nested class.
In fact, outer type parameters are accessible in this situation
only if it's an inner class (or a local class).
This commit forbids such a usage. In the earlier fix of KT-57209
the same was done for regular type reference resolve.
#KT-61459 Fixed
#KT-61959 Fixed
'DFANode' is not created for certain elements, such as types or
references. Before the change, only the target element itself was
queried for DFA, making the 'ContextCollector' return an empty map of
smart casts.
^KTIJ-26973 Fixed