Commit Graph

930 Commits

Author SHA1 Message Date
Dmitriy Novozhilov f34061acc1 [FIR] Fix resolution of plugin annotations annotated with meta annotations
There was a problem, that after founding of new annotation with meta
  annotation we did not come back to previous files, which may contain
  declarations with this new annotation
2022-06-07 14:12:19 +00:00
Dmitriy Novozhilov 055865a2a1 [FIR-IDE] Register checkers from plugins in IDE session 2022-06-07 14:12:19 +00:00
Dmitriy Novozhilov 259862d294 [Parcelize] Reorganize module structure of Parcelize plugin
Also mark parcelize as compatible with K2
2022-06-07 14:12:15 +00:00
Jinseong Jeon 7878c19225 LL: delete technically empty file 2022-06-07 13:39:56 +02:00
Denis.Zharkov eae673233b FIR: Rework FirRegularTowerDataContexts
- Get rid of SPECIAL mode (just left REGULAR and class-related instead)
- Clear naming
- Restore contexts after lambda/callable reference are processed

The test has been failing before this change because after
callable reference is resolved, its tower data context has been left
erroneously in the SPECIAL-related entry
2022-06-06 09:39:29 +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
Roman Golyshev bc853e45e8 [FIR IDE] Do more precise extraction of the dispatcher receiver
If the `candidateSymbol` is an extension, then it cannot be called with
an explicit dispatch receiver, because only the extension receiver
can be explicit in such case

Therefore, we consider `receiverExpression` to be a dispatch
receiver only if the `candidateSymbol` is not an extension

KTIJ-21910
2022-06-03 16:37:17 +00:00
Roman Golyshev e92cd609fb [FIR IDE] Correctly collect containing declarations in init { ... }
`init` is not a callable declaration, and is considered local, so you
cannot build a designation starting from it. In that we case we traverse
parents until we find the first non-local class, and use it as a
container

KTIJ-21910
2022-06-03 16:37:16 +00:00
Mikhail Glukhikh 0ee04d0825 FE10 analysis API: revert resolving 'this' references to receivers
FE10 IDE plugin relies on resolving 'this' references to class or callable
2022-06-03 16:25:44 +00:00
Nikolay Lunyak 8d2868da32 [FIR JS] Regenerate tests
вфцвфдцьв
2022-06-02 13:47:34 +00:00
Nikolay Lunyak c2cecb2818 [FIR JS] Add the dynamic type unsupported checker 2022-06-02 13:47:33 +00:00
Nikolay Lunyak 858999c1a1 [FIR] Preserve information about prefix/postfix-ness
This information is needed for dynamics
2022-06-02 13:47:31 +00:00
Nikolay Lunyak ac1fb07102 [FIR JS] Add checkers.js 2022-06-02 13:47:28 +00:00
Nikolay Lunyak c8ef427421 [FIR JS] Fix ConeDynamicType in asPsiType 2022-06-02 13:47:26 +00:00
Nikolay Lunyak 611691ec70 [FIR JS] Support smart casts for dynamic 2022-06-02 13:47:25 +00:00
Nikolay Lunyak 98c7399a35 [FIR] Remove the redundant backing field check
This commit fixes a failing visibility check
(FirSymbolByPsiTestGenerated.testBackingField) for the backing field.

Merge-request: KT-MR-6389
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
2022-06-02 08:36:14 +00:00
Denis.Zharkov 461d91a10e FIR: Rework checking dispatch receivers applicability
Using `ownerLookupTag` might be wrong in case of private constuctors
 of inner classes: their owner is an Inner class, but expected
 dispach receiver is Outer
2022-06-01 16:02:31 +00:00
Denis.Zharkov 67e6687e89 FIR: Fix FP error on a call to constructor of a private inner class
Do not check dispatch receiver applicability when checking visibility
for containing class of a callee constructor
2022-06-01 16:02:30 +00:00
Denis.Zharkov c1904004c4 FIR: Fix case when smartcast receiver is used for call to private method
^KT-54432 Fixed
2022-06-01 16:02:30 +00:00
Denis.Zharkov ccc32b4e3b FIR: Refine visibility check for private methods defined in a class
- use-site should be contained within the class that owns callee symbol
- class-representative of dispatch receiver value
should be exactly the same as a container class of a callee (not its subtype)
2022-06-01 16:02:29 +00:00
Roman Golyshev 01ce499bb2 [FIR] Unify some special names to make code more uniform 2022-06-01 00:11:17 +04:00
Victor Petukhov b472ccd358 [FE 1.0] Introduce deprecation of inferred type variable into a declared upper bound within a builder inference call 2022-05-31 14:13:29 +00:00
Victor Petukhov 848075192c [FE 1.0] Don't use BuilderInferenceSubstitutionConstraintPosition for declared upper bound constraint with no substituted upper bound
It leads to further infer type variable into those upper bounds which is forbidden

