Commit Graph

101755 Commits

Author SHA1 Message Date
Pavel Mikhailovskii 46844100d5 Fix visibility of $annotations methods 2023-06-12 12:59:53 +00:00
Bogdan Mukvich b4004763cc [Gradle] Fix pom for kotlin-annotation-processing-gradle
^KTIJ-25586
2023-06-12 11:45:26 +00:00
Denis.Zharkov 41933facbb K2: Fix ISE from inference on delegate vars with implicit types
See the test data.
ISE happened because at some point after incomplete `getValue` resolution
of `a` property, we updated in the `transformAccessors` the property type
to the `Variable(Y)` type and then used it as a 3rd argument for
`setValue` call which is incorrect because the variable belongs
to a different constraint system (from `getValue`).

Mostly, the fix is just a repeating K1 behavior, namely postponing
`setValue` resolution until delegate inference is completed.

^KT-59066 Fixed
2023-06-12 11:30:35 +00:00
Vyacheslav Gerasimov b8c4a4c80a Build: Add missing v8 artifacts to the verification-metadata.xml 2023-06-12 12:48:04 +02:00
Vladimir Dolzhenko f9d67feb05 Fix the owner list
Merge-request: KT-MR-10559
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2023-06-12 07:26:17 +00:00
Dmitrii Gridin ea9244bf48 [FIR] ReturnTypeCalculatorWithJump: support WrappedIntegerOperator explicitly
^KTIJ-25761
2023-06-10 17:57:52 +00:00
Dmitrii Gridin d7c197b31e [LL FIR] support lazy resolve for WrappedIntegerOperator
^KTIJ-25761 Fixed
2023-06-10 17:57:52 +00:00
Dmitrii Gridin 563f913a95 [LL FIR] introduce tests to check lazy resolve stdlib as sources
^KTIJ-25761
2023-06-10 17:57:52 +00:00
Anna Kozlova e81099ca96 [light classes] create enum references as PsiReferenceExpressions
to better mimic java psi,
see e.g. `PsiJvmConversionHelper#getAnnotationAttributeValue(PsiAnnotationMemberValue)`
2023-06-10 08:30:26 +00:00
Dmitriy Novozhilov 29afd0dc97 [FIR] Properly match expect fun interfaces with java interfaces 2023-06-10 07:33:30 +00:00
Dmitriy Novozhilov 1418a2bcb8 [Test] Temporary update testdata till KT-58829 will be fixed 2023-06-10 07:33:30 +00:00
Dmitriy Novozhilov af041f5bef [Test] Update test according to KT-58899 2023-06-10 07:33:30 +00:00
Dmitriy Novozhilov c64310a833 [Test] Update tests according to KT-58544
There are some cases for fake-override actualization which become
  prohibited in the new expect/actual model, so few tests start to fail,
  despite the fact that they are checking entirely different things
2023-06-10 07:33:29 +00:00
Dmitriy Novozhilov 8b9079d026 [Expect/Actual] Add ability to skip matching of constructors of expect enums
In terms of MPP there are no such thing as `expect constructor` for enums,
  but they are physically exist in FIR and IR, so we need a switch which
  skips matching for them

FE 1.0 implementation did not touch to avoid any hidden changes
2023-06-10 07:33:29 +00:00
Dmitriy Novozhilov ba41e8ec38 [IR] Use common expect/actual matching algorithm in IR actualizer
^KT-58578 Fixed
2023-06-10 07:33:29 +00:00
Dmitriy Novozhilov 62534f43c9 [IR] Fix nullability of substituted type arguments in IrTypeSubstitutor 2023-06-10 07:33:29 +00:00
Dmitriy Novozhilov 623019cff1 [FE] Move substitutor related methods to TypeSystemContext
Also use TypeSystemContext instead of TypeSystemInferenceExtensionContext
  in AbstractExpectActualCompatibilityChecker

This is needed to have an ability to implement ExpectActualMatchingContext
  for IR backend. IrTypeSystemContext may operate with type substitutors,
  but there is no sense to implement all methods from TypeSystemInferenceExtensionContext
  in it
