Commit Graph

101619 Commits

Author SHA1 Message Date
Dmitrii Gridin 01a94624f5 [AA FIR] KtFirScopeProvider: use lazy resolve only if needed
^KT-56551
2023-05-19 12:43:45 +00:00
Dmitrii Gridin f2da13b39d [AA FIR] KtFirMemberSymbolPointer: replace explicit lazy resolve call with implicit
^KT-56551
2023-05-19 12:43:45 +00:00
Dmitrii Gridin 04231d7497 [AA FIR] add missing memberRequiredPhase to some usages of unsubstitutedScope
^KT-56551
2023-05-19 12:43:45 +00:00
Dmitrii Gridin fdec0bd942 [FIR] drop redundant memberRequiredPhase parameter from overriddenFunctions
It should be STATUS always, because we want to process overrides

^KT-56551
2023-05-19 12:43:45 +00:00
Dmitrii Gridin aaf173687b [FIR] rename requiredPhase to requiredMembersPhase for type scope
Also move `requiredMembersPhase` use inside `unsubstitutedScope`

^KT-56551
2023-05-19 12:43:44 +00:00
Dmitrii Gridin 52ce302095 [FIR] AbstractFirStatusResolveTransformer: drop unreachable 'if'
^KT-56551
2023-05-19 12:43:44 +00:00
Dmitrii Gridin 595279887a [LL FIR] add correct isResolved check to expect-actual phase transformer 2023-05-19 12:19:36 +00:00
Dmitrii Gridin 71386cc117 [FIR] SignatureEnhancement: fix CME from type parameters enhancement
The problem was that type parameters of Java function were changed
without any synchronization.
In fact, we shouldn't mutate Java declarations at all.
So now we don't mutate type parameters – instead of this,
we mutate only its copy that is safe

^KT-58613 Fixed
^KTIJ-25242 Fixed
^KTIJ-21791 Fixed
2023-05-19 12:17:12 +00:00
Anastasia.Nekrasova fa6fc0e334 [IR] Fix local function with default param
The key 'localDeclarationsData' is a IrFunction whose symbol owner is 'IrDeclarationOrigin.LOCAL_FUNCTION'. To find the 'localsData', it's required to get the original local IrFunction ('IrDeclarationOrigin.LOCAL_FUNCTION') for the IrFunction with default arguments (IrDeclarationOrigin.FUNCTION_FOR_DEFAULT_PARAMETER).

Related to KTIJ-25558
2023-05-19 11:57:10 +00:00
Ilya Kirillov 993acad3f3 [Analysis API] optimize DeclarationsInPackageProvider.getTopLevelClassifierNamesInPackageProvider 2023-05-19 11:53:16 +00:00
Ilya Kirillov d1da3b8acd [Analysis API] fix missing names in KtFirStarImportingScope
The missing name types were: java classifier names, callable/classifier names generated by plugins
2023-05-19 11:53:16 +00:00
Ilya Kirillov 546191d1b3 [Analysis API] refactoring, simplify constructor KtFirStarImportingScope 2023-05-19 11:53:16 +00:00
Ilya Kirillov 50c49838ba [Analysis API] refactoring, extract top level name collecting to a separate file
out of KtFirPackageScope
2023-05-19 11:53:16 +00:00
Ilya Kirillov 51c04b624f [Analysis API] optimize KtFirPackageScope.getPossibleClassifierNames
Previously, we did the kotlin subclasses name search two times:
- via `KotlinDeclarationProvider`
- via `JavaElementFinder`

which is redundant and slows down the searching
2023-05-19 11:53:16 +00:00
Ilya Kirillov c646008438 [Analysis API] refactoring, extract forEachNonKotlinPsiElementFinder to a separate file 2023-05-19 11:53:16 +00:00
Ilya Kirillov f8ddf204e2 [Analysis API] add KtTypeScope.getCallableSignatures/getClassifierSymbols overloads which accept a candidate name set
This is needed for the cases when a candidate name set is known
to avoid retrieving a set with all possible names when processing the scope.

Similar to KtScope.

^KT-58653
2023-05-19 11:53:15 +00:00
Ilya Kirillov ee1fd9f6e9 [Analysis API] optimize composite scope
Do not create KtCompositeScope for empty or single scopes
2023-05-19 11:53:15 +00:00
Ilya Kirillov 950a32901c [Analysis API FIR] refactoring, remove duplicated code from KtFir(Non)StarImporting scope
use base class implementation instead.
2023-05-19 11:53:15 +00:00
Ilya Kirillov 55bbc5eb02 [Analysis API FIR] refactoring, extract base part of KtFirDelegatingScope into a separate class
For further reuse
2023-05-19 11:53:15 +00:00
Ilya Kirillov 41976a2932 [Analysis API] optimize scope members processing when a candidate name set is known
Use KtScope.getCallableSymbols/getClassifier symbols overloads which accept a candidate name set.

^KT-58653
2023-05-19 11:53:15 +00:00
Ilya Kirillov 29be88e3c9 [Analysis API] add KtScope.getCallableSymbols/getClassifier symbols overloads which accept a candidate name set
This is needed for the cases when a candidate name set is known
 to avoid retrieving a set with all possible names when processing the scope.

