Pavel Mikhailovskii
7ac5233a32
KT-54804 [SLC] Generate synthetic functions for annotations on properties in light classes
2023-05-12 09:39:37 +00:00
Egor Kulikov
34db304ef7
[FIR] Init packageFqName when calculating lazy arguments of anotations
...
^KT-58584 fixed
Merge-request: KT-MR-10113
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com >
2023-05-11 22:00:09 +00:00
Ilya Kirillov
4c69f2fbcb
[Analysis API] fix "Unexpected class FirTypeProjectionWithVarianceImpl" exception
...
from KtFirExpressionTypeProvider.getKtExpressionType
^KTIJ-23432 fixed
2023-05-11 20:44:31 +02:00
Ilya Kirillov
89dbc4daec
[Analysis API] tests: add possibility to avoid FqName for Kt psi classes in ExpressionMarkerProvider
2023-05-11 20:44:31 +02:00
Ilya Kirillov
176f77c0ef
[Analysis API] tests: add possibility to specify LOOK_UP_FOR_ELEMENT_OF_TYPE for all tests
2023-05-11 20:44:31 +02:00
Dmitrii Gridin
25506d3be6
[LL FIR] add more lazy resolve tests on status phase
...
^KT-56551
2023-05-11 17:38:59 +02:00
Kirill Rakhman
993925f656
[FIR] Ignore private properties in accessor override check
...
JavaClassUseSiteMemberScope won't return a Java method getFoo if there
is an inherited Kotlin property foo in scope because calling this method
would effectively call the property accessor which is not possible in
Kotlin.
This commit excludes private properties from this consideration because
no accessor methods are generated for them, and so calling a Java method
getFoo is ok.
#KT-58577 Fixed
2023-05-11 15:22:42 +00:00
Denis.Zharkov
442844f165
K2: Fix false-positive overload ambiguity after smart cast
...
Mostly, the change is just mirroring the same logic from K1
OverloadingConflictResolver
^KT-58524 Fixed
2023-05-11 15:01:37 +00:00
Dmitrii Gridin
09dbae5eca
[LL FIR] add more restrictions to getNonLocalContainingOrThisDeclaration
...
^KTIJ-25437
KT-MR-10036
2023-05-11 16:09:02 +02:00
Mikhail Glukhikh
134284e496
FE: add test for KT-58055
2023-05-11 12:19:40 +00:00
Pavel Mikhailovskii
25c0725da9
[SLC] Treat error class types as not-nullable
2023-05-11 11:48:45 +00:00
Dmitrii Gridin
9a267176f5
[FIR] move deprecation calculation to COMPILER_REQUIRED_ANNOTATIONS phase
...
Also, this change adds SinceKotlin and Java.Deprecated to this phase
It fixes some problems with API_NOT_AVAILABLE, so now it is closer to K1
^KT-57648 Fixed
^KT-55723 Fixed
2023-05-11 10:31:52 +00:00
Dmitrii Gridin
add47aa041
[FIR] provide correct origin and source to default backing field
...
Now it is aligned with default accessors
Covered by
analysis/analysis-api/testData/symbols/symbolByReference/accessorField.kt
test
^KT-57648
^KT-55723
2023-05-11 10:31:52 +00:00
Dmitrii Gridin
aa5261395e
[LL FIR] allow parallel resolve for non-jumping phases
...
^KT-56550 Fixed
2023-05-10 17:17:46 +00:00
Dmitrii Gridin
7f778eafa5
[LL FIR] add missing declarations transformations for COMPILER_REQUIRED_ANNOTATIONS phase
...
The transformed does nothing previously
^KT-56550
2023-05-10 17:17:46 +00:00
Dmitrii Gridin
231c59bd2c
[LL FIR] drop redundant lazy annotations calculation from ANNOTATIONS_ARGUMENTS_MAPPING phase
...
They must be calculated on the previous ARGUMENTS_OF_ANNOTATIONS phase
^KT-56550
2023-05-10 17:17:46 +00:00
Dmitrii Gridin
a429367890
[LL FIR] unify annotation transformers
...
^KT-56550
2023-05-10 17:17:46 +00:00
Dmitrii Gridin
5ebba92a6e
[LL FIR] FirLazyBodiesCalculator: do not calculate annotations during body calculation
...
All annotations must be calculated on the corresponding phases
^KT-56550
2023-05-10 17:17:46 +00:00
Dmitrii Gridin
6b8b5c256d
[LL FIR] FirLazyBodiesCalculator: cleanup naming
...
^KT-56550
2023-05-10 17:17:46 +00:00
Dmitrii Gridin
64c2ba1a2a
[LL FIR] calculate lazy annotations only for target declaration
...
To avoid visiting not locked declarations
^KT-56550
^KT-58495 Fixed
^KT-58500 Fixed
^KT-58493 Fixed
^KT-58496 Fixed
^KT-58497 Fixed
^KT-58499 Fixed
^KT-58491 Fixed
2023-05-10 17:17:46 +00:00
Dmitrii Gridin
5c8045f3d0
[LL FIR] add test on nested declarations and annotations
...
To see the effect of subsequent changes
^KT-56550
2023-05-10 17:17:46 +00:00
Dmitrii Gridin
990f23a11b
[LL FIR] FirLazyBodiesCalculator: covert non-public api to private functions
...
^KT-56550
2023-05-10 17:17:46 +00:00
Dmitrii Gridin
a7692ba2c5
[LL FIR] do not calculate lazy body recursively by default
...
To avoid visiting not locked declarations
^KT-56550
2023-05-10 17:17:45 +00:00
Dmitrii Gridin
d1f3ba0286
[LL FIR] cleanup LLFirBodyTargetResolver
...
Avoid redundant withRegularClass call
^KT-56550
2023-05-10 17:17:45 +00:00
Dmitrii Gridin
b51a416682
[LL FIR] ignore constructors on implicit body phase
...
^KT-56551
2023-05-10 17:17:45 +00:00
Dmitriy Novozhilov
40b8b682f9
[FIR] Don't save DFA implications for unstable local vars
...
^KT-57502 Fixed
2023-05-10 14:19:25 +00:00
Egor Kulikov
6f20ac4f38
[FIR] Enable asserts for not building AST tree in lazy mode
...
Make interface delegate expressions lazy
2023-05-10 11:49:42 +00:00
Kirill Rakhman
b2fa104081
[FIR] Keep all failed resolution candidates and fully resolve them
...
Previously, when a candidate was found with an applicability that is
better than the current best applicability, all previous candidates were
thrown away. Now we keep them, unless the new applicability is
successful. If no successful candidates are found, we fully resolve all
the unsuccessful ones and select the ones with the least bad
applicability. This improves diagnostics for unresolved calls.
#KT-57844 Fixed
2023-05-10 11:48:58 +00:00
Anna Kozlova
e6b8a09375
[AA] assert that shortener is not called on compiled code
...
KTIJ-25188
Co-authored-by: Roman Golyshev <anstreth@gmail.com >
Merge-request: KT-MR-10064
Merged-by: Anna Kozlova <Anna.Kozlova@jetbrains.com >
2023-05-10 11:12:05 +00:00
Dmitrii Gridin
b3aa2dd60f
[LL FIR] calculate designation path by FirFile where it is possible
...
This will fix problems with declaration clash.
Otherwise, a designation path to the constructor of the second class
from the snippet
```
class A
class A
```
Will contain the first class instead of the second
Also, this is more performed than trying to find a segment of
a path by providers
^KT-58546 Fixed
2023-05-10 09:59:15 +00:00
Dmitrii Gridin
ae88726fae
[FIR] treat constructors of local classes as local declarations
...
The main problem: we are trying to lazily resolve local declaration
^KT-58546
^KT-58490
2023-05-10 09:59:15 +00:00
Dmitriy Novozhilov
1936658e40
[FIR] Consider stability of receiver for DFA variables
...
^KT-57425 Fixed
2023-05-10 07:50:31 +00:00
Dmitrii Gridin
2c294cba64
[FIR] SupertypeComputationSession: fix false positive invisible reference for local object
...
The problem is that FirAnonymousObject was ignored during getResolvedSuperTypeRefsForOutOfSessionDeclaration from SupertypeSupplier
^KT-58583 Fixed
2023-05-09 17:23:45 +00:00
Roman Golyshev
7a9021aa6b
[AA FIR] KT-58503 Do not use resolvedStatus for visibility yet
...
It's done to avoid lazy resolve contract violation errors. See KT-58572
2023-05-09 13:20:17 +00:00
Roman Golyshev
105611679e
[AA FIR] KT-58503 Use resolvedStatus to access visibility and modality of a class
...
Compiler plugins (AllOpen, for example) can modify the status of a
declaration, including visibility and modality. If we observe them
without enforcing STATUS resolve, we risk to see incorrect information,
which in turn can lead to false negatives/positives in
inspections/intentions.
Add test for light classes. See KT-58503 description for the explanation
how the initial problem was influencing Spring inspections from intellij
repository.
^KT-58503 Fixed
2023-05-09 13:20:16 +00:00
Mikhail Glukhikh
0906258d03
K2: handle suspend anonymous functions properly in various compiler parts
...
#KT-58332 Fixed
2023-05-09 09:19:38 +00:00
Dmitriy Novozhilov
af60681705
[FIR] Save declarations in metadata in source order
...
^KT-54792 Fixed
^KT-54801
^KT-54800
2023-05-09 07:36:32 +00:00
Anna Kozlova
cf6a06fd14
[LL] [cls] don't access index to retrieve fir for given ktElement
...
also don't check name pattern, because
given ktElement proves that corresponding package contains something
2023-05-09 07:36:11 +00:00
Anna Kozlova
366c67a668
extract StandartNames.NAME constant
2023-05-09 07:36:10 +00:00
Anna Kozlova
92b6a77431
[LL] [cls] remove search for sources for decompiled FIR
...
stub based deserializer provides sources during initialization,
no need to search afterward
2023-05-09 07:36:10 +00:00
Anna Kozlova
5ca052f87b
[LL] [cls] use stubBased symbol provider for builtins
...
this gives the following benefits:
1. no protobuf in memory, all data is already present in stubs
2. given that symbol provider for libraries is already stub based,
we can get rid of complicated code to find source psi by deserialized fir
3. it's also possible to reduce number of index access,
when fir is requested for given ktElement
2023-05-09 07:36:09 +00:00
Yahor Berdnikau
d57623891d
Fix explicit api issues in analysis modules
...
Explicit api mode was not working due to the bug.
^KT-57653
2023-05-08 19:43:43 +00:00
Dmitrii Gridin
d3043b6f1c
[LL FIR] do not treat declarations from object literal as non-local
...
^KTIJ-25437 Fixed
2023-05-08 16:08:26 +00:00
Dmitrii Gridin
25f2c513f6
[LL FIR] drop global phase lock for super types phase
...
^KT-56551
2023-05-08 14:42:10 +00:00
Dmitrii Gridin
13dc4c8014
[LL FIR] split LLFirLockProvider on read and write API
...
^KT-56550
2023-05-08 14:42:10 +00:00
Nikolay Lunyak
76df0f9ad1
[FIR] KT-48870: Allow resolution to InaccessibleImplicitReceiverValue
...
^KT-48870 Fixed
2023-05-08 14:25:54 +00:00
Dmitrii Gridin
b9dd2f736a
[LL FIR] avoid redundant recursive type resolve for type aliases
...
In LL FIR we will do this by crawlSupertype
^KT-56550
2023-05-08 12:06:55 +00:00
Dmitrii Gridin
873c7d63ed
[LL FIR] avoid redundant pass through the entire super type hierarchy for nested classes
...
We can omit this step in LL FIR because, according to the contract,
an outer class must be resolved before nested class
Also, it drops unsafe access to superTypeRefs from FIR transformer
^KT-56550
2023-05-08 12:06:55 +00:00
Dmitrii Gridin
ee74e10f28
[FIR] avoid jumping from super type transformer for local classes to unresolved non-local classes
...
In the worst case, we will visit the entire hierarchy of a local class,
where non-local classes are not yet resolved
^KT-56550
2023-05-08 12:06:55 +00:00
Dmitrii Gridin
ba08f2c08a
[FIR] avoid jumping from status transformer for local classes to unresolved non-local classes
...
We must resolve a non-local declaration before access
if we want to jump from local to it to avoid possible problems
with parallel resolution
^KT-56550
2023-05-08 08:59:07 +00:00