Commit Graph

103806 Commits

Author SHA1 Message Date
Kirill Rakhman bd6af5cc42 [FIR2IR] Set correct modality of lazy annotation classes
#KT-60268 Fixed
2023-08-18 09:43:40 +00:00
Roman Golyshev 52d6ac5ed0 [AA] Fix processing of member invoke functions from objects in reference shortening and import optimization
Correctly handle `KtDotQualifedExpression`s with function calls as
selectors (like `foo.Bar()`). Without such handling, processing of
member invoke calls on objects was broken both
for reference shortener (causing KTIJ-26695)
and import optimizer (causing KTIJ-23407)

Also, to fix KTIJ-23407, do not ignore qualifiers with
`ImplicitInvokeCall` fake source

^KTIJ-26695 Fixed
^KTIJ-23407 Fixed
2023-08-18 07:32:05 +00:00
Nikolay Lunyak 4958196c51 [FIR] Forbid mixing supertypes with different functional kinds
^KT-61277 Fixed
2023-08-17 21:45:42 +00:00
Nikolay Lunyak f674529558 [FIR] Report MIXING_SUSPEND_AND_NON_SUSPEND_SUPERTYPES
^KT-59367 Fixed
2023-08-17 21:45:42 +00:00
Alexander Udalov b3e4099703 Kapt tests: minor, remove STRIP_METADATA from properties.kt 2023-08-17 21:43:54 +00:00
Alexander Udalov e700a38a87 Kapt tests: minor, add some cases to properties.kt
To check that boolean "is" prefix is treated correctly, and Unit return
type is not translated to void. `@Deprecated` annotations are added just
so that the `$annotations` methods would also be generated.
2023-08-17 21:43:54 +00:00
Alexander Udalov 28e232f54f Kapt tests: minor, add case with optimized delegated property
In normal circumstances, it leads to the field `c$delegate` NOT being
generated (see KT-39054). However, it's not the case in kapt in any
mode:
- In the old JVM backend, this optimization is not supported.
- In JVM IR, property initializers are missing in light analysis, so
  backend cannot figure out that this property is optimizable.
- In kapt4, backend is not being run, and symbol light classes do not
  have information about this optimization.

Overall it doesn't matter much which stub is generated here because the
field is private, the test is added just in case.
2023-08-17 21:43:54 +00:00
strangepleasures 2423b7b62f [KAPT4] KT-51982 Implement generation of @Metadata annotations in Java stubs
Also adds rendering of @Metadata annotations in Kapt3 and Kapt4 tests
(currently disabled for a few tests).

Co-authored-by: Alexander Udalov <alexander.udalov@jetbrains.com>
2023-08-17 21:43:54 +00:00
Alexander Udalov f40fc1b0c6 JVM IR: minor, deduplicate JvmFileClassUtil.manglePartName 2023-08-17 21:43:54 +00:00
Ilya Gorbunov 69cb722ff4 Add js compiler disambiguation attribute to fix docs build 2023-08-17 17:21:23 +00:00
Dmitrii Gridin 0487bd7b6a [LL FIR] do not treat phase from FirFile as indicator for entire file
`resolvePhase` from `FirFile` is not an indicator of resolution state for
the entire file, so we shouldn't depend on it.
The right check will be performed during `lazyResolveTargets` over `LLFirResolveTarget`

^KTIJ-26666 Fixed
^KT-61296
2023-08-17 17:06:26 +00:00
Sebastian Sellmair 337d87ad54 [Gradle] CInterop IDE dependency resolution: Fix build dependencies
^KT-59596 Verification Pending
2023-08-17 15:47:56 +00:00
Sebastian Sellmair fac5083dbf [Gradle] Ensure 'commonized cinterop configurations' are present and expose api dependencies
^KT-59596 Verification Pending
2023-08-17 15:47:55 +00:00
Anton Lakotka 9866336a40 [Gradle] Use 'commonized cinterop configurations' as single way of sharing cinterop commonizer output
^KT-59596 Verification Pending
2023-08-17 15:47:55 +00:00
Anton Lakotka b2bef4ad41 [Gradle] Extract allInteropGroups from CInteropCommonizerTask
This information is needed to create consumable configurations for
Commonized Cinterop outputs. This way CInteropCommonizerTask is not
required to be created eagerly.

