Commit Graph

100270 Commits

Author SHA1 Message Date
Nikolay Krasko cdec1e6c62 Update used based image for Kotlin builds 2023-04-17 13:33:51 +00:00
Nikolay Krasko a5876811d8 Instruction for 1.8.20 build 2023-04-17 13:33:50 +00:00
Dmitrii Krasnov 9c32a66e9c migrated NativeExternalDependenciesIT to gradle TestKit 2023-04-17 13:22:25 +00:00
Svyatoslav Scherbina 8466bec048 Native: fix ring benchmark compilation error
`@file:OptIn` can't be applied to a class. Change it to `@OptIn`.
2023-04-17 13:03:13 +00:00
Abduqodiri Qurbonzoda 12f7a6de3e [K/N] Experimental ByteArray.get/setPrimitiveAt(index) functions
As a part of Native stdlib stabilization efforts.

Merge-request: KT-MR-9346
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-04-17 12:42:31 +00:00
Evgeniy.Zhelenskiy aceab2ac1f [IR] Fix KT-57973
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-57973
2023-04-17 12:33:10 +00:00
Abduqodiri Qurbonzoda e7225d29ff [K/N] Mark unit testing API with ExperimentalNativeApi
As a part of efforts to stabilize Native stdlib #KT-55765.
2023-04-17 12:30:42 +00:00
Evgeniy.Zhelenskiy 8c748bfea4 [IR] Add more tests for inline/value classes secondary constructors
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-55333
2023-04-17 12:10:14 +00:00
Abduqodiri Qurbonzoda f75b72990e [K/N] Deprecate SuspendFunction interface with WARNING
As a part of efforts to stabilize Native stdlib.
2023-04-17 12:01:55 +00:00
Jinseong Jeon fbe558a0de AA FIR: handle smartcasted arg when building call's argument mapping
^KTIJ-25112 Fixed
2023-04-17 13:57:08 +02:00
Yahor Berdnikau 86540bdbb4 [Gradle] Fix flaky test
Commonizer may run first and produce compiler arguments output as well
in test output.
2023-04-17 11:45:57 +00:00
Marco Pennekamp 73d99019bd [AA] KT-57515 Add createCompositeModificationTracker 2023-04-17 11:20:52 +00:00
Mikhail Zarechenskiy fc37885d6d K1: report a warning for invisible setter accessed from a derived class
The issue is that during binding fake overrides, the compiler doesn't
 differ setters from its properties, so the compiler uses the same
 visibility for setter and entire property.

 Changing logic at the binding stage can cause some unpredictable consequences so
 the fix is to do this differentiation right at the reporting stage

 ^KT-56662 Fixed

Merge-request: KT-MR-9565
Merged-by: Michail Zarečenskij <Mikhail.Zarechenskiy@jetbrains.com>
2023-04-17 11:08:16 +00:00
Marco Pennekamp d8f253d07b [LL FIR] KT-57207 Choose combined Java symbol providers cache size 2023-04-17 11:07:48 +00:00
Marco Pennekamp e13d4f2328 [LL FIR] KT-57207 Combine Java symbol providers
- `LLFirCombinedJavaSymbolProvider` combines multiple
  `JavaSymbolProvider`s. Its advantages are: combined index access,
  caching, classpath order disambiguation.
- Scopes can still be optimized with a combined scope instead of a naive
  union scope.

^KT-57207 fixed
2023-04-17 11:07:48 +00:00
Marco Pennekamp 3da3e14543 [LL FIR] KT-57220 Get rid of duplicate providers field 2023-04-17 11:07:47 +00:00
Marco Pennekamp b50ecfddb7 [LL FIR] KT-57220 Make combined symbol provider constructors private
- The combined symbol provider should always be constructed using the
  dedicated `merge` function.
2023-04-17 11:07:47 +00:00
Marco Pennekamp 567abd2a1c KT-57207 Implement JavaClassFinder.findClasses
- This change is a prerequisite for allowing combined Java symbol
  providers (in LL FIR) to correctly disambiguate classpath order after
  getting classes with a combined scope, as the index access of the
  combined Java symbol provider is not guaranteed to return the class
  that should be first based on the original dependency order. To be
  able to disambiguate, a combined Java symbol provider needs access to
  all class candidates the index can find.