2023-06-10 07:33:29 +00:00
Dmitriy Novozhilov 26d7494789 [FIR] Simplify ReceiverValue hierarchy
- Get rid of `AbstractExplicitReceiver` (as there is no explicit usages of it)
- Get rid of `AbstractExplicitReceiverValue` (as there is only one inheritor of it)
- Make `ReceiverValue` an abstract class
2023-06-09 22:51:31 +00:00
Dmitriy Novozhilov 6409bf2fe8 [FIR] Store expressions of receivers inside candidates instead of ReceiverValue
This is needed because of mutable nature of receiver values: implicit
  receiver values can be modified because of smartcasts, but in candidate
  we need to store snapshot of receiver in the form it was at the beginning
  of the resolution

^KT-58823 Fixed
2023-06-09 22:51:31 +00:00
Dmitriy Novozhilov b564260a33 [FIR] Drop ImplicitReceiverValue.expandedType
This field cached expansion of type of implicit receiver, which is incorrect,
  because type of receiver may change because of smartcasts, but this field
  was immutable
2023-06-09 22:51:31 +00:00
Dmitriy Novozhilov c55ddab1bf [Test] Reproduce KT-58823 2023-06-09 22:51:31 +00:00
Dmitriy Novozhilov 8b7cfcda10 [FIR] Add toString() methods to some ConeSubstitutor implementation
This is needed only for pleasant debugging
2023-06-09 22:51:31 +00:00
Roman Golyshev ba6f8e9b23 KT-59199 [Analysis API][FIR] Force resolve of the bodies for the KtFirReferenceShortener and KtFirImportOptimizer
Without it, those services might see outdated FIR elements when the user
changes the PSI.

Related tickets: KT-58257, KTIJ-25785, KTIJ-25749
2023-06-09 23:56:11 +02:00
Ilya Kirillov 724386a5f1 [Analysis API] rework the resolve of the nested name references
To properly resolve qualifier parts in the middle,
we need to resolve the whole qualifier to understand
which parts of the qualifier are package or class qualifiers.
And then we will be able to resolve the qualifier
selected by the user to the proper class, package or callable.

^KT-59189
2023-06-09 21:18:45 +00:00
Ilya Kirillov 785778511b [Analysis API] rework KDoc resolution
1. Optimize it by removing a tower data context collection (KT-59189)
2. Rework the behavior, so it simulates the tower resolve by returning the set of symbols only from the first tower level, which is not empty

^KT-59189 fixed
2023-06-09 21:18:45 +00:00
Alexander.Likhachev 10285b32f1 [Gradle] Restore special handling for OOM as a cause of RemoteException
Fixup to KT-59191
2023-06-09 17:44:41 +02:00
Sergey.Shanshin 441b22c0fd [KxSerialization] Fixed error accessing the descriptor from companion
Relates #KT-57647

If a serialization descriptor is used in the companion, then when accessing the child elements, an array of cached child serializers may be read.
Since the serialization plugin adds its declarations to the class after the declarations from the source code, the initialization of the array of child serializers occurs after the execution of the user code.
This can lead to N PE errors when trying to access an unfilled cached child serializer.

The solution is to change the order of declarations so that the declaration with the property of cached child serializers comes first.

Merge-request: KT-MR-10545
Merged-by: Sergey Shanshin <Sergey.Shanshin@jetbrains.com>
2023-06-09 15:32:28 +00:00
Ilya Kirillov d9cb7b67d4 [Analysis API] move ShortenCommand.invokeShortening to the IDE repository
as Analysis API should not modify the code

^KT-58992 fixed
2023-06-09 14:45:23 +00:00
Ilya Kirillov 95cf892eec [Analysis API] extract the data from the ShortenCommandImpl to the base class
^KT-58992
2023-06-09 14:45:23 +00:00
Troels Bjerre Lund fffc921d42 [K/N] custom_alloc: fix race on extraobject ^KT-55364
This avoids that the thread sweeping the base object can get stale
locals, in the case that the finalizer thread unlinks the extraobject at
the same time. This is done by moving the responsibility of unlinking
the extraobject to the sweeping of the base object.


Co-authored-by: Troels Bjerre Lund <troels@google.com>

Merge-request: KT-MR-10518
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2023-06-09 13:01:00 +00:00
Timofey Solonin 97e48eee7a [MPP] Remove unnecessary platform limitations in CommonizerHierarchicalIT
^KT-58822
2023-06-09 12:24:01 +00:00
Alexander Shabalin 7815eec7c1 [K/N] Rework GC switches with better naming
Additionally, deprecate -Xgc in favour of a new binary option "gc".
This will allow setting gc right in gradle.properties

