Commit Graph

27 Commits

Author SHA1 Message Date
Nikita Bobko 8c0cf7d0bc [FIR] Fix disappeared ACTUAL_MISSING
^KT-59887 Fixed

Review: https://jetbrains.team/p/kt/reviews/13244
2023-12-04 13:08:23 +00:00
Nikita Bobko 453d871b25 [LL] Run LLFirExpectActualMatchingTargetResolver only for KMP projects
Review: https://jetbrains.team/p/kt/reviews/13244

Motivation: Performance. When I fix KT-59887 in later commits, I will
make actual-to-expect resolve to work not only for actual declarations.
Considering that LLFirExpectActualMatcherLazyResolver worked even for
non-KMP projects that might be a potential performance regression

FirExpectActualMatcherProcessor in the compiler does the same thing (it
checks for MultiPlatformProjects before running the transformer)
2023-12-04 13:08:23 +00:00
Kirill Rakhman dd1d36816b [FIR] Insert SAM conversion expressions during completion
#KT-62847 Fixed
2023-11-30 08:39:04 +00:00
Dmitrii Gridin 5183019cb8 [LL FIR] resolve class before constructor
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
2023-11-23 15:55:07 +00:00
Dmitrii Gridin a79cef08b5 [LL FIR] resolve generated property before componentN
This is required to have stable resolution order to avoid concurrent
modifications.
Another point here – status phase logic for componentN function is
located in the corresponding property resolution

^KT-63042
2023-11-23 15:55:07 +00:00
Dmitrii Gridin 6ecaccbcfe [FIR] PsiRawFirBuilder: reuse type for property from constructor parameter
Previously, this call was required to avoid sharing to have independent
instances with their own resolution cycle. Now we will have stable
order (in the next commit), so it is possible to share instances.
Also, this change makes the logic consistency with Light Tree

^KT-63042
2023-11-23 15:55:06 +00:00
Dmitrii Gridin 8dacd41818 [LL FIR] introduce lazy resolve tests for type annotations
From one side to check how annotation propagation works and from another
side to cover scenarios with lazy resolution from type position as it is
a valid case of usage in Analysis API (KtFirAnnotationListForType)

^KT-63042
2023-11-23 15:55:06 +00:00
Kirill Rakhman 1ecbc094ec [FIR] Save warning-level enhanced types to an attribute
#KT-56989
2023-11-15 08:43:55 +00:00
Dmitrii Gridin ba7c341338 [LL FIR] annotation calculator for scripts should process only script inself
We shouldn't calculate annotations inside unrelated declarations without lock

^KT-63042
^KT-63282
2023-11-08 23:22:19 +00:00
Dmitrii Gridin dbaf4a2d5e [FIR] resolve type annotations on implicit return type of local property
This still doesn't work for unresolved delegate (see analysis/low-level-api-fir/testData/getOrBuildFir/wholeDeclaration/localDelegatedPropertyWithPropagatedType.out_of_src_roots.txt)

^KT-63042
2023-11-08 12:20:40 +00:00
Dmitrii Gridin 143f86cc1c [LL FIR] add test on implicit type for local property
^KT-63042
2023-11-08 12:20:40 +00:00
Dmitrii Gridin 500de9f9bb [LL FIR] FirElementBuilder: avoid body resolution for type references inside 'where'
^KT-62691 Fixed
2023-10-19 16:24:32 +00:00
Dmitrii Gridin 35567d453b [LL FIR] add lazy resolution tests on 'where' construction
^KT-62691
2023-10-19 16:24:32 +00:00
Dmitrii Gridin 3817f37011 [FIR] rename ANNOTATIONS_ARGUMENTS_MAPPING phase to ANNOTATION_ARGUMENTS
^KT-62679
2023-10-19 14:34:35 +00:00
Dmitrii Gridin 90102ad8b7 [LL FIR] avoid body resolve during getOrBuildFir for super types
This also covers a case with annotations on a super type entry

^KT-61789 Fixed
2023-10-13 17:13:14 +00:00
Dmitrii Gridin 515e05cd94 [LL FIR] add test for getOrBuildFir for super type
^KT-61789
2023-10-13 17:13:14 +00:00
Dmitrii Gridin 4d29d6e3b4 [LL FIR] FileStructure: accurate processing of generated declarations inside classes
We should process generated property as a part of the primary constructor.
This was already implemented in 8387ea8a, but some parts were missed.

ClassDiagnosticRetriever:
* dropped relation to properties generated from constructor parameters
as they should belong to the primary constructor only
* accurate logic to fully visit an implicit primary constructor to be
able to process nested declarations (e.g., inside a super type call)

SingleNonLocalDeclarationDiagnosticRetriever:
* add relation to generated properties as now they fully belong to
the constructor

FileElementFactory:
* dropped explicit resolution of generated properties from a constructor
* added explicit resolution of generated enum members for consistency.
Effectively, this is not required because we don't have compiler
checkers for such generated enum member declarations

ClassDeclarationStructureElement:
* do not collect mapping for generated properties from constructor
* explicitly declare that we should process only ClassDelegationField

^KT-62437 Fixed
2023-10-13 17:13:14 +00:00
Dmitrii Gridin 1a01dd4dd4 [Analysis API] add diagnostic tests for unresolved reference inside primary constructor
^KT-62437
2023-10-13 17:13:14 +00:00
Dmitrii Gridin b2c8d7e777 [FIR] do not treat external ide annotations as real one
Such annotations are supposed to affect only diagnostic warnings

^KT-62310 Fixed
2023-10-13 12:16:12 +00:00
Dmitrii Gridin 2cac922cd0 [FIR] add tests on external annotations
Tests are excluded in COMPILED_JAVA mode because in this
mode external annotations are not present at all

^KT-62310
2023-10-13 12:16:12 +00:00
Dmitrii Gridin 850201a65c [LL FIR] LLFirContractsLazyResolver: avoid transformation for primary constructors
Primary constructors can't have any contracts.
This change also should improve memory consumption because we will
less frequently calculate bodies.

^KT-55750
2023-09-21 20:08:32 +00:00
Dmitrii Gridin e5f0356e16 [LL FIR] LLFirPhaseUpdater: add missing update for initializer body 2023-09-19 14:03:29 +00:00
Dmitrii Gridin 12dc6b1ebc [FIR] FirRenderer: render name for scripts
A script name is important information, so it is better to render it.
This also will fix the inconsistency with redundant space after 'SCRIPT:'.
2023-09-19 14:03:29 +00:00
Dmitrii Gridin c6bb9af823 [FIR] FirRenderer: add missing resolvePhaseRenderer usage for anonymous initializer and dangling modifiers 2023-09-19 14:03:29 +00:00
Dmitrii Gridin c9df6aff5f [LL FIR] do not crash on attempt to resolve class initializer in case of class clash
^KT-61788 Fixed
2023-09-19 14:03:29 +00:00
Dmitrii Gridin 5981fb3022 [LL FIR] drop copyright from testData 2023-09-18 21:12:45 +00:00
Dmitrii Gridin 33e6a85a2d [LL FIR] rename testdata to testData to avoid copyright generation
We exclude testData pattern from copyright scope
2023-09-18 21:12:45 +00:00