Commit Graph

1983 Commits

Author SHA1 Message Date
Roman Efremov 878608b7b2 Don't add Enum.entries to scope if it can't be called
^KT-53929 Fixed
2023-01-23 12:53:06 +01:00
Anna Kozlova 21e57b1c54 [AA] allow to skip keywords completely
no need in fun/val/var in file structure
2023-01-23 08:27:26 +00:00
Nikolay Lunyak ff96033e95 [FIR] KT-55666: Support labels to local functions
^KT-55666 Fixed
2023-01-20 08:09:08 +00:00
Anna Kozlova 07525fef51 [AA] extract source psi from delegated wrapper when exists 2023-01-19 11:38:32 +00:00
Denis.Zharkov 9c988fd8d8 K2: Introduce FirCachingCompositeSymbolProvider
The main idea is pre-computing the sets of names that might be
met there, that helps to decrease the sizes of the backing maps
(by avoiding irrelevant keys)

Totally, this branch with previous commits speeds up MT Full Kotlin
approximately on 3 seconds (~5%)
2023-01-19 10:57:43 +00:00
Denis.Zharkov 9302fe3cb5 K2: Get rid of redundant FirDependenciesSymbolProvider class 2023-01-19 10:57:42 +00:00
Denis.Zharkov 58c1b5dd1f K2: Optimize AbstractFirDeserializedSymbolProvider
Avoid filling caches with keys that are definitely empty
(if it's cheap to compute that), to decrease the size of backing maps.

The strategy is pre-computing the sets of names that might be met.
NB: the size of the sets is way fewer than a size of all queried names.
2023-01-19 10:57:42 +00:00
Dmitrii Gridin a49b72b05e [AA] update testData
^KTIJ-23547
^KTIJ-24141
2023-01-19 10:53:05 +00:00
Dmitrii Gridin 6635ec33d9 [AA] KtTypeInfoProvider: update kdoc
^KTIJ-23547
^KTIJ-24141
2023-01-19 10:53:04 +00:00
Dmitrii Gridin 7f24a38997 [FIR] FirTypeResolveTransformer: support lazy type annotations for all declarations
^KTIJ-23547
^KTIJ-24141
2023-01-19 10:53:04 +00:00
Dmitrii Gridin 73cdaf5c3c [FIR] CustomAnnotationTypeAttribute: support type aliases
^KTIJ-23547
^KTIJ-24141
2023-01-19 10:53:03 +00:00
Dmitrii Gridin 09a77d261d [AA] KtTypeInfoProvider: introduce fullyExpandedType extension
^KTIJ-23547
^KTIJ-24141
2023-01-19 10:53:03 +00:00
Dmitrii Gridin 8ce4c4eba9 [FIR] CustomAnnotationTypeAttribute: store fir symbol instead of declaration
^KTIJ-23547
^KTIJ-24141
2023-01-19 10:53:02 +00:00
Dmitrii Gridin 9d42a5cb01 [FIR] provide containerDeclaration to CustomAnnotationTypeAttribute for lazy resolve
tested by FirIdeNormalAnalysisSourceModuleSymbolByPsiTestGenerated.testTypeAnnotations

^KTIJ-23547 Fixed
^KTIJ-24141 Fixed
2023-01-19 10:53:02 +00:00
Dmitrii Gridin f32483000a [AA FIR] KtFirAnnotationListForDeclaration: avoid resolve on creation 2023-01-19 10:53:02 +00:00
Denis.Zharkov b1bb7dd25f K1: Fix regression with callable references as last statements in lambda
^KT-55729 Fixed
2023-01-19 10:00:02 +00:00
Denis.Zharkov a37e3def14 Add test for KT-55931 2023-01-19 10:00:02 +00:00
Dmitriy Novozhilov 8d728d4f53 Revert "[FE 1.0] Deprecate declaration of expect and actual in the same module"
This reverts commit b09561c3c3.

It was decided to postpone this warning till 1.9
This is needed to provide proper IDE support

^KT-40904 Open
^KT-55177 Open
2023-01-17 18:02:50 +00:00
Jinseong Jeon 2da4693cc0 AA: do not use full decompilation for built-ins
This is the major performance bottleneck for AA/UAST artifacts rollout
to Android Lint. KT stubs are good/fast enough.
2023-01-17 16:51:34 +01:00
Jinseong Jeon 669afdd463 AA: place KotlinStaticDeclarationIndex in its own file with less visibility 2023-01-17 16:51:34 +01:00
Dmitriy Novozhilov 4363b0815c [FIR] Add ability to specify if meta annotation itself should match metaAnnotated predicate
^KT-55843 Fixed
2023-01-17 14:51:28 +00:00
Vladimir Sukharev e4d209cbde [K2] [KN-55977] Fix suspend type serialization
Merge-request: KT-MR-8328
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-01-17 13:07:21 +00:00
Dmitrii Gridin 485fad1951 [FIR] FirJavaClass: make annotations and deprecationsProvider lazily enhanced
^KT-55387
2023-01-17 12:45:53 +00:00
Anna Kozlova 6f9cfe1943 [AA] don't treat broken code as function type parameter
inspired by KTIJ-23940
2023-01-17 11:50:20 +00:00
Dmitriy Novozhilov b09561c3c3 [FE 1.0] Deprecate declaration of expect and actual in the same module
^KT-40904 Fixed
^KT-55177 Fixed
2023-01-17 09:43:14 +00:00
Nikolay Lunyak 4cddbb5fc0 [FIR] Get rid of FirAnnotation.fullyExpandedClassId
It's duplicated by `toAnnotationClassId`.
2023-01-17 06:26:39 +00:00
Nikolay Lunyak d105ce8681 [FIR] Support typealiases to java Repeatable 2023-01-17 06:26:38 +00:00
Dmitrii Gridin 927d244682 [SLC] cleanup code 2023-01-16 18:00:43 +00:00
Dmitrii Gridin 6fb59cc19b [SLC] update copyrights 2023-01-16 18:00:43 +00:00
Dmitrii Gridin b05ade63cb [SLC] SymbolLightAccessorMethod: simplify isOverride for top-level case 2023-01-16 18:00:43 +00:00
Nikolay Lunyak c3b871652f [FIR] KT-55181: Ensure throw argument is Throwable
`TYPE_MISMATCH` in `throwJLException.fir.kt` appeared,
because in `throw Exn` the type of `Exn` is implicit Unit.
This is red code anyway.

^KT-55181 Fixed

Merge-request: KT-MR-8292
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
2023-01-16 17:24:22 +00:00
Mikhail Glukhikh 0c4a0360ac Deserialization/class reading: pass chosen JvmMetadataVersion whenever possible 2023-01-16 18:16:07 +01:00
Mikhail Glukhikh 89dd28226b BinaryVersion: introduce isCompatibleWithCurrentCompilerVersion 2023-01-16 18:12:55 +01:00
Marco Pennekamp 88ac5727cc [LL FIR] KT-50732 Add support for LL FIR-specific tests (.ll.kt)
- `.ll.kt` test data can be added in cases where LL FIR resolution
  legally diverges from K2 compiler results.
- Each `.ll.kt` test is prefixed with an `LL_FIR_DIVERGENCE` directive
  which must explain why the test may diverge from K2 compiler results.
  - `LLFirDivergenceCommentChecker` ensures that each `.ll.kt` file
    contains an `LL_FIR_DIVERGENCE` directive.
- `LLFirIdenticalChecker` results in an assertion error if the `.ll.kt`
  test and its base test are completely identical, including in their
  meta info (but ignoring `LL_FIR_DIVERGENCE`).
  - The checker additionally ensures that the base source file and the
    `.ll.kt` source file have identical Kotlin source code (ignoring
    meta info and `LL_FIR_DIVERGENCE`). This ensures that both tests
    test the exact same thing.
- `.ll.kt` files are ignored by select test generators, in addition to
  `.fir.kt` files.
2023-01-16 15:20:50 +00:00
Dmitrii Gridin 3eabb3038d [SLC] SymbolLightMethod: drop accidentally added isOverride 2023-01-16 15:36:14 +01:00
Artem Vasilev 82d934d873 [LL FIR] fix typo in LLFirModuleData.friendDependencies
^KTIJ-23347 Fixed
2023-01-16 10:48:38 +00:00
Ilya Kirillov a5082e5d94 [LL FIR] do not rethrow exceptions from caches
Previously, the exceptions from ValueWithPostCompute was saved in cache and rethrown.
This was needed to avoid multiple heavy calculation which will be still uncecessfull.
Currently we do not have much of such exceptions and such thing may break perf test
by throwing exceptions from old test invocation
2023-01-14 08:39:58 +00:00
Anna Kozlova 06074e5e2d fix compilation after merge 2023-01-13 23:35:07 +01:00
Vladimir Dolzhenko ca31307941 [AA] Add expectForActual
#KT-54864

Merge-request: KT-MR-8222
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2023-01-13 21:36:04 +00:00
Ilya Kirillov 3afb93ca31 [FIR] fix resolve contract violation from ConeTypeContext.getValueClassProperties
^KT-54890
2023-01-13 21:32:52 +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 86cc57ac39 [AA] allow navigation from '==' to the equals method of lhs 2023-01-13 20:14:30 +00:00
Ilya Kirillov 825432074f [LL FIR] add checkCanceled check to the LLFirSessionFactory.createSourcesSession
^KTIJ-24012
2023-01-13 17:52:48 +00:00
Ilya Kirillov 729e2971ae [LL FIR] do not create project module under non-cancelable section
It seems to be safe as we modify the caches atomically by updating LLFirSessionsCache.mappings.
So, PCE during project structure creation, should not break the caches

^KTIJ-24012 fixed
2023-01-13 17:52:47 +00:00
Mikhail Glukhikh f20e5daa92 K2: fix property VS field resolve in anonymous class case
Related to KT-55017, KT-50082
2023-01-13 13:49:20 +00:00
Mikhail Glukhikh 9542a8a07a Inherit LowLevelFirFrontendFacade from FirFrontendFacade to remove duplicates 2023-01-13 12:56:01 +00:00
Mikhail Glukhikh ecc81098a6 Unbind FIR mangler from use-site session (by Simon Ogorodnik) 2023-01-13 12:56:01 +00:00
Mikhail Glukhikh 890e3d1c10 FIR2IR/MPP: use single SymbolTable during MPP compilation 2023-01-13 12:56:00 +00:00
Ivan Kochurkin 5d273ce839 [FIR & FIR2IR] Prepare test and CLI infrastructure to support MPP
- Move out getAnalyzerServices from FirFrontendFacade to TestSetupUtils
- Simplify DependencyListForCliModule. Now it takes BinaryModuleData as input
- FirOutArtifact contains several FirOutputArtifactPart
- Simplify FirFrontendFacade
2023-01-13 12:55:57 +00:00
Kirill Rakhman 5a08d8da8d FIR: don't check annotations on returnTypeRefs that are not of real kind
This fixes an exception in FirAnnotationChecker where we tried to report
repeated annotations on implicit type refs that have no source.
2023-01-13 12:54:18 +00:00