Commit Graph

96773 Commits

Author SHA1 Message Date
Alexander Udalov a594434a95 Kapt+JVM_IR: do not run IR plugins in kapt mode
Because in kapt stub generation mode (aka ClassBuilderMode.KAPT3, aka
generateBodies=false in psi2ir), method bodies are not generated and
compiler plugins such as kotlinx-serialization might not expect that.

 #KT-54245 Fixed
2022-12-07 21:14:30 +00:00
Alexander Udalov 5848b2fde6 Kapt+JVM_IR: add IrKotlinKapt3IntegrationTest 2022-12-07 21:14:29 +00:00
Anton Lakotka 1d041b7ef4 [Gradle] Replace deprecated String::capitalize with capitalizeAsciiOnly
This should prevent issues when ascii characters are uppercased or
lowercased on users machines with their locales.

For example in Turkish locale:
* 'i' uppercases to 'İ'
* 'I' lowercases to 'ı'

^KT-38712 Verification Pending
2022-12-07 20:39:26 +00:00
Anton Lakotka 7ef858b2fe [Gradle, Test] Check gradle entity names for turkish 'I' or 'ı'
^KT-38712
2022-12-07 20:39:25 +00:00
Mark Mann 3592c87abf Fix enumeration of empty list in KotlinLikeDumper
In some cases where the Kotlin compiler encounters an exception, it attempts to print the contents of the file that it was compiling at the time. Sometimes the content contains symbols that aren't bound to implementations. When that happens the safe value parameters for a function are empty because none of them can be resolved, but the value parameter count is still non-zero because the function reference still has multiple params — this causes exception messages to fail with an error:

```
Exception in thread "main" java.lang.IllegalStateException: Problem with constructing exception message
```
This fixes the issue by only attempting to access the safe value parameters if the list is of the proper size.

KT-54012
2022-12-07 19:46:49 +01:00
Alexander Korepanov 9edaebf235 [JS IR] Enable DTS generation in IC
^KT-54398 Fixed
2022-12-07 18:05:53 +00:00
Alexander Korepanov d21cbfe02e [JS IR] Take into account the declaration annotations in IC hash
So the annotation modifications invalidate the caller.
2022-12-07 18:05:53 +00:00
Alexander Korepanov 0a35d84193 [JS IR] DTS generation refactoring
Keep a DTS fragment in JsIrProgramFragment
 for each file and build the module DTS from them.
2022-12-07 18:05:52 +00:00
Dmitriy Novozhilov 03a43e0dc0 Advance bootstrap to 1.8.20-dev-3737 2022-12-07 16:47:48 +00:00
Pavel Mikhailovskii 6db5f8ee7f KT-55123 Add a default constructor to "expect" JvmSerializableLambda 2022-12-07 16:41:11 +00:00
Alexander Shabalin 314edd7066 [K/N] Add clangFormat task for automatic patch formatting ^KT-53776
Merge-request: KT-MR-7880
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-12-07 14:46:55 +00:00
Dmitrii Gridin 5c9aa88617 [AA] KtModule#project shouldn't be null
^KT-55336
2022-12-07 14:18:44 +00:00
Pavel Kirpichenkov f0642d6c9a fixup! Fix configurations in dependency handler of KotlinWithJavaCompilation 2022-12-07 13:35:55 +00:00
Pavel Kirpichenkov 72120271b7 fixup! Fix configurations in dependency handler of KotlinWithJavaCompilation 2022-12-07 13:35:55 +00:00
Pavel Kirpichenkov 55c13d7c05 fixup! Fix configurations in dependency handler of KotlinWithJavaCompilation 2022-12-07 13:35:55 +00:00
Pavel Kirpichenkov 786ea79886 [MPP] add tests for source set constraints
KT-54974
2022-12-07 13:35:54 +00:00
Zalim Bashorov 54c00cc588 [Sourcemap] Add an ability to provide outputColumn to SourceMap3Builder#addMapping instead of using getCurrentOutputColumn
The ability will be used later by wasm backend while generating sourcemap.
2022-12-07 12:03:54 +00:00
Zalim Bashorov fb4dcc6a6a [Sourcemap] Introduce getCurrentColumn and stop using TextOutput directly
The general goal is remove dependency on TextOutput and
make it simpler to use for wasm backend.
2022-12-07 12:03:54 +00:00
Zalim Bashorov e34d3d09bc [Sourcemap] Extract addLink from SourceMap3Builder as a addSourceMappingURL
The general goal is remove dependency on TextOutput and
make it simpler to use for wasm backend.
2022-12-07 12:03:54 +00:00
Dmitrii Gridin 9f82c43b1b [SLC] replace requireNotNull with regular exception
^KT-54051
2022-12-07 11:53:13 +01:00
Bogdan Mukvich c02d5e8dcc Make maven dependencies provided in kotlin-maven-plugin
KTI-1028
2022-12-07 10:28:48 +00:00
Bogdan Mukvich cffeb58ec3 Update maven dependencies in kotlin-maven-plugin
KTI-1028
2022-12-07 10:28:48 +00:00
Pavel Mikhailovskii 4676072137 KT-51284 Fix SAM conversion for methods with context receivers 2022-12-07 09:01:21 +00:00
Dmitrii Gridin cc9beb466e [SLC] SymbolLightClassForEnumEntry: shouldn't be regular class
^KTIJ-23842 Fixed
2022-12-07 08:41:19 +00:00
Bogdan Mukvich 2405dd2c5c Fix flaky behaviour of testThirdPartyCopyrights
KTI-1050
2022-12-07 08:20:47 +00:00
Pavel Mikhailovskii 2d69fd5a8a KT-52027 Encapsulate and fix calculation of parameter indices 2022-12-06 23:16:11 +00:00
Ilya Kirillov a297240870 [LL FIR] fix a memory leak from LLFirNonUnderContentRootSessionFactory 2022-12-06 23:05:27 +00:00
Pavel Mikhailovskii b4b05b7bf6 KT-8575 Enable references to synthetic Java properties in 1.9 2022-12-06 22:16:01 +00:00
wrongwrong ccac4ac1ab Minor, use isSuspend in KCallableImpl.extractContinuationArgument
https://github.com/JetBrains/kotlin/pull/4840#discussion_r1010982746
2022-12-06 22:35:56 +01:00
Ilya Kirillov 2f2aa5ed6f [LL FIR] invalidate caches on exceptions in more places where we modify some fir elements 2022-12-06 21:20:42 +00:00
Ilya Kirillov 7a89ca495c [LL FIR] do not execute resolve under a non-cancellable session
The sessions are invalidated on the PCE
2022-12-06 21:20:41 +00:00
Ilya Kirillov 3d68eb27d5 [LL FIR] do not use LLFirModuleLazyDeclarationResolver directly
use lazyResolveToPhase instead for consistency
2022-12-06 21:20:41 +00:00
Alexander Udalov 60d96b7d15 Remove some leftover imports of unsafe cast functions 2022-12-06 19:44:56 +00:00
Alexander Udalov 0d8d91f803 Remove unsafe cast function usages from compiler plugins 2022-12-06 19:44:56 +00:00
Alexander Udalov fd9b19ee49 Remove unsafe cast function usages from IR modules 2022-12-06 19:44:55 +00:00
Alexander Udalov 1418423423 Remove unsafe cast function usages from JVM backend modules 2022-12-06 19:44:55 +00:00
Marco Pennekamp 2cd16f055a [AA] KT-55098 Render context receivers in declarations & function types
- `context(...)` is a modifier that must precede annotations and other
  modifiers, so for declarations it is rendered in
  `renderAnnotationsAndModifiers`.