2023-04-17 11:07:47 +00:00
Marco Pennekamp f2e3c593a1 [FIR] KT-57207 JavaSymbolProvider: Accept existing JavaClasses
- `javaFacade.findClass` is a potentially costly operation. This commit
  extends `JavaSymbolProvider` and its class cache to accept an already
  existing `JavaClass` if provided, circumventing the `findClass`
  operation.
2023-04-17 11:07:46 +00:00
Marco Pennekamp b33c5f77ac [FIR] Move JavaClass.hasMetadataAnnotation to JavaUtils
- This function will be reused in a later commit.
2023-04-17 11:07:46 +00:00
Marco Pennekamp 288606868e [FIR] KT-57207 Avoid FirJavaFacade.knownClassNamesInPackage in the IDE
- `FirJavaFacade.knownClassNamesInPackage` cannot be computed in the IDE
  using the current strategy because there are multiple finders and
  there is no `CliFinder`. However, the cache was still used, which
  caused it to be filled with `null` values and additionally caused
  worse performance in `JavaSymbolProvider` due to hash map accesses via
  `hasTopLevelClassOf`.
- Rewriting the strategy is non-trivial as additional indices are needed
  on the IDE side. See KTIJ-24642.
2023-04-17 11:07:46 +00:00
Marco Pennekamp 624164e183 [LL FIR] Remove unused "multi module lazy resolve" test data
- The test `AbstractFirMultiModuleLazyResolveTest` which used this test
  data was moved to `intellij` with the following commit: https://github.com/JetBrains/kotlin/commit/39fa2b0baf89b246348b1e9c33cfebfc3068c014
- In `intellij`, the test was later deleted with the following commit: https://github.com/JetBrains/intellij-community/commit/042a50dcdff50b0771e73c6948b020a5366ef137#diff-74605de26ac0b4a2a65e53e919001d51199769822a46620ac34ba7e08e85f5e0
2023-04-17 10:57:06 +00:00
Alexander Udalov 287e0909cc Kapt+JVM_IR: do not generate super constructor call
#KT-57699 Fixed
 #KT-57939 Fixed
2023-04-17 10:40:15 +00:00
Vladimir Sukharev 3cdf4bae07 [K2/N] Refactor KonanSymbols before re-enabling special backend checks
^KT-55598
Merge-request: KT-MR-9477
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-04-17 10:35:55 +00:00
Mikhail Glukhikh 147a3331a4 RawFirBuilder: fix label bounding for binary operations
#KT-57880 Fixed
2023-04-17 10:21:25 +00:00
Mikhail Glukhikh 089222cecc K2: reproduce KT-57880 2023-04-17 10:21:24 +00:00
Jinseong Jeon ed4cc99db3 FIR: use symbol modality to ensure the retrieval of lazily resolved status
^KT-57578
2023-04-17 10:59:04 +02:00
Jinseong Jeon 5403cc7feb SLC: fix type mapping mode for var
^KT-57578
2023-04-17 10:59:03 +02:00
Jinseong Jeon 95491f223c FIR: fix subtle isFinal counterpart in ConeTypeContext
^KT-57578 Fixed
2023-04-17 10:59:03 +02:00
Filipp Zhinkin 368f21461c KT-55091 Optimize Sequence::toSet/toList implementation
Sequence::toSet and Sequence::toList both create a
collection, fill it with elements, and then try to optimize a result
by returning empty, singleton, or the allocated collection depending on
the elements count.
Instead of allocating the collection and then trying to return
an optimized instance it is worth checking the sequence's size
beforehand and return empty/singleton collection when possible.

Proposed change optimize performance of aforementioned functions and
also reduce allocation rate when a sequence consists of 0 or 1 elements.

^KT-55091 fixed
2023-04-17 08:58:20 +00:00
Alexander Korepanov e8be3043cc [JS IR] Allow restriction of function argument by external type
Add a special annotation @JsExternalTypeArgument for
 marking function parameters. The marked parameter
 accepts an argument with an external type only.

