Dmitrii Gridin
46d16dfb6c
[LL FIR] PersistenceContextCollector: change designation path resolution order
...
We will process more specific declaration firstly to avoid contention.
As the next step of addbb713a5
^KT-65780
2024-02-14 17:53:31 +00:00
Dmitrii Gridin
78c394d4de
[LL FIR] FirElementBuilder: search file header elements without body resolution
...
^KT-65780
2024-02-14 17:53:31 +00:00
Dmitrii Gridin
04a2d6b616
[LL FIR] FirElementBuilder: make getFirForNonBodyElement more abstract
...
This is required for the next step
^KT-65780
2024-02-14 17:53:31 +00:00
Dmitrii Gridin
38a3010ac8
[LL FIR] FirElementBuilder: search file annotations without body resolution
...
^KT-65780
2024-02-14 17:53:31 +00:00
Dmitrii Gridin
cca58f5c2a
[LL FIR] FirElementBuilder: accept KtAnnotated instead of KtDeclaration as annotation owner
...
^KT-65780
2024-02-14 17:53:31 +00:00
Dmitrii Gridin
7796ef43db
[LL FIR] FileStructure: resolve FirFile to body phase as all other elements
...
This is the correct behavior as we have to resolve to body phase
to build CFG and run diagnostics collector correctly
^KT-65780 Fixed
2024-02-14 17:53:31 +00:00
Dmitrii Gridin
84b6d5d508
[LL FIR] add tests for getOrBuildFir for KtFileAnnotationList
...
^KT-65780
2024-02-14 17:53:31 +00:00
Dmitrii Gridin
5426cbc3df
[LL FIR] tests for this with annotations as implicit return type
...
^KT-61175
^KT-64215
2024-02-14 17:46:47 +00:00
Dmitrii Gridin
e02c28c88a
[LL FIR] support lazy resolve of destructuring declaration entries
...
^KT-62840 Fixed
^KT-65727
2024-02-14 16:16:01 +00:00
Dmitrii Gridin
8c63e75f06
[LL FIR] update destructuringEntryScript testData
...
To reproduce getOrBuildFir for KtDestructuringDeclarationEntry
^KT-62840
2024-02-14 16:16:01 +00:00
Dmitrii Gridin
312feb3dca
[FIR] make script destructuring declaration entry initializer lazy expression
...
This change is required to properly support such declarations in lazy
resolution mode as we usually replaced initializers with lazy
expressions during the body calculation phase
^KT-62840
2024-02-14 16:16:01 +00:00
Dmitrii Gridin
c0f4f7fefd
[LL FIR] AbstractFirLazyBodiesCalculatorTest: add ability to suppress test
...
We have inconsistency in lazy body calculator, but only tests are
affected, because in the production we recreated bodies anyway
^KT-62840
2024-02-14 16:16:01 +00:00
Dmitrii Gridin
256d83b005
[LL FIR] support lazy resolve of <destruct> script declaration
...
But support for entries still is not implemented yet
^KT-62840
2024-02-14 16:16:01 +00:00
Dmitrii Gridin
792af849df
[LL FIR] add getOrBuildFir test on destructuring declaration annotation
...
It doesn't resolve the property as it is treated as a local one
^KT-62840
2024-02-14 16:16:01 +00:00
Dmitrii Gridin
9ca0bdcb80
[FIR] make script destructuring declaration initializer lazy expression
...
This change is required to properly support such declarations in lazy
resolution mode as we usually replaced initializers with lazy
expressions during the body calculation phase
^KT-62840
2024-02-14 16:16:01 +00:00
Dmitrii Gridin
898c8c002e
[LL FIR] add lazy body calculation tests for scripts
...
After KT-65344 we can effectively calculate lazy bodies in scripts,
so we can safely add the test
^KT-62840
2024-02-14 16:16:01 +00:00
Vladimir Dolzhenko
95ea711659
Fix PsiLiteral#getReferences
...
#KTIJ-28769
Merge-request: KT-MR-14391
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com >
2024-02-14 13:39:50 +00:00
aleksandrina-streltsova
89681e0a47
[Analysis API] override equals in KtFirReceiverParameterSymbol
...
KTIJ-28786
2024-02-14 13:25:47 +00:00
Kirill Rakhman
2f49272c42
[FIR] Create fake hidden versions of List.getFirst/getLast in JDK < 21
...
... so that overrides are marked as deprecated regardless of the JDK.
#KT-65440 Fixed
2024-02-14 13:13:01 +00:00
Pavel Kunyavskiy
6e8a7d4662
[ObjCInterop] Implement @ObjCSignatureOverride
...
This annotation leads to conflicting overloads error supression,
in case where several function with the same argument types,
but different argument names are inherited from ObjC class.
We need to implement it in both K1 and K2 to make the IDE experience
better.
But the annotation itself wouldn't be available in K1.
^KT-61323
2024-02-14 11:44:01 +00:00
Nikolay Lunyak
fa5ae18980
[FIR] Fix a typo in a test data file name
...
^KT-65337
2024-02-14 09:57:13 +00:00
Nikolay Lunyak
7f42596935
[FIR] Reproduce KT-65337
...
^KT-65337
2024-02-14 09:57:12 +00:00
Mikhail Glukhikh
6ed7c041b4
K1/K2: add various tests for context receiver tower resolve priority
...
Related to KT-64531, KT-64488
#KT-64531 As Designed
2024-02-14 09:55:51 +00:00
Kirill Rakhman
e88865e4c7
[FIR] Fix methods with erased parameters missing from raw collection scope
...
#KT-65448 Fixed
2024-02-14 09:55:24 +00:00
Alexander Udalov
b72effab98
IR: remove isFromJava check from isOverridableMemberOrAccessor
...
This is needed because in case a static member is inherited via a Kotlin
class (class C in the newly added test), its origin becomes
FAKE_OVERRIDE which is technically not Java anymore. After this change,
we'll build fake overrides for static members from superclasses
regardless of whether they come from Java or Kotlin.
Also, move the previous logic of
isOverridableFunction/isOverridableProperty to the only call site at
IdSignatureFactory.
#KT-65589 Fixed
2024-02-13 21:03:33 +00:00
Marco Pennekamp
b24c75d04c
[LL] Fix computeIfAbsent contract violation during dangling file session creation
...
- To avoid recursive updates, we can create sessions which cannot be
created in isolation outside `computeIfAbsent`. Note that this is the
current behavior of the default implementation of
`ConcurrentMap.computeIfAbsent`, which will be replaced soon with
the stricter behavior of `CleanableSoftValueCache` (see KT-61222).
^KT-65683 fixed
2024-02-13 17:14:20 +00:00
Dmitrii Gridin
2e2e592cc3
[Analysis API] CliTestModuleCompiler: support LANGUAGE_VERSION directive
...
^KT-64884
2024-02-13 16:07:17 +00:00
Dmitrii Gridin
a567793d10
[LL FIR] add workaround for deserialization of data classes
...
To correctly process old metadata without properly sorted properties
^KT-64884 Fixed
2024-02-13 16:07:17 +00:00
Dmitrii Gridin
faebef171d
[Analysis API] add regression tests for data class copy arguments usage
...
This issue is not reproducible against the K2 compiler
^KT-64884
2024-02-13 16:07:17 +00:00
Vladimir Dolzhenko
ad119a707c
Fix equals/hashCode for LC fake files
...
#KTIJ-28770 Fixed
Merge-request: KT-MR-14341
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com >
2024-02-13 15:47:09 +00:00
Dmitrii Gridin
ab328e76d4
[LL FIR] FirDesignation: update KDoc for collectDesignationWithOptionalFile
...
^KT-65344
2024-02-13 14:58:31 +00:00
Dmitrii Gridin
ca484fae2c
[LL FIR] KtFirReferenceShortener: add order for FirScriptDeclarationsScope
...
It is similar mostly to FirClassUseSiteMemberScope or NestedClassifier
^KT-65344
2024-02-13 14:58:31 +00:00
Dmitrii Gridin
18978ca3f1
[LL FIR] FirDesignation: add toString
...
^KT-65344
2024-02-13 14:58:31 +00:00
Dmitrii Gridin
cc46b6e3e9
[LL FIR] rename collectDesignationWithFile to collectDesignation
...
It should have a more simple name as it is the main function now
^KT-65344
2024-02-13 14:58:31 +00:00
Dmitrii Gridin
0b4dac9d8d
[LL FIR] rename collectDesignation to collectDesignationWithOptionalFile
...
To make the choice more visible
^KT-65344
2024-02-13 14:58:31 +00:00
Dmitrii Gridin
3c26d0e85d
[LL FIR] refactor collectDesignation and friends
...
to simplify code and add KDoc
^KT-65344
2024-02-13 14:58:31 +00:00
Dmitrii Gridin
8f987644ab
[LL FIR] designation refactoring
...
Collect `FirDesignation` by default with `FirFile` instead of just
a separate path and additional repeated logic around
^KT-65344
2024-02-13 14:58:31 +00:00
Dmitrii Gridin
47e8d987b9
[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
2024-02-13 14:58:31 +00:00
Dmitrii Gridin
0c3a1dfd67
[LL FIR] ContextCollector: add tests for file package and imports
...
It reproduces redundant resolution
^KT-65344
^KT-65560
2024-02-13 14:58:31 +00:00
Dmitrii Gridin
58ad26ee5b
[LL FIR] make script initializers independent
...
Now we can resolve all script declarations independently
^KT-65344 Fixed
2024-02-13 14:58:31 +00:00
Dmitrii Gridin
d59b8b3244
[LL FIR] LLFirStatusTargetResolver: add missing branch for FirFile
...
It is better to explicitly say that we shouldn't do anything in the
case of the file. It worked before because of `needResolveMembers == false`
and `needResolveNestedClassifiers == false` inside
`LLFirStatusTargetResolver.Transformer`
^KT-65344
2024-02-13 14:58:31 +00:00
Dmitrii Gridin
697f1477fd
[LL FIR] drop forEachDependentDeclaration
...
Now this function is redundant
^KT-65344
2024-02-13 14:58:31 +00:00
Dmitrii Gridin
5de5f70ec9
[LL FIR] LLFirPhaseUpdater: update backing field initializer directly
...
Instead of the backing field itself as we already update its phase
during `updatePhaseForNonLocals`
^KT-65344
2024-02-13 14:58:31 +00:00
Dmitrii Gridin
6415f423a8
[LL FIR] PhaseUpdatingTransformer: drop redundant checks
...
We shouldn't check the current phase as this condition effectively
always is **false** as we use this updater only once for the phase
^KT-65344
2024-02-13 14:58:31 +00:00
Dmitrii Gridin
348c9664c1
[LL FIR] drop isScriptDependentDeclaration
...
Now this property is redundant
^KT-65344
2024-02-13 14:58:31 +00:00
Dmitrii Gridin
4f0bc86ad4
[LL FIR] make result$$ property independent
...
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
2024-02-13 14:58:31 +00:00
Dmitrii Gridin
6135a98e4e
[LL FIR] do not rebuild entire script for lazy calculation of result$$ property
...
After the previous commit, it is possible to rebuild initializer for
`result$$` property without a full script creation.
Also, this commit fixes anchor symbol for annotations
inside script statements
^KT-65344
2024-02-13 14:58:31 +00:00
Dmitrii Gridin
338c533a58
[FIR] FirScriptConfigurationExtensionImpl: change source element for result$$ property
...
We should use the source from replaced `FirAnonymousInitializer` as it
is more equivalent. Another point – the previous implementation
duplicated the source between generated FirProperty and initializer
^KT-65344
2024-02-13 14:58:31 +00:00
Dmitrii Gridin
f972c8d239
[LL FIR] add more tests for script initializer
...
^KT-65344
2024-02-13 14:58:31 +00:00
Dmitrii Gridin
0e16788b0a
[FIR] value parameters from data class copy should be marked as resolved
...
^KT-65763 Fixed
2024-02-13 11:54:04 +00:00