Commit Graph

132 Commits

Author SHA1 Message Date
Tianyu Geng 2c2851af6e Analysis API: add test covering get missing when branches
Also fix FIR implementation to generate boolean branches in the same
order as FE1.0.
2021-11-04 23:04:35 +01:00
Tianyu Geng ae50d52131 FIR IDE: add validity token to data classes related to smartcast API
Also move KtImplicitReceiverSmartCast closer to where it's used.
2021-11-04 16:00:38 +01:00
Tianyu Geng 197079c85c FIR IDE: make smartcast API return unstable smartcasts 2021-11-04 16:00:37 +01:00
Ilya Kirillov 6462642988 Analysis API: fix type rendering for ConeDefinitelyNotNullType 2021-11-04 12:05:05 +01:00
Ilya Kirillov da88ddfc71 FIR IDE: always approximate non-denotable types for creating PsiType 2021-11-04 12:05:04 +01:00
Ilya Kirillov 79f30755a5 FIR LC: do not create light classes for non-source declarations 2021-11-04 12:05:03 +01:00
Ilya Kirillov 55e6df6920 Analysis API: do not consider ValidityToken when comparing symbols and types
Symbols with the same FirDeclaration may come from the different analysis sessions
2021-11-04 12:05:02 +01:00
Ilya Kirillov d63c136854 Analysis API: recreate analysis session when not found by resolve state 2021-11-04 12:04:54 +01:00
Jinseong Jeon c3c79b874d FIR IDE: make constant evaluator robust to arithmetic exception 2021-11-01 22:50:47 +01:00
Dmitriy Novozhilov 877b53201b [FIR] Prohibit access to members of companion of enum from enum entry initializer
^KT-49110
2021-10-29 18:45:23 +03:00
Roman Golyshev 29bb8cea8f [FIR] Add missing ensureResolved to FirClassSubstitutionScope
`createNewTypeParametersAndSubstitutor` call might need resolved types
to be able to work correctly with the generics' type bounds
2021-10-29 15:59:35 +03:00
Tianyu Geng b48870c11f FIR checker: pass expected array type in ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION
This is needed by the IDE quickfix to generate the correct `arrayOf` (or
`intArrayOf`, etc`) wrapper call.
2021-10-28 16:36:02 +03:00
Dmitriy Novozhilov 4490f64666 [FIR] Get rid of FirAnnotatedDeclaration
Now all fir declarations have annotations

^KT-49260 Fixed
2021-10-28 15:01:18 +03:00
Ilya Chernikov da2d3f29da Add multiple renderer sources support to new diagnostics infrastructure 2021-10-27 22:17:41 +02:00
Ilya Chernikov 9e60c70db7 Add abstract source element and switch diagnostics to it 2021-10-27 22:17:40 +02:00
Ilya Chernikov e9f59e8d1d Move common diagnostics infrastructure to frontend.common 2021-10-27 22:17:39 +02:00
Ilya Chernikov f1d0ead652 Fix fir analysis api after refactorings 2021-10-27 22:17:39 +02:00
Ilya Chernikov 31c58767cf Rearrange fir diagnostic for further reuse 2021-10-27 22:17:39 +02:00
Ilya Chernikov a65beb2dc5 Move Fir*SourceElement to frontend.common, rename to Kt* (complete) 2021-10-27 21:44:11 +02:00
Mikhail Glukhikh 8bd0b237b7 Convert EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR into deprecation error
#KT-28078 Fixed
2021-10-27 19:43:01 +03:00
Jinseong Jeon 3f2c86afb8 FIR IDE/LC: introduce/use delegated member scope 2021-10-27 17:06:32 +02:00
Jinseong Jeon 700f8ac287 FIR IDE: relocate scope-related test data 2021-10-27 17:06:32 +02:00
Jinseong Jeon 4266ffa274 FIR IDE: fix typo in test directory (overridden) 2021-10-27 17:06:32 +02:00
Jinseong Jeon b52912162f FIR IDE: API to indicate delegated property 2021-10-27 17:06:30 +02:00
Dmitriy Novozhilov f26059a7d3 [FE] Add clear warning about future changes about nullability of safe call with non nullable receiver
^KT-46860
2021-10-27 16:28:37 +03:00
Roman Golyshev 8e911b1e98 [FIR IDE] Add fast path to isImplicitFunctionCall and improve its kdoc 2021-10-26 16:48:00 +03:00
Tianyu Geng e195f0426e FIR IDE: add KtExtensionReceiverSymbol
This symbol represents the extension receiver of a callable and
currently is used as the resolution target of `this` in a callable with
extension.
2021-10-26 08:50:38 +00:00
Tianyu Geng d3c91ee9be FIR IDE: align resolution behavior of super with FE1.0
That is, for a labeled `super`, the keyword should resolve to the super
type and the label should be resolved to the current type.
2021-10-26 08:50:37 +00:00
Tianyu Geng 0d966ec65a FIR IDE: resolve implicit invoke to callable property 2021-10-26 08:50:37 +00:00
Tianyu Geng 6a59dc7fa5 FIR: add bfs helper and use it
It's also used in Kotlin quickfixes in intellij repo
2021-10-26 00:42:09 +02:00
Ilya Kirillov a11cd74b28 Revert "FIR: add bfs helper and use it"
This reverts commit dbb0496d23.
2021-10-26 00:37:31 +02:00
Tianyu Geng dbb0496d23 FIR: add bfs helper and use it
It's also used in Kotlin quickfixes in intellij repo
2021-10-26 00:06:00 +02:00
Jinseong Jeon 9524825662 FIR LC: approximate local type only if it's necessary and out of scope 2021-10-25 20:24:48 +03:00
Jinseong Jeon 9ed2c9d371 FIR LC: add tests about type approximation in PsiType provider 2021-10-25 20:24:48 +03:00
Tianyu Geng 7fb82232cd FIR IDE: use correspondingProperty in ref shortener 2021-10-25 18:16:32 +03:00
Tianyu Geng 112f365414 FIR IDE: fix ref shortener on property in primary constructor
Currently the shortener ignores the created FirProperty, as a result,
any annotations declared on the getter or setter are ignored. The test
is added in Intellij repo.
2021-10-25 18:16:31 +03:00
Tianyu Geng 363b25504d FIR checker: report REDUNDANT_LABEL_WARNING
Since many labels are not present in the FIR tree, this checker is
implemented as a syntax checker. Comparing with FE1.0, this change
reports some REDUNDANT_LABEL_WARNING that FE1.0 has missed, especially
LHS of assignments.
2021-10-25 13:51:01 +03:00
Ivan Kylchik 225b064470 Implement new 'mix' test mode
This mode must be used when one configuration will run several tests
for different JUnit versions.
2021-10-25 00:14:20 +03:00
Mikhail Glukhikh 79b98f9173 FIR: introduce synthetic property symbol hierarchy 2021-10-23 01:19:07 +03:00
Mikhail Glukhikh c673c4cc91 FIR: refactor/use properly FirAccessorSymbol & FirSyntheticPropertySymbol 2021-10-23 01:19:06 +03:00
Dmitriy Novozhilov 06a26a5a74 [FE 1.0/FIR] Fix message of SEALED_SUPERTYPE_IN_LOCAL_CLASS diagnostic
^KT-46285 Fixed
2021-10-21 19:39:49 +03:00
Dmitriy Novozhilov 94664694df [FIR] Prohibit confusing syntax inside when branches
^KT-48385
2021-10-21 19:39:46 +03:00
Tianyu Geng c262f17d75 FIR checker: report violations related to API mode 2021-10-21 00:01:14 +03:00
Denis.Zharkov f441024fd4 FIR: Derive FirMemberDeclaration from FirAnnotatedDeclaration
It's necessary to have the sane logic that FirMemberDeclaration is a subtype of FirDeclaration
The only kind of controversial change here is making FirAnonymousObject
also be FirMemberDeclaration, thus having its own declaration status
2021-10-20 22:05:20 +03:00
Tianyu Geng 603655d63f FIR IDE: add option to render type without type args
This is useful for rendering type annotation for `super`, which does
not require type arguments.
2021-10-20 19:16:49 +02:00
Tianyu Geng bdc71a3281 FIR IDE: pass candidate super types for AMBIGUOUS_SUPER
This way the IDE quickfix do not need to do resolution again to figure
out what super type to offer in the quickfix.
2021-10-20 19:16:48 +02:00
Yan Zhulanow b7044803d2 [FIR IDE] Move out-of-block modification trigger to FrontendApiTestConfiguratorService 2021-10-20 19:41:29 +03:00
Yan Zhulanow 2894f87541 [FIR IDE] Move test configurators as constructor parameters 2021-10-20 19:41:29 +03:00
Yan Zhulanow 516dd825c2 [FIR IDE] Initial descriptor-based implementation of the Analysis API 2021-10-20 19:41:24 +03:00
Yan Zhulanow e2c9be0932 [FIR IDE] Extract common components of the Analysis API to separate modules 2021-10-20 19:41:23 +03:00