Commit Graph

101591 Commits

Author SHA1 Message Date
Artem Kobzar bfd57fd2df [K/JS, K/Wasm] Optimize simple objects declaration and usage ^Fixed KT-58797 2023-06-02 14:23:40 +00:00
Anna Kozlova 7d6275e228 [LL] use green stub or load stubs from disk when no stub is available
e.g. if ast is loaded then no stub is attached to a file
but building deserialized fir can require information from enriched cls stub,
otherwise part of the information would be missed, e.g. contracts.

presumably, this can happen only after decompiled code is opened in the editor
(also meaning no source code is attached to the library),
green stub should exist until GCed,
thus performance degradation in the common case is not expected
2023-06-02 14:11:47 +00:00
Egor Kulikov 8ae5336f04 [FIR] Add top level invalid destructuring declarations in classes
Part of ^KTIJ-23263

Merge-request: KT-MR-10424
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
2023-06-02 14:05:00 +00:00
Dmitrii Krasnov 1dee01474c Added kotlin-gradle-statistics versioning. test that checks any changes in kotlin-gradle-statistics src folder and fails if there were no VERSION increased
#KTIJ-25581 In Progress

Merge-request: KT-MR-10349
Merged-by: Dmitrii Krasnov <Dmitrii.Krasnov@jetbrains.com>
2023-06-02 13:56:43 +00:00
Sebastian Sellmair b60f478b92 [Gradle] MPP: Update max tested AGP version to 8.2
^KT-58703 Verification Pending
2023-06-02 13:03:05 +00:00
Dmitrii Krasnov f8a540f4cf migrated podspec tests from CocoaPodsIT to new test DSL (gradle test kit + JUnit 5)
#KT-51553 In Progress
2023-06-02 11:42:40 +00:00
Leonid Startsev a0819e4163 Make changelog for kotlinx-metadata-jvm 0.6.2 release
Note: actual release is done from a separate branch of 1.8.20 with proper fix
(4a9e6f7b2b458ea0ee524afb52f42f3e45dc9ad7)
2023-06-02 11:35:50 +00:00
Brian Norman 0298d17987 [FIR] Remove suspend lambda redundant warning for inline functions
#KT-57971 Fixed
2023-06-02 10:49:57 +00:00
Sergej Jaskiewicz 5f59de23c5 [FIR] Fix computing mangled names for top-level functions and properties
^KT-57433 Fixed
2023-06-02 10:05:34 +00:00
Ilya Kirillov 1eb0862820 [Analysis, build] replace testApi -> testImplementation in build.gradle.kts where it's possible 2023-06-02 09:16:47 +00:00
Ilya Kirillov 78f09409b7 [Analysis API] move ClsKotlinBinaryClassCache/FileAttributeService service registration to StandaloneProjectFactory 2023-06-02 09:16:47 +00:00
Ilya Kirillov fbcf73eb42 [Analysis API Standalone] commonize logic for Analysis API FIR service registration between standalone and tests 2023-06-02 09:16:47 +00:00
Ilya Kirillov feaf9acd1d [Analysis API] move KotlinFakeClsStubsCache service registration to StandaloneProjectFactory
so it can be used from standalone mode
2023-06-02 09:16:47 +00:00
Ilya Kirillov 452844ffc6 [Analysis API] move KotlinReferenceProvidersService service registration to StandaloneProjectFactory
so it can be used from standalone mode
2023-06-02 09:16:47 +00:00
Ilya Kirillov 9f2d750f98 [Analysis API] move KtResolveExtensionProvider EP registration to common code
so it can be used from standalone mode
2023-06-02 09:16:47 +00:00
Ilya Goncharov b585d7c392 [Gradle, JS] Add test with nested composite build 2023-06-02 08:43:09 +00:00
Abduqodiri Qurbonzoda e1b6f8198a [K/N] Make Sequence<T>.constrainOnce() multi-thread friendly 2023-06-01 19:40:03 +00:00
Abduqodiri Qurbonzoda 7d9ea28604 Deprecate lazy() that synchronizes on a given lock in non-JVM platforms
Because the overload has a meaningful implementation only in JVM.
In other platforms the specified lock object is ignored.
In K/N it throws UnsupportedOperationException.
2023-06-01 19:40:02 +00:00
Abduqodiri Qurbonzoda 9864402cf8 [K/N] Remove FixmeConcurrency annotation 2023-06-01 19:40:02 +00:00
Pavel Mikhailovskii 0ef31501b1 [SLC] KT-54804 Erase type and drop receiver annotations in $annotations methods 2023-06-01 18:22:03 +00:00
Pavel Punegov 6d06f29326 [K/N][test] Fix Native downloading test
Use a newer version of the compiler with changes to archive name
(contains arch). Also, remove obsolete test for the old version.