Substituted upper bounds is ok because specific substituted types came from constraints of other proper positions, or if specific substituted type is from declared upper bound too, then there should be another declared upper bound with no substitution

^KT-51464 Fixed
^KT-47986 Fixed
2022-05-31 14:13:28 +00:00
Mikhail Glukhikh c3b5d83f31 FE10 Analysis API: create 17 separate test data files for resolve 2022-05-31 11:34:59 +00:00
Mikhail Glukhikh a3db2e13b2 FE10 analysis API: render type parameter bounds as FIR does 2022-05-31 11:34:58 +00:00
Mikhail Glukhikh d792c7b70c Reference analysis API: add stub for ReadWriteAccessChecker to run tests 2022-05-31 11:34:57 +00:00
Mikhail Glukhikh 1ae71a20f3 FE10 analysis API: support reference resolve for labels & 'this' 2022-05-31 11:34:56 +00:00
Mikhail Glukhikh 8cb3081bbd Analysis API: add KtReference..Provider to fix reference resolve in FE10 2022-05-31 11:34:56 +00:00
Mikhail Glukhikh d67e910ee8 FE10 Analysis API: don't render override for deserialized 2022-05-31 11:34:55 +00:00
Mikhail Glukhikh f4510773d0 FIR analysis API: add workaround for java.io.Serializable type 2022-05-31 11:34:54 +00:00
Mikhail Glukhikh ef5cfab655 FE10 analysis API: don't count static members of final class as final 2022-05-31 11:34:53 +00:00
Mikhail Glukhikh 446ee943e2 FIR analysis API: fix rendering of Java-based types 2022-05-31 11:34:53 +00:00
Mikhail Glukhikh 125de59e09 FE10 analysis API: create receiver parameter symbols for 'this' 2022-05-31 11:34:52 +00:00
Mikhail Glukhikh d112ab3f17 FE10 analysis API: fix parentheses using while rendering receiver 2022-05-31 11:34:51 +00:00
Mikhail Glukhikh 564d179cfb FE10 analysis API: fix flexible type pretty-printing 2022-05-31 11:34:50 +00:00
Mikhail Glukhikh fa0faa33a5 FE10 analysis API: create package symbols properly 2022-05-31 11:34:49 +00:00
Mikhail Glukhikh 213445347d Fix PsiType for local class in FE10 Analysis API
After this commit,
Fe10IdeNormalAnalysisSourceModuleAnalysisApiPsiTypeProviderTestGenerated
test group passes
2022-05-31 11:34:48 +00:00
Mikhail Glukhikh ffc17bea55 Add SymbolLightClassFacadeCache to FE10 Analysis API configuration 2022-05-31 11:34:48 +00:00
Mikhail Glukhikh 8fce239209 Generate even more FE10 analysis API tests 2022-05-31 11:34:47 +00:00
Victor Petukhov c266303197 [FE 1.0] Introduce "range until operator" language feature, and report errors on its usages till 1.8 2022-05-31 08:42:57 +00:00
Victor Petukhov 0b25ce4de9 [FE] Support resolve of until operator to rangeUntil
^KT-52420 Fixed
2022-05-31 08:42:55 +00:00
Stanislav Erokhin 2deb0cc237 FIR/Analysis API: Add KtValueParameterSymbol#generatedPrimaryConstructorProperty
This property are used to allow access to the property created from
the primary constructor parameter
2022-05-30 18:39:21 +00:00
Ilya Kirillov 314d9b9477 [analysis] move DecompiledPsiDeclarationProvider to symbol light classes module to avoid circular dependencies 2022-05-30 17:48:34 +02:00
Jinseong Jeon 55e24451a4 AA: migrate PSI declaration provider (from IJ) 2022-05-30 17:48:34 +02:00
Ivan Kochurkin 792aa24a04 [FIR] Throws by star import wins builtin Throws, ^KT-52407 Fixed, ^KT-52517 Fixed 2022-05-29 23:41:27 +03:00
Ivan Kochurkin feb3f41108 [FIR] Fix resolve inside lambda
The lambda is passed to extension function with type parameters
that defined inside this lambda

^KT-52197
^KT-52190 Fixed
2022-05-29 23:41:25 +03:00
Ilya Kirillov e25dee558f [Analysis API] make KtDeclarationSymbol <: KtDeclarationSymbol
To simplify work with annotations
2022-05-27 16:39:38 +00:00
Ilya Kirillov f189fd1ff0 [Analysis API] make KtDeclarationSymbol <: KtSymbolWithTypeParameters
To simplify work with type parameters
2022-05-27 16:39:37 +00:00
Jiaxiang Chen 8f4554959e AA: make KtClassifierSymbol a subtype of KtAnnotatedSymbol 2022-05-27 16:39:37 +00:00
Jiaxiang Chen 866ebcfe2e AA: make KtCallableSymbol a subtype of KtAnnotatedSymbol 2022-05-27 16:39:37 +00:00