- Ignore `@ContextFunctionTypeParams` in the annotation list of FE10
  types, as the annotation is an implementation detail of context
  receivers in K1 and shouldn't be rendered.

^KT-55098 fixed
2022-12-06 17:43:30 +00:00
Marco Pennekamp e2804693bf [AA] KT-55098 Add context receivers to KtFunctionalType
- Context receivers in function types may not be labeled, so the created
  `KtContextReceiver`s have `null` labels. Such labels currently only
  compile due to a bug (see KT-55187).
2022-12-06 17:43:29 +00:00
Marco Pennekamp 2851622a6f [AA] Fix typos in renderers 2022-12-06 17:43:29 +00:00
Pavel Mikhailovskii 25ad7fe31c KT-51863 Account for context receivers in calls with changed parameter order 2022-12-06 16:28:08 +00:00
Gleb Lukianets e9984ce38d Make checking Xcode version faster.
xcodebuild -version call may take enormous amount of time even after warmup. To alleviate this, first try to check Xcode version directly by reading application .plist file, but still use xcodebuild -version as a fallback.

Merge-request: KT-MR-7694
Merged-by: Gleb Lukianets <Gleb.Lukianets@jetbrains.com>
2022-12-06 15:52:13 +00:00
Sergey Bogolepov 4adb367a25 [K/N] Fix logging in NativeGenerationState context 2022-12-06 15:40:55 +00:00
Sergey Bogolepov dca14d4285 [K/N] Reduce usages of NativeGenerationState.context
Now that NativeGenerationState is a PhaseContext we don't need to
access `context` property that frequently.
2022-12-06 15:40:55 +00:00
Sergey Bogolepov b8f9b07a5a [K/N] Turn NativeGenerationState into PhaseContext
It allows to use NativeGenerationState as a PhaseContext in lowering
and codegen phases.
2022-12-06 15:40:54 +00:00
Dmitrii Gridin 8a9acfcab0 [SLC] SymbolLightModifierList: replace custom loop with compareAndSet with updateAndGet
^KTIJ-23783
2022-12-06 13:40:50 +00:00
Dmitrii Gridin 3ee451c873 [SLC] SymbolLightFieldForObject: reduce allocations number
^KTIJ-23783
2022-12-06 13:40:49 +00:00
Dmitrii Gridin 91586705b3 [SLC] SymbolLightSimpleMethod: reduce allocations number
^KTIJ-23783
2022-12-06 13:40:49 +00:00
Dmitrii Gridin c5c79a5fb5 [SLC] SymbolLightModifierList: improve equals
^KTIJ-23783
2022-12-06 13:40:48 +00:00
Dmitrii Gridin 2ec09408d3 [SLC] SymbolLightModifierList: avoid redundant array allocation
^KTIJ-23783
2022-12-06 13:40:48 +00:00
Dmitrii Gridin a7390d027a [SLC] migrate from ImmutableHashMap to PersistentHashMap
^KTIJ-23783
2022-12-06 13:40:48 +00:00