Commit Graph

100524 Commits

Author SHA1 Message Date
Yahor Berdnikau eb4e96a113 Add kotlin-build-tools-enum-compat workaround
It acts as a workaround for the case when build tools or dependencies
are compiled with latest 'kotlin-stdlib' version, but at a runtime older
 'kotlin-stdlib' is provided, which does not know about new
 `EnumEntries`.

 ^KT-57317 Fixed
2023-04-21 14:57:17 +00:00
Pavel Mikhailovskii 1f649b698c [CLI] Get rid of unnecessary type parameters in arguments.kt 2023-04-21 13:21:28 +00:00
Nikolay Krasko 13ce25a85c [213] Update verification for "maven-resolver-impl" and "httpclient"
KTI-1114
2023-04-21 13:19:05 +00:00
Nikolay Krasko 9e00bb8a21 [213] More dependencies aalto + stax2
KTI-1114
2023-04-21 13:19:05 +00:00
Nikolay Krasko a3293452ca [213] Update verification-metadata.xml
KTI-1114
2023-04-21 13:19:05 +00:00
Nikolay Krasko bedea65f00 [213] Unmute tests fixed in 212 platform
KTI-1114
2023-04-21 13:19:05 +00:00
Nikolay Krasko 760a690c01 [213] Remove some old setting in tests with org.jdom.Element
KTI-1114
2023-04-21 13:19:05 +00:00
Nikolay Krasko f9169e8c7c [213] Dummy code style facade for ClsElementImpl.appendMirrorText()
The only test that fails without is FirOldFrontendLightClassesTestGenerated.
While there's no proof that code fails in production, the footprint from
services shouldn't be big, and it's better to have them instead of
failing in runtime.

KTI-1114
2023-04-21 13:19:05 +00:00
Roman Golyshev 31482fbb8b [213] Try removing jna from kotlin-compiler-embeddable
KTI-1114
2023-04-21 13:19:04 +00:00
Roman Golyshev 83f9e0f87e [213] Add more missing runtime dependencies
KTI-1114
2023-04-21 13:19:04 +00:00
Roman Golyshev b62b21dd67 [213] Adapt to DebugUtil.psiToString semantics change
See 83990991cd17c661bf6ea85b54125c09741d90ec commit in intellij

KTI-1114
2023-04-21 13:19:04 +00:00
Roman Golyshev ac388010b1 [213] Add missing test runtime dependencies
KTI-1114
2023-04-21 13:19:04 +00:00
Roman Golyshev e388b1df36 [213] Ignore proguard warning about com.intellij.util.io.WalRecord$Companion
KTI-1114
2023-04-21 13:19:04 +00:00
Roman Golyshev fb9de6ba45 [213] Avoid using ConcurrentCollectionFactory.createConcurrentIdentityMap
The `ConcurrentCollectionFactory` class was moved to the module
which is no longer available in the 213 platform distribution

`MapMaker().weakKeys().makeMap()` is used as drop-in replacement of
concurrent hash map with identity-based equals strategy

The new implementation stores keys on weak references, which should not
change the behavior of the `ModuleFileCacheImpl`.

1. If someone still has a strong reference to the `ktFile`, then the
cache will also keep it.

2. If there are no more strong references to the `ktFile`, then the
cache will not hold it from being garbage-collected. However, since
nobody  has a strong reference to the `ktFile` anymore, nobody can call
 `fileCached` or `getCachedFirFile` with it, and it will never be
 requested from the cache.

KTI-1114
2023-04-21 13:19:04 +00:00
Roman Golyshev d4cffb8a5a [213] Switch to 213 platform
KTI-1114
2023-04-21 13:19:04 +00:00
Dmitriy Novozhilov 7f07b2a82c Revert "Advance bootstrap to 1.9.0-dev-6379"
This reverts commit fe44727f97.

Revert is needed because of KT-58160
2023-04-21 13:15:45 +00:00
Yan Zhulanow c9c6508b03 [LL API] Fix declaration mapping for library dependencies
As there is no accurate way to figure out exact dependencies for each
library JAR, all project libraries but the current one are added as
dependencies. However, for performance reasons, each library is not
treated as an individual 'LLFirLibrarySession', instead a scope-based
'JvmClassFileBasedSymbolProvider' is used.

Although code analysis is correct with this setup, navigation between
libraries was broken. The reason is that source declarations were only
queried inside the library itself.