^KT-59596 Verification Pending
2023-08-17 15:47:55 +00:00
Anton Lakotka cbe11e8c9a [Gradle] Keep materializing commonizeCInteropTask...
...as it contains important information needed to create
 consumable commonized cinterop configurations

^KT-59596 Verification Pending
2023-08-17 15:47:55 +00:00
Anton Lakotka 14f216764d [Gradle] Use CommonizerTargetAttribute to disambiguate...
...commonized cinterop configurations.

^KT-59596 Verification Pending
2023-08-17 15:47:55 +00:00
Anton Lakotka 373c838ebb [Gradle] Enable applyDefaultHierarchyTemplate back for...
...testCInteropsDoesNotDependOnAnySourceCompilation test

^KT-59596 Verification Pending
2023-08-17 15:47:55 +00:00
Anton Lakotka b37ebb47d9 [Gradle] Draft implementation of Configurations for Commonized CInterops
Introduce *CommonizedCInterop & *CommonizedCInteropElements configurations
and fix CInteropCommonizerTask to consume dependencies / expose artifacts
via these configurations.
2023-08-17 15:47:55 +00:00
Kirill Rakhman 640d1e3fc8 [FIR] Fix augmented array set call on smartcasted receiver
#KT-60917 Fixed
2023-08-17 15:13:38 +00:00
Ilya Kirillov 72957b9978 [LL FIR] remove InvalidSessionException
it was thrown only in a case when global lock is enabled, which is not true in production and only used for some QA testing
2023-08-17 14:12:07 +00:00
Ilya Kirillov 2e9cae4810 [LL FIR] remove retryOnInvalidSession as now we have correct FIR tree restore after PCE
Previously, `retryOnInvalidSession` was needed to try resolving declaration again if the `FirSession` is invalidated and PCE was thrown.
Currently, we do not invalidate `FirSession` on PCE as we can restore the FIR tree state after the PCE was thrown.

Now `FirSession` might be invalidated only on OOBM or module content root modification, in this case, we should not get access to the invalidated `FirSession` at all
2023-08-17 14:12:07 +00:00
Ivan Kochurkin 553114e245 [K2, MPP] Actualize annotation calls
^KT-57963 Fixed
2023-08-17 14:04:59 +00:00
Nikolay Lunyak dc9ed5656e [FIR] Revert FirMultipleDefaultsInheritedFromSupertypesChecker
It's possible to write a fix that
would prevent false positives with
this checker, but the core
intuition behind it is invalid.

This checker assumes that it's
enough to only check direct
overriddens, while in reality
even simple `Source` override
functions are not allowed to
contain default values, so they
can't be used to make judgements
about them.

^KT-59408 Open
^KT-59408 Open

^KT-61095 Fixed
^KT-61165 Fixed
^KT-61029 Fixed
2023-08-17 13:55:19 +00:00
Ilya Kirillov 2ce324f1fc [Analysis API] rename AbstractSingleSymbolByPsi -> AbstractSingleSymbolByPsiTest
to match test naming convention
2023-08-17 13:01:02 +00:00
Ilya Kirillov 8ad5a48b98 [Analysis API] introduce KtDestructuringDeclarationSymbol to represent a destructuring declaration
Mainly needed to avoid "Cannot build symbol for KtDestructuringDeclaration" from `KtSymbolProvider.getSymbol` on `KtDestructuringDeclaration`.
2023-08-17 13:01:02 +00:00
Ilya Kirillov 1b0034b6e7 [Analysis API] allow AbstractSingleSymbolByPsi to accept <expr>-based section in addition to <caret>-based 2023-08-17 13:01:02 +00:00
Ilya Kirillov 729bae4a2a [Analysis API] refactoring, add utilities to ExpressionMarkersSourceFilePreprocessor which return null in a case caret/selected expression are not found 2023-08-17 13:01:02 +00:00
Ilya Kirillov c963eadb44 [Analysis API FIR] fix KtSymbol creation for _ destructuring parameter
We need to have a corresponding declaration in the FIR tree,
so we can create a symbol for it

