Commit Graph

3840 Commits

Author SHA1 Message Date
strangepleasures 9688c3e761 [KAPT] Improve stub formatting; check raw stubs in tests
Merge-request: KT-MR-14244
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2024-02-09 15:41:37 +00:00
Pavel Mikhailovskii 7ab9e03347 KT-65684: KAPT: (Re)enable fallback to K1 KAPT and make it default
[KAPT] KT-65684 Set languageVersion=1.9 in KaptToolIntegrationTestGenerated

[KAPT] KT-65684 Re-enable a few now-passing tests in Kapt4IT

[KAPT] KT-65684 Fix the logic setting -Xuse-kapt4 flag in Kapt4IT.forceKapt4()

The change is needed to make sure that all the tests have the flag set,
 otherwise some of them would silently switch to the fallback node.
Also disables a few now failing tests.

[KAPT] KT-65684 Revert "KT-64385 Enable K2 KAPT by default"

This reverts commit 7e9d6e60


Merge-request: KT-MR-14291
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2024-02-09 12:54:28 +00:00
Alexander Udalov 3f034e8b67 Enable lightweight lambdas (aka invokedynamic) since 2.0
#KT-45375 Fixed
 #KT-58173 Open
2024-02-08 19:46:18 +00:00
Pavel Mikhailovskii f81b1150b2 [KAPT] KT-65453 Disable generation of type annotations in Java stubs
A workaround for KT-65608


Merge-request: KT-MR-14236
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2024-02-08 18:05:49 +00:00
Vladimir Tagakov 11d3ead975 jvm-abi-gen: Remove effectively private classes from ABI
#KT-64590 Fixed
2024-02-08 15:19:50 +00:00
Evgeniy.Zhelenskiy 7eab4b672d [K1, K2, CLI] Mark whole position range of compiler diagnostics in CLI
#KT-64989
2024-02-08 12:59:31 +00:00
Brian Norman 305c53dd6e [PowerAssert] Add codegen tests 2024-02-07 21:51:17 +00:00
Brian Norman aa34282efb [PowerAssert] Integrate with build
^KT-63617 Fixed
2024-02-07 21:51:17 +00:00
Brian Norman c3a60b127e [PowerAssert] Reformat files 2024-02-07 21:51:17 +00:00
Brian Norman 2de0c8b23f [PowerAssert] Update file copyright 2024-02-07 21:51:17 +00:00
Brian Norman d8167fe82b [PowerAssert] Update base package 2024-02-07 21:51:17 +00:00
Alexander Udalov 28797a31b4 JVM: refactor JvmDefaultMode, remove/rename some entries
- remove ENABLE/COMPATIBILITY because they can no longer be used
- remove forAllMethodsWithBody because its behavior is now equivalent to
  isEnabled
- inline isCompatibility
- inline DEFAULT
- rename ALL_INCOMPATIBLE -> ALL
2024-02-06 17:18:44 +00:00
cristiangarcia c897328af6 Make lombok tests CC compatible
Required for KTI-1553
2024-02-06 10:11:15 +00:00
Vladimir Tagakov dab9ac3b1c jvm-abi-gen: Allow disabling class members sorting in abi.jar
#KT-64589
2024-02-02 16:29:19 +00:00
Kirill Rakhman d047db850f [FIR] Fix nullability of function type created from custom function type
#KT-64706 Fixed
2024-01-31 08:52:58 +00:00
vladislav.grechko 9aa8fb80e7 Set correct IR origins for inc/dec operations
NB: in order to produce correct IR origins, the source element kinds for
some FIR elements has been changed. As a side effect, mapping PSI to FIR
slightly changed: namely, for `a[b]++`, `a[b]` used to be mapped on
`set` call or callable reference, but now it is mapped on `get` call.

^KT-61891: Fixed
^KT-64387: Fixed
2024-01-30 14:26:10 +00:00
Sergej Jaskiewicz 2277c1ba97 [FIR] Fix metadata dump in a compiler plugin-related test
The previous commit also fixed the inconsistency between the test and
production compiler configuration, which led to the metadata dump in
this test to be correct.

See the commit message of 49071374b4
for details.
2024-01-29 21:07:43 +00:00
strangepleasures 17955ce7d9 Revert "Remove flaky Kapt4ToolIntegrationTestGenerated test"
This reverts commit 58fd558308.
2024-01-29 15:47:36 +00:00
Alexander Udalov 7ca2df3ff9 Kapt: minor, remove unneeded check
Most likely it has been made obsolete by KT-27936 where we started to
generate all inner class names correctly.

 #KT-61080 Fixed