Merge-request: KT-MR-10399
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-06-01 15:09:51 +00:00
Dmitrii Krasnov b19decc00a fixed NativeXcodeSimulatorTestsIT 2023-06-01 14:45:26 +00:00
Dmitrii Krasnov 19f1d4e3e3 fixed native compiler downloader repoUrl building
#KT-51553 In Progress
2023-06-01 14:45:26 +00:00
Yahor Berdnikau 9e5346407e [Gradle] Restore public visibility for constants with configuration names
Apparently users are using these constants in their build script
configurations. Until we will provide proper public API we should keep
such constants as public.

^KT-58916 Fixed
2023-06-01 14:41:00 +00:00
Sergej Jaskiewicz 56b729f181 [test] Fix failing IR dump test 2023-06-01 13:22:01 +00:00
Ivan Kylchik 11fcfc2646 [IR] Drop usages of IrBuiltIns from interpreter's map generator 2023-06-01 13:01:24 +00:00
Ivan Kylchik fe538a6174 [IR] Rewrite generator for interpreter map
1. Reuse `DisabledIdSignatureDescriptor` to create `IrBuiltIns`
2. Provide FQ names for types to ensure method find correctness
2023-06-01 13:01:24 +00:00
Ivan Kylchik 6501d0b743 [IR] Add CHECK_NOT_NULL const val field in BuiltInOperatorNames 2023-06-01 13:01:24 +00:00
Ivan Kylchik 40aea531e1 [IR] Drop treatFloatInSpecialWay interpreter's parameter
Replaced it with more common `platform` parameter.
2023-06-01 13:01:24 +00:00
Ivan Kylchik 19b0ff8fb4 [IR] Simplify calculateBuiltIns method in interpreter 2023-06-01 13:01:24 +00:00
Abduqodiri Qurbonzoda 7acaf6e473 [K/N] String.indexOf matches byte sequences not on the char boundary #KT-56637
If the found index is odd, retry search from index + 1.

Merge-request: KT-MR-10364
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-06-01 12:56:32 +00:00
Roman Golyshev b11447ea6b KTIJ-24983 [FIR] Ensure safe publication of configured plugin factories in FirExtensionRegistrar
Previous approach prevented double registration of the plugins, but
might have caused a race condition: atomic flag was set before the
plugins initialization, not after, so another thread could see garbage
data even if it could read the flag set to "true".

This might or might not be a root cause for the KTIJ-24983 exception,
so we'll have to wait for some time before actually closing the issue.
2023-06-01 12:29:34 +00:00
Jinseong Jeon 3f22044275 AA: collect .kts source files too 2023-06-01 14:16:31 +02:00
Nikita Bobko 4be7ac930b Update KClass.isData KDoc to include info about data objects
^KT-58985 Fixed
Review: https://jetbrains.team/p/kt/reviews/10385

`isData` returns `true` for `data object`s even if kotlin-reflect
version is old (1.2.0), so it looks like we got correct `KClass.isData`
behaviour for "free". That's why this behaviour was never covered with
tests.

This commit updates the documentation and covers the behaviour described
in the KDoc with tests.
2023-06-01 12:09:15 +00:00
Sergey.Shanshin 13e2a3ae94 [KxSerialization] Fix NPE if sealed class has self-referencing in generic parameter
Fixes #KT-58918

If the serializable class contains itself as a generic parameter of the property, and its serializer is not an object (for example, for a sealed class), in this case there is a race in the initialization of the serializer and child serializers.

Merge-request: KT-MR-10363
Merged-by: Sergey Shanshin <Sergey.Shanshin@jetbrains.com>
2023-06-01 12:01:04 +00:00
Anna Kozlova e180296f0e [LL] better name for library based provider in LLFirLibraryProviderFactory 2023-06-01 11:37:35 +00:00
Nikolay Lunyak a3cd7d074e [FIR Native] KT-58549: Ensure :dist is run before the native diagnostics
Turns out `:native:tests` prepares `:kotlin-native:dist` only.
2023-06-01 10:27:54 +00:00
Nikolay Lunyak 70605c84df [FIR Native] KT-58549: Get rid of the builtin provider
According to
`FirNativeCodegenBoxTestGenerated.testNestedClassesInAnnotations`,
the annotation
`kotlin.internal.PlatformDependent` is
unresolved reference.