After the fix, declarations are first queried in the library,
and if there are no good candidates, all other libraries are scanned.
The same way things work in the Java plugin.

^KTIJ-23073 Fixed
2023-04-21 12:49:43 +00:00
Sergey.Shanshin d8d643b7d7 [KxSerialization] Fix "IllegalAccessError: Update to static final field"
Fixes #KT-57647

For value classes, if you add code to companion anonymous init block in IR, it will be executed in the instance constructor. This causes an error when initializing static fields, because writing to them can only occur from the <clinit> method.

The solution is to transfer the static field initialization code from an anonymous init block to the IR initializer of this field

Merge-request: KT-MR-9633
Merged-by: Sergey Shanshin <Sergey.Shanshin@jetbrains.com>
2023-04-21 12:37:32 +00:00
Aleksei.Cherepanov 803a11003f [Maven] Filter duplicated source roots to avoid multiple module declarations exception
After fixing of KT-13995 (99de93bb) there is a case when several maven plugins register the same source roots twice, which leads to the Kotlin compiler exception "Too many source module declarations found". kotlin-maven-plugin should take care of what it passes to the Kotlin compiler to avoid it

#KT-58048 Fixed

Merge-request: KT-MR-9716
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2023-04-21 12:07:30 +00:00
Dmitrii Gridin f85dc95b66 [SLC] SymbolLightAccessorMethod: reduce number of requests on symbol restoring
We can avoid extra restoring of property accessors
if the corresponding property is already restored

^KT-57850
2023-04-21 11:10:20 +00:00
Dmitrii Gridin 5d1c853adf [AA FIR] fix contract violation for java Target annotation
^KT-57849 Fixed
2023-04-21 10:14:05 +00:00
Dmitrii Gridin f540826207 [AA FIR] add tests on java target annotation stability
^KT-57849
2023-04-21 10:14:05 +00:00
Dmitrii Gridin 7b91cd0ff3 [FIR] calculate java Target annotation on COMPILER_REQUIRED_ANNOTATIONS phase
^KT-57849
^KT-57949
2023-04-21 10:14:05 +00:00
Dmitrii Gridin 1c456b216b [AA FIR] add lazy resolve test on java target
^KT-57849
2023-04-21 10:14:05 +00:00
Dmitrii Gridin 0caaca45ae [AA FIR] fix contract violation for Target annotation
^KT-57849
2023-04-21 10:14:05 +00:00
Dmitrii Gridin d66b919c12 [AA] introduce tests on annotation stability
^KT-57849
2023-04-21 10:14:05 +00:00
Ilya Chernikov 5f6d8c9030 Fix maven script executor after changes in the jdk path processing
#KT-58101 fixed
2023-04-21 09:40:19 +00:00
Anton Lakotka 877c1b1742 [Gradle] Clean up ConfigurationCacheIT tests 2023-04-21 06:41:45 +00:00
Anton Lakotka 40d29d13bf [Gradle] Don't use project in gradle task's input properties
With Gradle 8.1 it is now unsupported with Configuration Cache

^KT-58062 Verification Pending
^KT-58063 Verification Pending
2023-04-21 06:41:45 +00:00
Anton Lakotka ab82027f86 [Gradle] Test that multiplatform tasks can work with Gradle 8.1 GCC
^KT-58062
^KT-58063
2023-04-21 06:41:45 +00:00
Egor Kulikov c46c922841 [ClsStubs] Add context receivers on function types 2023-04-20 18:57:51 +00:00
Dmitriy Novozhilov 6b41c5a969 [Build] Temporary exclude modules which uses serialization plugin from JPS build
KT-58111
2023-04-20 18:37:30 +00:00
Dmitriy Novozhilov fe44727f97 Advance bootstrap to 1.9.0-dev-6379 2023-04-20 18:37:29 +00:00
Ivan Kochurkin b72dcf8b37 [K2, MPP] Fix actualization of nullability-based overloads
^KT-58043 Fixed
2023-04-20 17:22:45 +00:00
Artem Kobzar c5b60a16bb [K/JS TESTS] Remove .ts files genereting from generateTests command to enable Gradle execution optimizations
Warning Context:
> Task :js:js.tests:generate-ts-for-regular-classes-in-exported-file
Execution optimizations have been disabled for task ':js:js.tests:generate-ts-for-regular-classes-in-exported-file' to ensure correctness due to the following reasons:
  - Gradle detected a problem with the following location: './js/js.translator/testData/typescript-export/regular-classes-in-exported-file'. Reason: Task ':js:js.tests:generate-ts-for-regular-classes-in-exported-file' uses this output of task ':js:js.tests:generate-js-export-on-file-for-regular-classes' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.6.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.

