Commit Graph

621 Commits

Author SHA1 Message Date
Ilmir Usmanov 909b455758 Support generic underlying type of inline class in FIR
#KT-32162
2022-02-15 08:11:09 +01:00
Victor Petukhov a54c9edaad [FE 1.0] Report progressions resolve changing warning while calling Java methods which pass Collection
^KT-51062 Fixed
2022-02-14 15:43:43 +03:00
Mark Punzalan f1623347d8 Analysis API: Use stub FirDataFlowAnalyzer when getting candidates. 2022-02-11 13:22:58 +01:00
Mark Punzalan 3f3873dc50 Analysis API: Return KtCallCandidateInfo instead of KtCallInfo in
KtCallResolver.collectAllCandidates().
2022-02-11 13:22:58 +01:00
Mark Punzalan b8cdfc5aad Analysis API: Move AllCandidatesResolver closer to
SingleCandidateResolver and share common code.
2022-02-11 13:22:58 +01:00
Mark Punzalan 7a1ef25333 Analysis API: Rename resolveCandidates to collectCallCandidates.
Didn't bother to rename the directory in the test data.
2022-02-11 13:22:58 +01:00
Mark Punzalan 58c6c25fe9 Analysis API: Handle other FirElements in
KtCallResolver.resolveCandidates() and copy over remaining tests.
2022-02-11 13:22:58 +01:00
Mark Punzalan 9b9da94a09 Analysis API: Fix issues related to implicit invoke calls:
- Correctly set explicit receiver value.
- Restore original function call from FirImplicitFunctionCall (i.e.,
calls implicitly resolved to `invoke`) to get the correct name for
getting all candidates.
- Collect candidates at all tower levels.

Also make order of candidate calls in tests deterministic.
2022-02-11 13:22:58 +01:00
Mark Punzalan ace826c570 Analysis API: Get argument mapping from candidate and type parameters
from candidate symbol.
2022-02-11 13:22:58 +01:00
Mark Punzalan 0ed802bca4 Analysis API: Add tests for KtCallResolver.resolveCandidates(). 2022-02-11 13:22:57 +01:00
Mark Punzalan f62bdf5826 Analysis API: Move AbstractResolveCallTest from fir to components
package.
2022-02-11 13:22:57 +01:00
Mark Punzalan 4a09abc418 Analysis API: Add API functions to get all the candidates (with argument
mapping and substitutor) for a function call.
2022-02-11 13:22:57 +01:00
Vladimir Dolzhenko 918a91dbdf Escape special names with backticks in test data
#KT-51248
2022-02-10 21:20:47 +00:00
Roman Golyshev ca72790962 [FIR IDE] Hack checkIsInheritor until KT-51240 is fixed
We do not know for sure if there is any dependency between the
two classes passed to `checkIsInheritor`. To avoid the problem described
in KT-51240, we try to analyse them both and hope that the dependency
in some direction exists.

`NoCacheForModuleException` is introduced to signal about this
particular problem and avoid catching just any `NoSuchElementException`.

This hack is mainly done to fix very annoying KT-51240 for the time
being.

^KTIJ-20852 Fixed
2022-02-10 16:24:44 +03:00
Jinseong Jeon 02cfc8b821 AA: reuse CoreJarFileSystem from KotlinCoreEnvironment 2022-02-09 23:11:45 +01:00
Jinseong Jeon 6b4c4457d8 LL: fix a typo in LLFirSessionFactory 2022-02-09 23:11:45 +01:00
Jinseong Jeon 9be6520c96 AA: avoid NPE in compile-time constant evaluator 2022-02-09 23:11:44 +01:00
Jinseong Jeon a986aff429 AA: refactor service registrations
such that AA standalone mode doesn't need to unregister services that
were already registered by pre-analysis handlers
2022-02-09 23:11:44 +01:00
Jinseong Jeon 26e923e3ae AA: introduce static project structure provider by compiler configuration
Also add standalone mode utils to configure Application/Project environments
2022-02-09 23:11:43 +01:00
Jinseong Jeon d219de0f88 AA: avoid FIR dependency in frontend-independent module 2022-02-09 23:11:43 +01:00
Jinseong Jeon 6afd665c8d AA: rename the file according to the static factory in it 2022-02-09 23:11:42 +01:00
Jinseong Jeon fac4e5b243 LL: remove identical test impl for SealedClassInheritorsProvider 2022-02-09 23:11:42 +01:00
Roman Golyshev 42010282d5 [FIR IDE] Use correct extension receiver FIR expression in completion
`getOrBuildFir` does not record `FirCheckedSafeCallSubject`
expression, and it would be impossible to get them anyway
since there are no PSI corresponding to "not null receiver"
in expressions like `foo?.bar` - there is only `foo`,
which is considered nullable by FIR

`FirCheckedSafeCallSubject` wrapper has non-null type during
resolve, and it becomes very important in
`KtFirCompletionCandidateChecker`. If we loose the wrapper,
then it would be impossible to call extensions on nullable
types using `?.` syntax