^KT-58549 Fixed
2023-06-01 10:27:54 +00:00
Nikolay Lunyak 5af4230f46 [FIR Native] KT-58549: Ensure Cloneable is accessible in native 2023-06-01 10:27:54 +00:00
Vyacheslav Gerasimov 5e39bb97a0 Download d8 using configuration to make use of Gradle dependency caching
#KTI-72
2023-06-01 09:28:11 +00:00
Pavel Mikhailovskii 638cbd4d8e Preserve LanguageVersionSettings in buildKtModuleProviderByCompilerConfiguration 2023-06-01 07:16:46 +00:00
Marco Pennekamp 1c0082e4d6 [LL FIR] KT-58325 Disable combined stub-based deserialized symbol providers temporarily
- Due to KTIJ-25562, combined stub-based deserialized symbol providers
  currently create code correctness issues and should thus not be
  enabled.
- Once that issue is fixed, KT-58325 should be revisited.
2023-05-31 18:34:42 +00:00
Marco Pennekamp 0a67569163 [LL FIR] KT-58580 Add test data for resolve extensions in dependencies
- `dependency2` is needed to ensure the creation of combined Kotlin
  symbol providers. If there is only a single dependency Kotlin symbol
  provider, the combined symbol provider won't be created.
2023-05-31 18:34:42 +00:00
Marco Pennekamp a50e839660 [LL FIR] Add multi-module resolve extension reference resolve tests
- To test the reference resolution of declarations provided through
  resolve extensions of module dependencies, we need support for
  multimodule resolve extension tests.
2023-05-31 18:34:42 +00:00
Marco Pennekamp 915c412929 [AA] KT-58580 Add KotlinDeclarationProviderMerger
- A proper merging strategy for declaration providers is required for
  cases where the main declaration provider created by
  `createDeclarationProvider` can't provide all declarations that the
  original declaration providers can provide. Then, only a sublist of
  the declaration providers should be merged, while keeping the
  unmergeable declaration providers intact.

^KT-58580 fixed
2023-05-31 18:34:42 +00:00
Marco Pennekamp fba0648005 [AA] Move impl declaration providers to subpackage 2023-05-31 18:34:42 +00:00
Marco Pennekamp 52f025f39b [AA] Extract SublistMerger to analysis-api-providers utils
- This utility is useful for other places where sublists need to be
  merged.
2023-05-31 18:34:42 +00:00
Marco Pennekamp 2540343159 [LL FIR] KTIJ-25536 Add callable package names workaround for LLFirProvider$SymbolProvider
- Sadly, the only way for now is to disable computation of the callable
  package names, which will negatively affect performance.
2023-05-31 18:34:42 +00:00
Marco Pennekamp a61c6f6502 [LL FIR] Fix KtNotUnderContentRootModuleForTest requesting sessions too early
- `KtNotUnderContentRootModuleForTest.directRegularDependencies` is
  called during project structure creation, which led to builtins
  session creation during that period. This in turn led to the creation
  of `JvmStubBasedFirDeserializedSymbolProvider`, which failed upon the
  initialization of `declarationProvider` because
  `KotlinDeclarationProviderFactory` wasn't registered yet. This is
  precisely why `declarationProvider` was made lazy.
- However, with the new `FirSymbolNamesProvider`, keeping
  `declarationProvider` lazy is harder, because `symbolNamesProvider`
  (if also made lazy) is requested during composite symbol provider
  creation in `createBuiltinsAndCloneableSession`.
- The solution avoids creating the builtins session entirely. Instead,
  `directRegularDependencies` now gets the `KtBuiltinsModule` directly,
  which is more straight-forward as well.
2023-05-31 18:34:42 +00:00
Marco Pennekamp bb7625c5b0 [LL FIR] KT-58325 Fix test library discoverability for combined Kotlin symbol providers
- An LL FIR test failed after merging stub-based deserialized symbol
  providers into combined Kotlin symbol providers:
  `DiagnosticCompilerTestFE10TestdataTestGenerated.TestsWithStdLib.Multiplatform.testJvmOverloads`
- Cause: The combined Kotlin symbol provider was able to find a class
  for `JvmOverloads`. However, the `KtModule` of `JvmOverloads` was
  `LibraryByRoots` with just the stdlib, while the registered stub-based
  deserialized symbol provider was known to the combined symbol provider
  with a `LibraryByRoots` containing 6 different paths. Hence, the
  single-root module wasn't found in the provider map.
- The fix creates a `LibraryByRoot` for each root, which leads to a
  separate deserialized symbol provider for each of the six roots,
  solving the discoverability problem.
2023-05-31 18:34:41 +00:00