2024-01-29 12:58:06 +00:00
Artem Olkov de6a27aeeb KT-65123: move Swift Export Compiler Plugin into swift-export-standalone module
Merge-request: KT-MR-14031
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-01-29 10:32:09 +00:00
Simon Ogorodnik 53e89a9722 K2. Minor. Rename FirConstExpression to FirLiteralExpression
FirConstExpression is usually confused with "constant" calculations,
while in fact, it just denotes a simple literal expression
and `1 + 1` isn't represented by a FirConstExpression.

^KT-64314 Fixed
2024-01-25 23:05:15 +00:00
Dmitriy Novozhilov 150ff1172e [FIR] Add session parameter to all "element --> reference" utilities
`FirDeserializedEnumAccessExpression` requires session to build proper
  reference, so it's important to have it in all utilities, which may
  pass this element as input

^KT-64975
2024-01-25 15:55:19 +00:00
Vladimir Tagakov 91002eacda jvm-abi-gen: Remove data class copy fun from ABI along with constructor
#KT-64591 Fixed
2024-01-25 12:03:47 +00:00
Dmitriy Novozhilov ed874262e3 [FIR] Part 3. Setup running platform checkers in CLI
^KT-58881
2024-01-24 10:45:00 +02:00
Dmitriy Novozhilov 727d2f46f8 [FIR] Part 1. Group checkers by the MPP kind
This commit introduces MppChecker kind, which represents the new property
  of checkers
- `MppCheckerKind.Common` means that this checker should run from the same
  session to which corresponding declaration belongs
- `MppCheckerKind.Platform` means that in case of MPP compilation this
  checker should run with session of leaf platform module for sources
  of all modules

An example of a platform checker is a checker that checks class scopes
  and reports ABSTRACT_NOT_IMPLEMENTED and similar diagnostics. If some
  regular class in the common module contains expect supertypes, the
  checker should consider the actualization of those supertypes to get
  a complete type scope

^KT-58881
2024-01-24 10:44:59 +02:00
strangepleasures 85c9c57da4 [KAPT] KT-65006 fix issues when using Kapt+Serialization
This MR fixes two independent issues causing build failures when using Kapt in combination with the Kotlin serialization plugin (and, very likely, with other plugins as well):
Kapt applied compiler plugins twice, causing errors similar to the one described in KT-65006
Kapt failed to generate @Metadata annotations for plugin-generated companion objects because the corresponding SLC missed containingFile needed for generation of method and class signatures

Merge-request: KT-MR-13970
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2024-01-23 20:35:32 +00:00
Vladimir Tagakov 06095e86ca jvm-abi-gen: remove SourceDebugExtension if no inline functions present
#KT-65072 Fixed
2024-01-22 19:00:10 +00:00
Nikolay Krasko 58fd558308 Remove flaky Kapt4ToolIntegrationTestGenerated test
The test is now very flaky and leads to java.lang.OutOfMemoryError

KTI-1559
2024-01-19 14:01:02 +00:00
Artem Kobzar 7568ee5a79 [K/JS] Add VOID optimization on object properties + align with the optimization the JS Plain Object plugin 2024-01-19 13:03:06 +00:00
Kirill Rakhman d74b5c59fb [kapt] Fix new compilation warnings after #KT-63208
(cherry picked from commit 9b4ebc31c1)
2024-01-18 08:27:10 +00:00
Artem Olkov 37a8723a79 KT-64931: add convertion of kotlin top-lvl functions into swift static functions
Merge-request: KT-MR-13878
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-01-17 20:30:04 +00:00
Rafał Galczak c7d4a7e1f1 Add support for serializing kotlin.time.Duration in Parcelize plugin.
This commit adds support for the Parcelize plugin to generate default
serialization implementation for the kotlin.time.Duration. As Parcelize
already supports serializing some of the kotlin library types it makes
sense to support more common ones for the user convenience.

https://issuetracker.google.com/issues/264614661
2024-01-17 11:24:26 +00:00
Artem Kobzar dfe2d8651e [K/JS] Prepare JS Plain Objects plugin to publication 2024-01-17 10:52:58 +00:00
Sergey.Shanshin 96d7dc4fa6 [KxSerialization] Fixed access private custom serializer on property
When a custom serializer is specified on a type and this type is used in a property of another serializable class, then on the JVM this leads to an error accessing the custom serializer class - because it is private and located in another package.

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/2495


