Egor Kulikov
5bb4f469ef
[FIR] Do not throw exception on unexpected FIR for constants
...
^KTIJ-23263 fixed
Merge-request: KT-MR-10699
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com >
2023-06-19 17:45:31 +00:00
Dmitrii Gridin
72c625906f
[LL FIR] add tests on ClassIdCalculator
2023-06-17 13:58:24 +02:00
Dmitrii Gridin
87ca9e4203
[LL FIR] reduce resolution inside getOrBuildFirFor
...
We can avoid body resolution in some cases because it is more
than out contract is required
So ANNOTATIONS_ARGUMENTS_MAPPING should be enough for all
non-body parts of a declaration to return fully-resolved FirElement
Body parts incudes: body and default values
^KT-59266 Fixed
2023-06-16 14:47:49 +00:00
Dmitrii Gridin
b9e24e9b19
[LL FIR] add more tests on getOrBuildFirFor
...
^KT-59266
2023-06-16 14:47:49 +00:00
Dmitrii Gridin
aad99fd6eb
[LL FIR] getOrBuildFir tests should render fir file
...
We need it to see how many declarations were resolved
^KT-59266
2023-06-16 14:47:48 +00:00
Anna Kozlova
dd059a1e63
[LL] find fir by psi: allow fallthrough to traverse tree for invalid code
...
In case of broken code e.g., duplicated classes provider would return first class,
though we definitely need some code insight in this case
at least to add navigation fixes, etc.
Similar to this, a file copy is created during completion,
where additional elements might appear and we need to search for them.
Added test cases for duplicated classes.
2023-06-15 17:32:40 +00:00
Dmitrii Gridin
d7c197b31e
[LL FIR] support lazy resolve for WrappedIntegerOperator
...
^KTIJ-25761 Fixed
2023-06-10 17:57:52 +00:00
Anna Kozlova
4d97e4c572
[LL] add tests for FirDeclarationForCompiledElementSearcher
...
build stub if was not able to load:
expected that in IDE stubs would always be found in the index, for tests -
build from virtual file
2023-06-07 21:00:26 +00:00
Dmitrii Gridin
870527a4a3
[LL FIR] fix testData
...
The test was introduced in 4b1dc4eee6 and conflicts with 0ac02be534
^KT-56551
2023-05-27 16:17:33 +02:00
Dmitrii Gridin
8f82649529
[LL FIR] rewrite compiler required annotations transformer to avoid lazy resolve under locks
...
^KT-56551
2023-05-27 08:47:13 +00:00
Dmitrii Gridin
4b1dc4eee6
[LL FIR] add more lazy resolve tests on compiler required annotations
...
^KT-56551
2023-05-27 08:47:13 +00:00
Egor Kulikov
9a77632f1c
[FIR] Fix invalid expression throwing exception when determining type
...
^KTIJ-25421 fixed
Merge-request: KT-MR-10317
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com >
2023-05-25 12:31:42 +00:00
Egor Kulikov
5e38c2d570
[FIR] Fix invalid expression throwing exception when determining type
...
^KTIJ-25421 fixed
Merge-request: KT-MR-10290
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com >
2023-05-25 12:29:46 +00:00
Nikolay Lunyak
699366f178
[FIR] KT-58184: Prevent missing diagnostics on component calls
...
Update the component function visibility
based on the already resolved visibility
of the property before transforming
the status of the component function itself.
^KT-58184 Fixed
2023-05-25 12:19:30 +00:00
Egor Kulikov
f432bbad2e
Revert "[FIR] Fix error with incorrect destructing declaration"
...
This reverts commit b47910e86b .
2023-05-23 12:51:43 +02:00
Egor Kulikov
b47910e86b
[FIR] Fix error with incorrect destructing declaration
...
^KTIJ-25342 fixed
2023-05-23 12:48:41 +02:00
Egor Kulikov
1d8eb6dc9e
[FIR] Only take receiver on lambda if present
...
^KTIJ-25127 fixed
2023-05-22 17:10:52 +00:00
Dmitrii Gridin
2885df14ee
[LL FIR] rewrite status phase transformer
...
Now we will try to avoid redundant calculation:
* Class-like declarations can be calculated without super types
* Overridden search logic not is out of lock
Unfortunately, right now it is not safe to use
StatusResolveMode.FunctionWithSpecificName and
StatusResolveMode.PropertyWithSpecificName
because lazyResolveToPhaseWithCallableMembers can lead to an incorrect
state of scope. Example:
```
open class A {
open fun a() {}
open fun b() {}
}
class C : A()
```
Steps:
1. Resolve constructor of C to STATUS
2. Now we want to call lazyResolveToPhaseWithCallableMembers on
C, and this call will do nothing because this class and all
its declarations (only constructor) are already in STATUS phase,
so class A won't be resolved as expected
^KT-56551
2023-05-19 12:43:45 +00:00
Dmitrii Gridin
e464af00db
[LL FIR] do not calculate constructors with classes during types phase
...
^KT-56551
2023-05-19 12:43:45 +00:00
Dmitrii Gridin
76b9cc6a04
[LL FIR] add lazy resolve test on expect-actual phase
...
^KT-56551
2023-05-19 09:26:43 +00:00
Egor Kulikov
bff1520c9e
[FIR] Resolve where subjects to corresponding type argument
...
^KTIJ-25295 fixed
Merge-request: KT-MR-10044
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com >
2023-05-17 15:28:02 +00:00
Dmitrii Gridin
33140b7fcf
[FIR] mark empty file annotation container as resolved
...
To avoid redundant lazy resolve
^KT-56551
2023-05-16 13:25:42 +00:00
Dmitrii Gridin
622f9fb13c
[LL FIR] add lazy resolve test on file annotation container
...
^KT-56551
2023-05-16 13:25:42 +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
Dmitrii Gridin
25506d3be6
[LL FIR] add more lazy resolve tests on status phase
...
^KT-56551
2023-05-11 17:38:59 +02:00
Dmitrii Gridin
09dbae5eca
[LL FIR] add more restrictions to getNonLocalContainingOrThisDeclaration
...
^KTIJ-25437
KT-MR-10036
2023-05-11 16:09:02 +02: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
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
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
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
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
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
Dmitrii Gridin
c2b09d3b1e
[LL FIR] rewrite LLFirSuperTypeTargetResolver
...
The previous implementation had issues with
locks, publication and performance
Also, this change fixed a problem with mixed cycle inheritance
^KT-56550
^KTIJ-25430 Fixed
^KTIJ-23520 Fixed
^KT-57623 Fixed
^KTIJ-25372 Fixed
^KT-58357 Fixed
2023-05-05 12:35:46 +00:00
Kirill Rakhman
4c6b6dd700
[FIR] Render error properties and function in FirRenderer
2023-05-05 09:34:23 +00:00
Dmitrii Gridin
d29da18b60
[LL FIR] add more tests on specific members resolve
...
^KT-56550
2023-05-04 10:03:45 +00:00
Dmitrii Gridin
228b1852b1
[LL FIR] add isResolved check for delegated constructor call
...
^KT-56550
2023-05-04 10:03:45 +00:00
Dmitrii Gridin
2cac7319fe
[LL FIR] add test on lazy resolve for local declarations
...
^KT-56550
2023-04-28 18:08:01 +00:00
Dmitrii Gridin
481becb342
[LL FIR] implement LLFirReturnTypeCalculatorWithJump
...
To provide the correct designation and locks strategy
^KT-56550
^KT-58083 Fixed
2023-04-28 11:59:02 +00:00
Mikhail Glukhikh
1c56a71b14
FirClassSubstitutionScope: don't recreate constructor type parameters w/out need
...
#KT-58008 Fixed
2023-04-25 16:42:59 +00:00
Mikhail Glukhikh
1f05ce2e01
AA/LC: Support annotation property->backing field move
...
#KT-57462 Fixed
2023-04-25 12:18:27 +00:00
Dmitrii Gridin
63e6816a50
[LL FIR] avoid body resolve on attempt to build symbol for type parameters
...
^KT-57850
2023-04-21 17:21:36 +00:00
Dmitrii Gridin
5a53d796e1
[LL FIR] add more tests on lazy resolve for type parameters
...
^KT-57850
2023-04-21 17:21:36 +00:00
Dmitrii Gridin
9fe77d6a56
[LL FIR] avoid body resolve on attempt to build symbol for parameters
...
^KT-57850
2023-04-21 17:21:36 +00:00
Dmitrii Gridin
3394097f47
[LL FIR] run lazy resolve tests by caret
...
To test production resolveToFirSymbol entry point
^KT-57850
2023-04-21 17:21:36 +00:00
Dmitrii Gridin
5d1c853adf
[AA FIR] fix contract violation for java Target annotation
...
^KT-57849 Fixed
2023-04-21 10:14:05 +00:00