^KTIJ-21021 Fixed
2022-02-07 22:06:28 +00:00
Ivan Kochurkin f32c355190 [FIR] Correct resolving of sam with suspend function from another module, ^KT-51007 Fixed
Ignore fir ide test probably because of KT-50732
2022-02-07 17:22:02 +03:00
Ivan Kochurkin 17c64cf955 [FIR] Add INV to UNARY_OPERATION_NAMES, ^KT-50998 Fixed 2022-02-07 17:22:02 +03:00
Ivan Kochurkin 30871fc08f [FIR] Infer labeled type for lambda in return in catch ^KT-51009 Fixed 2022-02-07 17:22:01 +03:00
Ivan Kochurkin a0510f4a67 [FIR] Fixed Replace ConeTypeVariable on ConeTypeParameter ^KT-51017
in AbstractConeCallConflictResolver.computeParameterTypes
2022-02-07 17:21:59 +03:00
Mads Ager a398f7d6cb Rename kt-reference module to kt-references. 2022-02-07 15:01:24 +01:00
Mads Ager 17aee1e944 Move frontend independent parts of KtReference.isReferenceTo up to share it. 2022-02-07 15:01:24 +01:00
Mads Ager 6f0bb0eda5 Add analysis:kt-reference module and move KtReferences there. 2022-02-07 15:01:23 +01:00
Dmitriy Novozhilov aadfc59d0f [FIR] Complete delegated constructor calls without proper constructed type
This is needed to definitely complete arguments of such calls
2022-02-07 13:36:38 +03:00
Dmitriy Novozhilov 1591518cf6 [FIR] Support constant unary operators for integer literal operators
^KT-38895
2022-02-07 13:36:37 +03:00
Dmitriy Novozhilov 52b72a7dac [FIR] Implement Int -> Long conversions for literals and operators over them
^KT-38895
^KT-50996 Fixed
^KT-51000 Fixed
^KT-51003 Fixed
^KT-51018 Fixed
2022-02-07 13:36:36 +03:00
Dmitriy Novozhilov b980f5ab32 [FIR] Introduce new kind of integer literal types for constant operator calls 2022-02-07 13:36:35 +03:00
Dmitriy Novozhilov 0bd3e8f418 [FIR] Rename ConeClassErrorType to ConeErrorType, drop ConeKotlinErrorType alias 2022-02-07 13:36:33 +03:00
Roman Golyshev 7c9000b8ac [FIR IDE] Consider FirFileSymbol in KtSymbolByFirBuilder.buildSymbol 2022-02-06 15:29:54 +03:00
Pavel Kirpichenkov 90abbb4a9f [MPP] Add test for inc/dec check in expect class
KT-49714
2022-02-04 16:57:21 +03:00
Mikhail Glukhikh 81ff9b820a FIR: make ConeSimpleKotlinType the only original for definitely not-null 2022-02-03 19:12:16 +03:00
Roman Golyshev 7e1a9e2b9a KTIJ-20637 Group files by module in getFacadeClassesInPackage also
Fixup for 35e2561dab, since these changes
were overlooked in the initial commit.

^KTIJ-20637 Fixed
2022-02-02 19:02:23 +03:00
Dmitriy Novozhilov e544c404b9 [FIR] Fix error message for CONFLICTING_INHERITED_MEMBERS 2022-02-02 10:55:40 +03:00
Roman Golyshev 35e2561dab KTIJ-20637 Group files by module and create facade class for each one
Before all files were going to `getOrCreateSymbolLightFacade`. If there
were both compiled and source files, it caused exceptions later
(see `SymbolLightClassFacadeCache.getOrCreateFirLightFacadeNoCache`).

When grouped by the `KtModule`, each file group should contain either
only sources or only compiled classes.

^KTIJ-20637 Fixed
2022-02-01 22:00:51 +03:00
Ilya Kirillov b8c36b7998 Analysis API FIR: remove compilation errors from new testdata 2022-02-01 16:31:29 +01:00
Ilya Kirillov 441de5cd75 Analysis API FIR: resolve Java synthetic properties KtSyntheticJavaPropertySymbol 2022-02-01 16:31:28 +01:00
Ilya Kirillov dcbf84771d Analysis API: regenerate tests 2022-02-01 16:31:27 +01:00
Mads Ager d13e117a58 Change FIR analysis API resolution for super type calls.
The IDE expects the super type calls to resolve to the constructor
invoked and not the class. The frontend itself resolves to the
class, so an extra layer is needed to adjust that to the constructor.
2022-02-01 16:31:26 +01:00
Denis.Zharkov 772579143b FIR: Change semantics for combination of safe calls and operators
^KT-41034 Fixed
2022-02-01 13:12:49 +03:00
Denis.Zharkov 6f89f1ebf4 FIR: Allow selector of safe calls to be a FirStatement
It's necessary to allow a?.b += v be interpreted as a?.(b += v)
But currently FirAssignmentOperatorStatement is not FirQualifiedAccess

^KT-41034 In Progress
2022-02-01 13:12:45 +03:00
Ilya Kirillov 6e999f6e84 LL API: refactoring: replace FirIDE prefixes with LLFir prefixes 2022-01-31 21:12:31 +01:00
Ilya Kirillov 4530041cbb Analysis API: move reference resolve testsdata with errors to dedicated folders 2022-01-31 21:12:30 +01:00
Ilya Kirillov caddbda01b Analysis API FIR: introduce library resolve tests 2022-01-31 21:11:56 +01:00