Merge-request: KT-MR-12877
Merged-by: Sergei Shanshin <Sergey.Shanshin@jetbrains.com>
2024-01-16 20:04:17 +00:00
Vladimir Tagakov ad9c100137 Sort class members in jvm-abi-gen
#KT-64589 Fixed
2024-01-16 20:03:29 +00:00
Alexander Udalov 1a46b053f2 jvm-abi-gen: minor, refactor debug info and body removing visitors
Co-authored-by: Vladimir Tagakov <vtagakov@lyft.com>
2024-01-16 20:03:29 +00:00
Brian Norman eded51a0f5 [Parcelize] Detect redundant TypeParceler when type aliases are used
Make sure redundancies between class and property TypeParceler
annotations are detected when a type alias is used. This requires
checking the expanded type arguments of the annotation, as just
comparing the cone types is not sufficient because the type arguments
are not expanded.

^KT-64979 Fixed
2024-01-16 13:58:48 +00:00
Brian Norman 20340f94d4 [Parcelize] WriteWith Parceler type argument must be subtype of property
K2 checks that the entire Parceler of the WriteWith annotation is a
subtype of the expected Parceler for the property, while K1 only checks
that the type argument of the WriteWith Parceler is a subtype of the
property type. This mismatch leads to inconsistencies between K1 and K2
diagnostic reporting. Switch K2 to K1 behavior so diagnostics are
consistent.

^KT-60019 Fixed
2024-01-16 13:58:48 +00:00
Artem Olkov baa0748375 KT-64932: add support for no-package top level functions
Merge-request: KT-MR-13879
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-01-16 10:58:51 +00:00
Vladimir Sukharev 07938205bc [FIR][K/N] Get rid of SymbolInternals in FirObjCInterop 2024-01-16 09:39:16 +00:00
Sergej Jaskiewicz ad9f7bf90e [IR] Don't use the GET_PROPERTY origin on IrGetField expressions.
This origin was set somewhat arbitrarily.
It actually only makes sense for `IrCall`s to property getters.
There were no places in lowerings that checked `IrGetField` expressions
for this origin value.

^KT-62500 Fixed
2024-01-16 09:26:27 +00:00
Kirill Rakhman 77f83ce816 Revert "[kapt] Fix new compilation warnings after #KT-63208"
This reverts commit 9b4ebc31c1.
2024-01-16 09:14:18 +01:00
Sergej Jaskiewicz 2e6b7a3856 [atomicfu] Don't create Volatile's constructor for each call site
^KT-64971 Fixed
2024-01-15 17:28:22 +00:00
Kirill Rakhman 9b4ebc31c1 [kapt] Fix new compilation warnings after #KT-63208 2024-01-15 12:23:27 +00:00
strangepleasures 0dd3abba2a [KAPT] Support type annotations in K2 KAPT. Fixes KT-64479 2024-01-15 10:24:38 +00:00
strangepleasures 7e9d6e601d KT-64385 Enable K2 KAPT by default
Also adds support for front-end compiler plugins in Kapt
2024-01-15 10:22:32 +00:00
Sergey Bogolepov 591e98a947 [KT-63275] Generate wrapper bodies in the SwiftExportExtension 2024-01-12 15:06:18 +00:00
Sergey Bogolepov d54877be87 [KT-63275] Prepare SirAsSwiftSourcesPrinter for non-empty bodies 2024-01-12 15:06:18 +00:00
Brian Norman be728d4291 [Lombok] Constructor can have only non-static fields
When using the AllArgsConstructor annotation (directly or via
meta-annotation), only fields that are not static should be added as
arguments. Previously, all fields were being included regardless of
static-ness, which is not consistent with the behavior of Lombok.

^KT-54025 Fixed
2024-01-12 14:55:24 +00:00
Brian Norman 2ab1e712f8 [Lombok] Constructor can have only non-final or not initialized fields
When using the AllArgsConstructor annotation (directly or via
meta-annotation), only fields that are not final or not initialized
should be added as arguments. Previously, all fields were being included
regardless of modality or initialization, which is not consistent with
the behavior of Lombok.

^KT-54054 Fixed
2024-01-12 14:55:24 +00:00