^KT-58653 fixed
2023-05-19 11:53:15 +00:00
Kirill Rakhman aacdfb67c6 [Stubs] Bump stubs version
#KT-58786
2023-05-19 11:50:40 +00:00
Kirill Rakhman 47b8fd7e0c [AA] Mute tests related to decompilation of aliased types from stubs
#KT-58786
2023-05-19 11:50:40 +00:00
Kirill Rakhman 8f447e5b78 Revert "[AA] Deserialize reference to typealias from stubs as fully expanded"
This reverts commit 3c22b1ce53.

#KT-58335
#KT-58786
2023-05-19 11:50:40 +00:00
Vladimir Sukharev 363c56e226 [K2/N] Export C adapters for non-root packages
^KT-56182

Merge-request: KT-MR-10160
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-05-19 11:40:59 +00:00
Sergey Bogolepov c57c34525f [K/N] KT-58562: Implement frontend checkers for HiddenFromObjC on classes 2023-05-19 11:33:17 +00:00
Ilmir Usmanov f3a22e0ac4 Warn about suspend extension functional types as supertypes
They will become error in 2.0

 #KT-58529 Fixed
 #KT-49175 Fixed
2023-05-19 12:41:37 +02:00
Dmitriy Novozhilov b19116d3af [FIR] Provide implementation of ExpectActualMatchingContext for FIR
^KT-58578
2023-05-19 10:19:17 +00:00
Dmitriy Novozhilov 8338370fbd [FE 1.0] Provide implementation of ExpectActualMatchingContext for FE 1.0
^KT-58578
2023-05-19 10:19:17 +00:00
Dmitriy Novozhilov b26b649d4e [FE] Introduce commonized version of expect/actual compatibility calculator
This is needed to use the same code for those checks between
  both frontends and backend

^KT-58578
2023-05-19 10:19:17 +00:00
Dmitriy Novozhilov 2c2f12d9ac [FIR] Slightly reformat FirFunctionSymbol.kt 2023-05-19 10:19:17 +00:00
Michael Knudson 067456c052 Clarify error message for abstract property in primary constructor 2023-05-19 09:40:49 +00:00
Dmitrii Gridin 16214e01d1 [LL FIR] do not process member declarations during expect-actual phase
^KT-56551
2023-05-19 09:26:43 +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
Dmitrii Gridin 14b28ba99b [LL FIR] drop redundant lazy resolve to imports phase
Also, createTowerDataContext now uses cache

^KT-56551
2023-05-19 09:22:22 +00:00
Dmitrii Gridin 81ff3916e6 [LL FIR] resolve file to import phase only under lock
^KT-56551
2023-05-19 09:22:21 +00:00
Dmitrii Krasnov 8e3469f220 added mpp platform values into AllowedListAnonymizer for statistics
#KT-58104 InProgress
2023-05-19 06:41:52 +00:00
Ivan Kylchik e0e1d57120 [IR] Check object init was called in case of name interpretation
#KT-58717 Fixed
2023-05-18 18:16:54 +00:00
Ivan Kylchik e5c45a4e51 [IR] Move extension val property into Utils for interpreter 2023-05-18 18:16:54 +00:00
Ivan Kylchik 70560fc3eb [IR] Handle each interpreter checker one by one
This wy we can interpret all expressions like `A::a.name` at first and
after that evaluate all complex expressions like
`A::a.name + A::b.name`.
2023-05-18 18:16:54 +00:00
Ivan Kylchik e58e20fc7b [IR] Add special preprocessors for ir interpreter
These preprocessors allow us to modify IR at first and only after that
try to evaluate. With this we can drop `KCallableNamePropertyLowering`.
2023-05-18 18:16:54 +00:00
Ivan Kylchik c8371a339f [IR] Create common interface for all interpreter checkers 2023-05-18 18:16:54 +00:00
Ivan Kylchik 82a111250b [IR] Drop excess containingDeclaration parameter from IR checker 2023-05-18 18:16:54 +00:00
Ivan Kylchik 1fd8ef801e [IR] Create special checker that will analyze name methods
We can insert all this logic into `IrCompileTimeChecker` but it is
a little bit specific and looks like it is nicer to just extract it.
2023-05-18 18:16:54 +00:00
Ivan Kylchik 104ac4bd69 [IR] Move IR interpreter transformers into separate package 2023-05-18 18:16:53 +00:00
Ivan Kylchik b779dc5d27 [IR] Drop all explicit usages of EvaluationMode from interpreter checker 2023-05-18 18:16:53 +00:00
Ivan Kylchik e3fa342d5c [IR] Drop WITH_ANNOTATIONS evaluation mode in interpreter
This is old mode, that was used mainly in prototype phase
2023-05-18 18:16:53 +00:00
Ivan Kylchik 535806d0ab [K2] Force interpretation of default argument for annotation's property
We miss these expression because they might be represented as
`IrGetFiled` values, but they still must be turned into `IrConst`.

#KT-58007 Fixed
2023-05-18 18:16:53 +00:00
Yahor Berdnikau 37402336d5 [Gradle] Fix compiler plugins options were not passed to KaptGenerateStubs task
^KT-58745 Fixed
2023-05-18 14:55:16 +00:00
Sergej Jaskiewicz 5f5b32b8ae [IR] Add kdocs for IrSymbol-related classes and interfaces 2023-05-18 12:19:52 +00:00