^KT-60904 fixed
^KT-60904 fixed
2023-08-17 13:01:02 +00:00
Ilya Kirillov 04b9faf9e6 [LL FIR] fix getOrBuildFir for destructing declaration inside lambda parameter 2023-08-17 13:01:02 +00:00
Alexey Merkulov 73b2ccff76 [Stubs] Refactoring: reduce member visibility in KotlinStubOrigin 2023-08-17 12:35:19 +00:00
Alexey Merkulov 60d5de56cb [Stubs] Fix writing/reading multi file facades
The fixed error leaded to the invalid resolve of methods during
evaluation, e.g. kotlinx.coroutines#runBlocking should be called from
facade BuildersKt instead of BuildersKt__BuildersKt
2023-08-17 12:35:19 +00:00
Dmitrii Gridin a6b3896552 [LL FIR] LLFirTargetResolver: cleanup
Drop redundant extension

^KT-60799
2023-08-17 12:23:23 +00:00
Pavel Kirpichenkov c0c234e1d2 Minor: rename files to source files in configurators for standalone mode
KT-59793
2023-08-17 12:03:10 +00:00
Pavel Kirpichenkov 14eef4c7fe Minor: move lost comment 2023-08-17 12:03:09 +00:00
Pavel Kirpichenkov 6de54ef762 Minor: workaround false positive IDE error KTIJ-21172 2023-08-17 12:03:09 +00:00
Pavel Kirpichenkov ef6375f627 [LL] Use package provider to check for existing package
KT-59793
2023-08-17 12:03:08 +00:00
Dmitrii Gridin 7884b5fecf [LL FIR] lazy resolution for file should process file annotation container
File annotation container is a part of a file,
so we should resolve it before to avoid contact violation

^KT-60799
2023-08-17 11:05:23 +00:00
Dmitrii Gridin b92303d36f [LL FIR] update test data for file lazy resolution
^KT-60799
2023-08-17 11:05:23 +00:00
Dmitrii Gridin 17d0017fbf [LL FIR] do not treat content of script initializers as non-local
^KT-61260 Fixed
2023-08-17 11:02:03 +00:00
Dmitrii Gridin 1a21affe1d [LL FIR] add test for 'for' on top level in script
^KT-61260
2023-08-17 11:02:03 +00:00
Egor Kulikov ae85c7bfe3 [FIR] Add missing tests to resolve
Merge-request: KT-MR-11666
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
2023-08-17 10:54:39 +00:00
Svyatoslav Kuzmich 833c8b2cd4 [Wasm] Fix transforming setField in an inline class constructor body
IrSetField was transformed to its value to preserve side effects
This transformation produced invalid IR in cases where
IrSetField used in Unit-returning expression context.

This commit fixes it by producing Unit-typed expression

^KT-59084 Fixed
2023-08-17 10:35:00 +00:00
Kirill Rakhman 6fba6a2e3c [FIR2IR] Don't add synthetic propertiy fake overrides to parent class
This fixes a KMP issue where IrActualizer would add duplicate
fake overrides because the parent class would have both the getter
and the synthetic property in its list of declarations.
Now, the synthetic property fake overrides are still generated and
cached in the Fir2IrDeclarationStorage, but not added to the class.

#KT-60854 Fixed
2023-08-17 07:34:04 +00:00
Alexander Shabalin f459a6f6b5 [K/N] Configure runtime tests compilation parallelism 2023-08-16 22:02:02 +00:00
Roman Golyshev ef6e8ebb9b KTIJ-26672 [AA] Correctly handle ConeAmbiguityError in KtFirImportOptimizer
Add a test case for missing call diagnostic just in case

^KTIJ-26672 Fixed
2023-08-16 19:25:59 +00:00
Dmitriy Dolovov 033bb385b9 [IR] Drop expectDescriptorToSymbol completely
^KT-61136
2023-08-16 19:17:17 +00:00
Dmitriy Dolovov 9eb5b41ed8 [IR] Drop skipExpects & expectDescriptorToSymbol in IrFileSerializer
^KT-61136
2023-08-16 19:17:17 +00:00
Dmitriy Dolovov d691ab61d7 [KLIB] Keep "API for KLIB ABI" test data under "compiler/testData/klib/" dir
The test data is used both in ":kotlin-util-klib-abi" and
":native:native.tests" modules. It's better to keep it together with
the test data for other KLIB tests which are also used in more than one
module, i.e. in "compiler/testData/klib/" dir.
2023-08-16 19:11:35 +00:00
Dmitriy Dolovov cb92990ed6 [KLIB][tests] Reorganize "klib dump-metadata" tests
- Keep the test data under "native/native.tests/testData/klib/" dir
- Rename tests from "klib contents" to "klib dump-metadata"
2023-08-16 19:11:35 +00:00