> generateTypeScriptTests
> tsc --build ./typescript-export/regular-classes-in-exported-file/tsconfig.json
2023-04-20 16:13:40 +00:00
Dmitry Savvinov da073c9cc3 [mpp] Warn about using pre-HMPP dependencies
^KT-58086 Fixed
2023-04-20 15:35:05 +00:00
Pavel Punegov a98c2c178f [K/N][test] Add missing parenthesis that discovered frontend issue
See also ^KT-58131

Merge-request: KT-MR-9702
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-04-20 11:59:59 +00:00
Dmitrii Gridin bca8be6c39 [LL FIR] avoid resolve to find property accessor declaration
^KT-57850 Fixed
2023-04-20 11:12:39 +00:00
Dmitrii Krasnov aea7f4b6d2 migrated NativeEmbeddableCompilerJarIT to junit 5 and gradle TestKit
#KT-51553


Co-authored-by: Alexander Likhachev <me@alikhachev.com>

Merge-request: KT-MR-9579
Merged-by: Dmitrii Krasnov <Dmitrii.Krasnov@jetbrains.com>
2023-04-20 11:10:30 +00:00
Kirill Rakhman 594b044c26 RawFirBuilder: fix label bounding for property initialization
#KT-58076 Fixed
2023-04-20 11:05:02 +00:00
Aleksei.Cherepanov df8132b844 Revert "[Maven] Filter duplicated source roots to avoid multiple module declarations exception"
This reverts commit 07d20c6ee1.
2023-04-20 13:00:19 +02:00
Dmitriy Dolovov 7da05d66e3 [PL][tests] Run JS tests with enabled PL with ERROR log level
#KT-57378
2023-04-20 10:23:47 +00:00
Aleksei.Cherepanov 07d20c6ee1 [Maven] Filter duplicated source roots to avoid multiple module declarations exception
After fixing of KT-13995 (99de93bb) there is a case when several maven plugins register the same source roots twice, which leads to the Kotlin compiler exception "Too many source module declarations found". kotlin-maven-plugin should take care of what it passes to the Kotlin compiler to avoid it

#KT-58048 Fixed

Merge-request: KT-MR-9663
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2023-04-20 10:14:32 +00:00
Dmitrii Krasnov c3bfe72394 migrated CInteropIdeaSyncIT to junit5 and gradle TestKit
#KT-51553

Co-authored-by: Alexander Likhachev <me@alikhachev.com>

Merge-request: KT-MR-9599
Merged-by: Dmitrii Krasnov <Dmitrii.Krasnov@jetbrains.com>
2023-04-20 09:48:20 +00:00
Pavel Mikhailovskii 58143a2006 KT-57598 Run Kapt with K1 even when the compiler is run with K2 2023-04-20 09:30:38 +00:00
Dmitriy Novozhilov cb4c41a5ca [Gradle IT] Pass gradle version directly to tests in K2KotlinxSerializationIT 2023-04-20 09:27:08 +00:00
Dmitriy Novozhilov 37e4a05878 [FIR] Serialize generated classes into Klib metadata
^KT-57781 Fixed
2023-04-20 09:27:08 +00:00
Dmitriy Novozhilov 0f8c797d7c [FIR] Introduce caching service for metadata declarations provided by extensions
This is needed to allow to call for provided declarations multiple times
  with only one real invocation of plugins
2023-04-20 09:27:07 +00:00
Dmitriy Novozhilov fb1cdf643b [FIR] Load kotlin.arrayOf function in IrBuiltInsOverFir from Fir
^KT-57690 Fixed
^KT-57807 Fixed
2023-04-20 09:27:07 +00:00
Kirill Rakhman 6972391185 [FE] Make dynamic a suitable resulted type
This fixes a FIR-specific issue where a type variable is inferred to
Any instead of dynamic. K1 wasn't affected because of a FIR-specific
condition in ResultTypeResolver.

#KT-57962 Fixed
2023-04-20 08:45:42 +00:00