Merge-request: KT-MR-10498
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2023-06-09 12:04:19 +00:00
Pavel Mikhailovskii fc7af2c9e0 KT-58720 Generate full InnerClass attributes for the standard library; deprecate -Xuse-old-innerclasses-logic 2023-06-09 11:31:17 +00:00
Bogdan Mukvich 1dbe47c039 [CODEOWNERS] Add IntelliJ Kotlin Plugin to OWNER_LIST 2023-06-09 11:56:36 +02:00
Yahor Berdnikau 6aff392434 [Gradle] Fix moduleName is not possible to set in native via compilation
^KT-57823 Fixed
2023-06-09 08:24:14 +00:00
Kirill Rakhman 86836e69e9 [FIR2IR] Unwrap call-site substitution overrides
Generating IR declarations for use-site substitution overrides leads
to IR that is different from K1 as well as problems in signature
generation which relies on mangling. Use-site substitutions can contain
references to type parameters from the call-site which aren't handled
in mangling.

#KT-57022 Fixed
2023-06-09 08:22:21 +00:00
Kirill Rakhman bcdd85758e [FIR] Split origin SubstitutionOverride into declaration and call-site 2023-06-09 08:22:21 +00:00
Kirill Rakhman 67fc46a190 [FIR] Fix handling of type parameters in FIR mangling
#KT-57429 Fixed
2023-06-09 08:22:21 +00:00
Anton Lakotka 938dd65881 [Gradle] test lazy resolved configuration can handle circular dependencies
In gradle it is possible to add dependency to configuration which
is resolved to itself. It is possible due to nature of Configuration
that can contain both: dependencies and artifacts. When configuration
has dependency on itself, it practically means that this dependency
will be resolved to configuration's artifacts.

LazyResolvedConfiguration should be capable to handle such dependencies
2023-06-08 22:10:24 +00:00
Anton Lakotka 2b26b0c540 [Gradle] Add integration test for Icerock Mobile Multiplatform plugin
^KT-59049
2023-06-08 22:10:24 +00:00
Anton Lakotka e5d35f7d1a [Gradle] deprecate android and introduce androidTarget preset
Android preset needs to be removed in favor of Android Pluggable Target

Changes were originally introduced by commit:
becf50ee0f
but then, unfortunately, reverted due to binary compatibility issues

^KT-59049 Verification Pending
^KT-57903 Verification Pending
2023-06-08 22:10:24 +00:00
Anton Lakotka 5a8b6e9603 Revert "[Gradle/MPP] Refactored KotlinTargetContainerWithPresetFunctions"
This reverts commit becf50ee

These changes are binary incompatible due to move of methods with
default arguments.

^KT-59049 In Progress
^KT-57903 In Progress
2023-06-08 22:10:24 +00:00
Leonid Startsev 0cfe2b04f5 Move KmModuleFragment to an internal.common package
because it is klib-related and can be read only with KotlinCommonMetadata.
2023-06-08 17:53:31 +00:00
Leonid Startsev c3d363d1b8 Throw exception instead of returning null from KotlinClass(Module)Metadata.read() 2023-06-08 17:53:31 +00:00
Leonid Startsev 1c629e748f Add JvmStatic + JvmOverloads to writing functions in KotlinClassMetadata
and KotlinModuleMetadata for easier use from Java.
2023-06-08 17:53:31 +00:00
Leonid Startsev 70739df0ad Improve toString() for KmAnnotationArgument 2023-06-08 17:53:31 +00:00
Brian Norman 92cb47a8f9 [FIR] Always report when named arguments are not allowed
#KT-59177 Fixed
2023-06-08 17:25:34 +00:00
Denis.Zharkov 61ed34f4b7 K2: Adjust JDK 21 test data to the latest JvmMappedScope changes
See 2e5b783cc6 for details

After the fix for KT-57694 (mostly rewritten JvmMappedScope),
the behavior of loading new JDK 21 members of K2 has been aligned with K1
2023-06-08 15:53:22 +00:00
Denis.Zharkov d5f24addea K2: Fix isHiddenForThisCallSite for non-direct overridden
Previously, the call of `z.sort` in test has been resolved
to the overridden member
2023-06-08 15:53:22 +00:00
Alexander Udalov b992e698e4 Minor, add regression test for KT-58772
#KT-58772
2023-06-08 15:42:27 +00:00