Commit Graph

73 Commits

Author SHA1 Message Date
Ilya Kirillov 69c024a5ce [FIR] optimize deprecation calculation for symbols
All symbols except member callables can be deprecated if they have non-empty annotation list

^KT-56800 fixed
2023-02-24 16:10:57 +01:00
Egor Kulikov 6bb71b44f6 [FIR] Use lazy constructor delegate even if there's no KtConstructor
Twelfth step for ^KT-52615

Merge-request: KT-MR-8895
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
2023-02-20 10:50:09 +00:00
Denis.Zharkov 9fa0f51a61 K2: Fix false-negative RETURN_TYPE_MISMATCH
^KT-53987 Fixed
^KT-55932 Fixed
2023-02-15 08:13:42 +00:00
Denis.Zharkov fe5adab652 K2: Avoid inference diagnostics when arguments are already error typed
For example, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER

It became especially relevant after 0e84bf2053
that together with later commits bring a lot of unnecessary
NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER diagnostic
2023-02-15 08:13:41 +00:00
Dmitriy Novozhilov e9204521a9 [FIR] Properly create type ref for error type in various places 2023-02-06 08:09:56 +00:00
Kirill Rakhman 1eb18f13bd FIR: Fix test data after making LHS of assignment an expression
KT-54648
2023-01-31 08:39:43 +00:00
Yan Zhulanow 699f96284a [FE] Add missing 'lazyResolveToPhase()' before recursive bound check
^KTIJ-24087 Fixed
2023-01-30 11:09:42 +00:00
Anna Kozlova e54627b309 [FIR] add missed diagnostics for incomplete code
^KT-55053
2023-01-27 18:36:36 +00:00
Anna Kozlova b026678a34 [LL] retrieve fir from generated property of desugaring ++ operator
^ KTIJ-24385
Temp property to store receiver is generated for `a.b++` expression.
If this property's psi corresponds to receiver expr, then FirProperty
would be found by mapper if receiver is requested.
It works unexpectedly, because FirProperty is normally not expected by expression.
This change set fake sources for generated FirProperty, so it won't be found
by source psi
2023-01-25 11:03:29 +00:00
Yan Zhulanow 9619c695b7 [LL API] Support nested type aliases in file-based declaration provider 2023-01-25 08:04:41 +00:00
Yan Zhulanow 5120da6b70 [LL API] Rename 'outside' testPrefix with 'out_of_src_roots' 2023-01-25 08:04:40 +00:00
Yan Zhulanow 562952080e [LL API] Add tests for 'FileBasedKotlinDeclarationProvider' 2023-01-25 08:04:39 +00:00
Yan Zhulanow f1edbc1a14 [LL API] Add tests for 'out of content root' analysis mode 2023-01-25 08:04:36 +00:00
Egor Kulikov 195ecad004 [FIR] Make annotations arguments lazy in RawFirBuilder
Sixth step for ^KT-52615
2023-01-24 16:02:53 +00:00
Ilya Kirillov 1bbcae5ed2 [FIR] fix resolve contract violation from scopes
We cannot call lazy resolve to STATUS phase from scopes as scopes may be accessed on a STATUS phase or earlier

^KT-54890
^KTIJ-23587 fixed
2023-01-13 21:32:51 +00:00
Anna Kozlova 15b1e429d7 [compiler] introduce dedicated Fir declaration for dangling modifier lists (KTIJ-23008)
ensure fir annotations are included in FirDanglingModifierList and resolved,
dedicated DanglingTopLevelModifierListStructureElement exists for top
level lists only, class level lists are processed by containing structure
element
2022-12-21 20:58:46 +00:00
Anna Kozlova b81c210535 [AA] resolve array access expression to corresponding set operator
k1 would suggest `get` as well
 but with current fir structure with fake desugaring
 get is moved to the separate fake psi which doesn't exist
 thus the problem is ignored for now
 ^ KTIJ-24025
2022-12-21 10:45:40 +00:00
Anna Kozlova a529f8510d [LL] ensure FirConstExpression's annotations are not lost (KTIJ-23968) 2022-12-15 14:31:48 +00:00
Dmitriy Novozhilov b174bb8844 [FIR] Update testdata after introducing FirResolvedErrorReference 2022-12-15 12:12:19 +00:00
Mikhail Glukhikh b271b409c7 Fix final -> open modality in new test data after 2022-12-14 23:19:37 +01:00
Steven Schäfer 6af616d3c3 FIR: make declarations marked with 'override' implicitly open
#KT-52236 Fixed
2022-12-14 21:46:41 +00:00
Ilya Kirillov cd83fec078 [LL FIR] fix lazy resolve of status for the members of the nested class
^KTIJ-23932 fixed
2022-12-13 13:16:32 +00:00
Mikhail Glukhikh df5aa59185 K2: Don't use FirTypeParameterSymbol.resolvedBounds() from inference 2022-12-12 16:21:05 +00:00
Ilya Kirillov 5477e2073f [Analysis API] fix typo in testdata filenames 2022-12-05 17:27:43 +01:00
Ilya Kirillov c899f6dae3 [LL FIR] fix lazy resolution of member property statuses for anonymous objects
Previously, statuses of superclass which are not local was not ignored

Sometimes it worked in the IDE by calling lazyResolveToPhase
which is a violation of the lazy resolution contract

^KT-54890
2022-12-05 17:27:42 +01:00
Yan Zhulanow bcf1389ae5 [LL API] Fix enum value lazy analysis (KTIJ-23833)
^KTIJ-23833 Fixed
2022-12-05 11:44:15 +00:00
Egor Kulikov fb2485f83c [FIR] Make constructor delegate lazy in RawFirBuilder
Fifth step for ^KT-52615

