Currently the shortener ignores the created FirProperty, as a result,
any annotations declared on the getter or setter are ignored. The test
is added in Intellij repo.
Since many labels are not present in the FIR tree, this checker is
implemented as a syntax checker. Comparing with FE1.0, this change
reports some REDUNDANT_LABEL_WARNING that FE1.0 has missed, especially
LHS of assignments.
It's necessary to have the sane logic that FirMemberDeclaration is a subtype of FirDeclaration
The only kind of controversial change here is making FirAnonymousObject
also be FirMemberDeclaration, thus having its own declaration status
Those modules are:
- :compiler:fir:providers, which contains Fir and Symbol providers,
scopes, and different utilities used by them
- :compiler:fir:semantics, which contains different abstractions and
entities which are used in resolution and in checkers
- :compiler:fir:resolve, which contains all stuff related to resolution
and inference
There are two pros of this change:
1. It may increase gradle build, because it allows to compile :fir:resolve
and :fir:checkers modules in parallel
2. Logic of working FIR (scopes, providers, DFA logic system, etc) is
now separated from logic of resolution phases, so for example checkers,
which are depend on scopes physically will not be able to run resolve
in any way
As of 7243d308, property annotations are split according to use-site,
and thus, for property accessors and setter parameter, FIR LC needs
to look up accessors and setter parameter with the target use-site.
For invalid code like the following,
```
when {
true, false -> {}
}
```
`false` does not have a corresponding elements on the FIR side and hence
the containing `FirWhenBranch` is returned by `getOrBuildFir`. This
change makes the analysis API bail out for such cases.
Also changed tests to do the analysis on the KtElement of
interest instead of the KtFile where possible because currently depended
mode does not support analysing the entire file. Maybe we should support
analysing the whole file at some point.
Split some delegating scopes to basic and name aware implementations
Also get rid of getContainingCallableNamesIfPresent and
getContainingClassifierNamesIfPresent functions because they are not
needed anymore
parameters.
This was causing exceptions with analysis API trying to resolve the
synthetic FirValueParameter because it could not find a KtDeclaration
for it. Using BODY_RESOLVE should be safe; the SAM constructor function
is also on BODY_RESOLVE and the type of the value parameter is known.