Commit Graph

96784 Commits

Author SHA1 Message Date
pyos 3392e066df FIR DFA: add more called-in-place tests 2022-12-08 10:19:27 +00:00
pyos f485413cfd FIR DFA: x !is T? => x != null
^KT-22996 tag fixed-in-k2
2022-12-08 10:19:27 +00:00
pyos 02fedeb9ed FIR DFA: revalidate reassigned variables after loops
If a certain type statement is true on loop entry and all continue
paths, then it is also true on exit if the condition did not reassign
the variable.

^KT-7676 tag fixed-in-k2
2022-12-08 10:19:27 +00:00
pyos f9745bd3f1 FIR DFA: make continue jump to condition entry, not loop entry
It's also not a backwards jump in do-while, unless it's in the loop's
condition, which is a stupid "feature" IMO. As you can probably tell
from the comments added in this commit.
2022-12-08 10:19:26 +00:00
Mikhail Glukhikh 7e407585fc CODEOWNERS: don't require separate review of generated files 2022-12-08 10:18:05 +00:00
Mikhail Glukhikh 5db804023e K2: inline shouldRunSamConversionForFunction
Here I delete the function which should always return true for LV>=1.4.
See different SamConversionOracle implementations for K1
2022-12-07 22:09:21 +00:00
pyos e359658c55 Minor: slightly speed up isSamType for FIR IDE 2022-12-07 22:09:20 +00:00
pyos 1232346202 Minor: merge FirSamResolver and its only implementation 2022-12-07 22:09:20 +00:00
pyos 0d46dfc1ba FIR: fix substitution of type arguments in SAM type aliases
^KT-54730 Fixed
2022-12-07 22:09:20 +00:00
pyos 3253789093 FIR: move typealias SAM constructor computation to FirSamResolver 2022-12-07 22:09:19 +00:00
Mikhail Glukhikh 982e743774 Minor: simplify FirScope.processConstructorsByName and things around 2022-12-07 22:09:19 +00:00
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