Merge-request: KT-MR-7860
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
2022-12-02 03:12:51 +00:00
Anna Kozlova 98cb25605a [LL] testdata for KTIJ-21468
ensure that for each destructuring declaration entry exists FirProperty
2022-11-24 10:20:38 +00:00
Ilya Kirillov c8e3103af9 [FIR] do not create FirParameter for catch parameter
use FirProperty instead

^KT-55034
2022-11-22 18:25:30 +01:00
Dmitriy Novozhilov 0e84bf2053 [FIR] Don't report ARGUMENT_TYPE_MISMATCH on error types 2022-11-22 15:46:19 +00:00
Anna Kozlova 3fdd0aacd3 [compiler] preserve fir receiver in tree
when selector is invalid expression,
ensure that fir tree still contains receiver as well as selector

KTIJ-23578
2022-11-22 10:46:59 +00:00
Ilya Kirillov b6481ed891 [FIR] do not use FirValueParameter for function type parameter
As it is a different abstraction, introduced FirFunctionTypeParameter instead

Also, fix syntax checkers for function type parameter

^KT-55035 fixed
2022-11-21 16:17:51 +00:00
Ilya Kirillov 8dab560d6e [LL FIR] fix status resolution of static enum members
Before, BODY_RESOLVE phase were used for them but status may be unresolved.
This caused CCE on accessing resolved status for such static enum members.

Now, those declarations are created with the status of owning enum as the status is taken from that class.
2022-11-16 19:44:18 +00:00
Nikolay Lunyak 89f8821d0a [FIR] KT-53371, KT-53519: Fix annotations arguments mapping
See: compiler/testData/asJava/lightClasses/
AnnotatedParameterInInnerClassConstructor.kt

The muted tests don't work with the (KT-53371, KT-53519)-related
changes. During this test happens an attempt to access unresolved
annotations via CustomAnnotationTypeAttribute.
Discussion: KTIJ-23547
2022-11-14 22:40:41 +02:00
Anna Kozlova 9f470e2a4d [LL API] return FirErrorProperty for top level destructuring declaration
KTIJ-23552
2022-11-11 17:39:54 +01:00
Anna Kozlova 3590c4ea35 [Analysis API FIR] support generated temp properties
KTIJ-23492 (array index expression), KTIJ-23138 (inc/dec desugaring)
2022-11-11 17:39:53 +01:00
Yan Zhulanow b770e5d02f [LL API] Get designation correctly for enum value members (KTIJ-23458)
Although being a 'KtClass' in the PSI, 'KtEnumEntry' is a callable in
Analysis API, and its direct members should also be treated as local.
2022-11-11 11:28:38 +00:00
Yan Zhulanow 61ce9fe524 [FE] Fix source element duplication in object literal expressions 2022-11-11 11:28:35 +00:00
Kristoffer Andersen fcabc60471 [FIR] Insert fake source for FIR for array access temporaries 2022-10-05 16:22:22 +02:00
Ilya Kirillov 49f2f85927 [Low Level FIR] fix exception when creating symbol by invalid code 2022-10-04 12:56:07 +00:00
Roman Golyshev 16cb3064c8 [FIR] Resolve value class constructor to TYPES before using its params
Right now it is the easiest way to ensure that all the parameters are
resolved. After KT-53573 is fixed, we might use `resolvedReturnTypeRef`
on each parameter individually instead

Also, add `toString` implementation to `ValueClassRepresentation`
classes, so they are properly rendered in testdata

^KTIJ-22630 Fixed
2022-08-30 13:49:40 +00:00
Vsevolod Tolstopyatov 22e26d0756 Move EnumEntries LVS to 1.9
* Also cleanup tests to avoid using obsolete WITH_RUNTIME
2022-08-12 09:35:32 +00:00
Mikhail Glukhikh 7333589663 K1/K2: add Enum.entries unconditionally and filter them out in tower
Before this commit, we added Enum.entries only in case when
LanguageFeature.EnumEntries was ON (with an exception in K1/Java case).
In this commit we add Enum.entries unconditionally, and in case
the language feature is OFF we filter them out during tower resolve.
2022-08-12 09:35:27 +00:00
Ilya Kirillov e7e9c24473 [LL FIR] update lazy resolve testdata after changes in phases 2022-08-10 22:49:18 +02:00
Ilya Kirillov 72da40f97c [LL FIR] update phase of type parameters on lazy resolve 2022-08-10 22:49:14 +02:00
Ilya Kirillov 0f6f901179 [LL FIR] render type parameters resolve phase in tests 2022-08-10 22:49:13 +02:00
Ilya Kirillov cd063d0cd0 [LL FIR] update phase of value parameters on lazy resolve
Previously, such phases may not be properly set which could cause additional lazy resolve
2022-08-10 22:49:13 +02:00
Mikhail Glukhikh 7ce5100946 FirRenderer: slightly change/refactor declaration rendering 2022-07-14 09:38:45 +00:00
Roman Golyshev 8fca9f41eb [FIR IDE] Correctly check declarations' modalities in SamResolver
Modality might be null before the declaration itself is resolved to
`STATUS`

^KT-52667 Fixed
2022-06-07 21:14:24 +00:00
Roman Golyshev 166c771e1b [FIR IDE] Ensure resolve to CONTRACTS phase in ReturnTypeCalculator
If we want to analyse some function's call, we need to know about its
contracts, otherwise resolving the following code would be broken.
Computing return type of function is a prerequisite to using it in any
sensible way, so it's the best place to resolve it to CONTRACTS

KT-50733
2022-06-06 09:14:37 +00:00