^KT-57479 Fixed
2023-04-17 08:21:10 +00:00
Anton Lakotka 4819593bf4 [Gradle] Mark nullable visibleSourceSetProvidingCInterops as Optional
^KT-57677 Verification Pending
2023-04-14 22:39:34 +00:00
Jaebaek Seo 3fbd3d7e20 [FIR] Return K2 reference shortener result
This commit sets a list of `KtElement` as the return type of
`ShortenCommand::invokeShortening()`. It allows us to take the result
i.e., shortened PSIs. This can be used, for example, when we want to
run code-format only on the shortened PSI after running the reference
shortener.

^KT-57636 Fixed
2023-04-14 21:50:20 +02:00
Anna Kozlova f810d435f4 [cls] write flexible type information to cls
^KTIJ-25172
this information would be used to create resolved FirElements from stubs,
so no ProtoBuf would be kept in memory
2023-04-14 18:12:48 +00:00
Dmitrii Gridin ffb705fe2f [AA FIR] add missing new line to addImportToFile
^KTIJ-24928
2023-04-14 16:37:12 +00:00
Artem Kobzar 20dea37be0 [K/JS TEST] Run TestGenerated check on generated TS tests 2023-04-14 14:45:11 +00:00
Nikolay Lunyak 20786bb35a [FIR] Refactor the default messages presence checking
Forbid calling `checkMissingMessages` accidentally
outside tests.

Checking Parcelize default messages inside a test.
2023-04-14 13:07:03 +00:00
Artem Kobzar 73f8c984a1 [K/JS TEST] Fix the problem with running JS tests on Windows if the test has a long name 2023-04-14 10:46:52 +00:00
Alexander Korepanov 949186b629 [JS IR Tests] Prevent implicit deletion of irdump files 2023-04-14 09:25:16 +00:00
nataliya.valtman 4bb8bd3901 KT-57224 Support Language version Tag 2023-04-14 08:34:29 +00:00
Pavel Kunyavskiy 95541da9a1 [K/N] Remove unused default dependencies from klib
^KT-55603
2023-04-13 18:28:51 +00:00
Roman Golyshev f662908440 KTIJ-25232 [FIR IDE] Do not shorten properties with non-trivial receiver
If property call receiver is something real (like another property or a
function call), then it should not be shortened because the semantics
might change

^KTIJ-25232 Fixed
2023-04-13 15:48:08 +00:00
Pavel Kargashinsky 4ad16d5cf6 [Gradle][Tests][MPP] Specify warningMode = Fail, for tests without warnings. 2023-04-13 13:15:30 +00:00
Artem Kobzar 5dc6da2b33 [K/JS] Add serialization/deserialization for JsImport/JsExport nodes 2023-04-13 12:58:46 +00:00
Yahor Berdnikau 85644bbbf6 [Gradle] Don't fail TC configuration on expected OOM in test
Test produces as expected OOM exception, but it should not output test
logs into build logs. As TeamCity will parse them and fail because build
 logs contains OOM which is false-positive.
2023-04-13 12:29:39 +00:00
Nikolay Krasko 4d88b8b691 Allow minor versions updates without updating verification metadata 2023-04-13 12:29:39 +00:00
Dmitrii Gridin 9724febf88 [AA FIR] add missing new line to addImportToFile
^KTIJ-24928
2023-04-13 11:38:32 +00:00
Ilya Chernikov df35e5431c FIR: fix libs filtering for abs/rel paths combinations
Some of the incoming paths "absoluteness" may not match the
one of the corresponding library path, and that leaded to incorrect
filtering out some items in the deserialized symbol providers.
Fix the filtering to account for the mismatch.
#KT-57535 fixed
2023-04-13 11:18:38 +00:00
Kirill Rakhman 030866cb0b [FIR] Rewrite ConeKotlinType.hasError() using ConeKotlinType.contains() 2023-04-13 10:50:36 +00:00
Kirill Rakhman 1f29490118 [FIR] Report when typealias expansion contains deprecated type
#KT-57843 Fixed
2023-04-13 10:50:36 +00:00