Commit Graph

3252 Commits

Author SHA1 Message Date
Yan Zhulanow 6b198fd85f [Pill] Support 'java-test-fixtures' plugin 2022-11-11 11:28:33 +00:00
Yan Zhulanow 47b5ea0fc7 [Pill] Fix unit test running 2022-11-11 11:28:33 +00:00
Yan Zhulanow 8e494ceb99 [Pill] Update default run configurations 2022-11-11 11:28:32 +00:00
Leonid Startsev 474ef921d8 Use standard @Deprecated in place of special opt-in annotation
Remove @DeprecatedVisitor
2022-11-10 13:30:10 +00:00
Leonid Startsev 471882b743 Introduce @DeprecatedVisitor; mark up visitor-related declarations with it.
Provide convenient JVM writing API.

Get rid of ExperimentalUnsignedTypes.
2022-11-10 13:30:09 +00:00
Sergey.Shanshin af4308e634 Fixed replacing serializer origin for generated classes
Do not use plugin origin for user-written classes that have @Serializer annotation for some reason. Plugin origin makes them synthetic which is incorrect because they're available in source code. Example of such class: @Serializer(JsonElement::class) class JsonElementSerializer

Merge-request: KT-MR-7627
Merged-by: Sergey Shanshin <Sergey.Shanshin@jetbrains.com>
2022-11-09 17:11:40 +00:00
Alexander Korepanov d5e9e87538 [JS BE] Drop JS scripting support
JS scripting uses the old IR to JS transformer.
 The new IR to JS transformer can not be used for
 JS scripting out of the box. Patching the new transformer for
 JS scripting is potentially dangerous and requires a lot of effort.
 Dropping JS scripting and the old IR to JS transformer allows to
 refactor and simplify JS BE codebase.
2022-11-04 14:15:15 +00:00
pyos a30d19b655 jvm-abi-gen: consider private type aliases to be public API
They can be referenced from public declarations right now.

^KT-54500 Fixed
2022-10-31 22:13:21 +01:00
Pavel Mikhailovskii 1215ae0fe7 KT-1436 Nicer compiler errors when the feature isn't supported 2022-10-31 13:49:57 +00:00
Ilya Chernikov 5d968bc2f4 Fix gradle scripts detection in the sources
#KT-54325 fixed
2022-10-31 09:30:13 +00:00
Sergey.Shanshin d4cfb002d0 Added support of named companion in serializable class to the FIR
Merge-request: KT-MR-7472
2022-10-27 12:48:29 +00:00
pyos b23de16b06 FIR Parcelize: register the error message factory 2022-10-27 10:19:21 +03:00
mvicsokolova 6a4e9f1d0f Atomicfu JVM IR: fixed visibility modifiers of generated declarations, should be private.
Fix for: https://github.com/Kotlin/kotlinx-atomicfu/issues/258
2022-10-26 12:59:25 +00:00
Alexander Udalov c813e03c1e Kapt+JVM_IR: do not generate nested enum as final
#KT-54187 Fixed
2022-10-24 12:48:22 +00:00
Ilya Chernikov b50a803b6f Make jdk root processing more robust
#KT-54337 fixed
2022-10-21 06:11:42 +00:00
Leonid Startsev 4cf50d7d23 Add checker for companion objects inside serializable class:
Warning for old FE, error in FIR

#KT-54441 Fixed

Merged-by: Leonid Startsev <leonid.startsev@jetbrains.com>
2022-10-20 10:18:04 +00:00
Dmitriy Dolovov 15635482aa [IR] Partial linkage: Enable it by just passing a boolean flag to IR linker constructor 2022-10-19 13:46:22 +00:00
Dmitriy Novozhilov 8fbb605034 [FIR] Rename containingClass function to containingClassLookupTag
Since this function returns lookup tag instead of FirClass or symbol
  the old name may lead to misunderstanding
2022-10-19 11:09:34 +00:00
Dmitriy Novozhilov 0eb34983cb [Assign plugin] Fix experimentality warning message 2022-10-19 11:09:33 +00:00
Ilya Chernikov 6627b62c21 Fix sources extraction when processing extension is on
The latter is used e.g. for scripts in source roots handling
as implemented in the commit
"Scripting: update scripts in source roots handling"
The former implementation did not covered all the cases.

#KT-54355 fixed
2022-10-18 16:29:06 +00:00
Leonid Startsev f1b1837f40 Rework SerialInfo$Impl annotation implementation to be available in FIR:
- IR plugin does not use it anymore,
regular annotation instantiation feature is used
(insertion of IrConstructorCall(annotationCtorSymbol)).

- IR plugin still generates `SerialInfo$Impl` class to be compatible
with previously compiled code & libraries.

- Custom implementation over descriptors in IR plugin is removed;
plugin now delegates to the existing lowering with some tweaks.

- $Impl descriptor is removed from FE 1.0 because it is no longer needed
for IR plugin; it shouldn't be exposed to users so FIR doesn't need it either.

- Since language lowering is now used, it is possible to correctly instantiate
SerialInfo annotations with default values even if they are from other modules
and even if they were not processed by the plugin.

#KT-48733 Fixed
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1574
2022-10-17 16:10:42 +00:00
Leonid Startsev 242b83edbd Prioritize @Serializable annotation on type usage over class usage
In `val p: @Serializable(X) Foo` and `@Serializable(Y) class Foo` situation,
now X would be chosen as serializer.

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1895
2022-10-14 14:15:37 +00:00
Sergey.Shanshin 5a1c2c56bd Added support of external serializers to the FIR
Co-authored-by: Leonid Startsev <leonid.startsev@jetbrains.com>
Merge-request: KT-MR-7334
Merged-by: Sergey Shanshin <Sergey.Shanshin@jetbrains.com>
2022-10-13 15:25:39 +00:00
Sergey.Shanshin 503f4d924d Added support of MetaSerializable to the FIR 2022-10-12 20:10:58 +00:00
Nikolay Krasko f43ad1cb7a Remove packed stdlib from Kotlin compiler plugin artefacts
Remove annotations, kotlin-stdlib-common, kotlin-stdlib.

Packing those libraries is wrong and probably unexpected. It leads to
artifacts size increase. Can be dangerous because of bad classpath.
And also have a reproducibility issue because of caching tricks around
KotlinVersionCurrentValue class.

KTI-942
2022-10-12 13:44:30 +00:00
Leonid Startsev 090aec6b3b Prohibit Array<T> in @Serializable classes
because it's impossible to correctly create array reflectively without
knowing correct KClass.

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1243
2022-10-12 11:48:21 +00:00
Leonid Startsev 596949a501 Correctly handle star projections according to logic of the old FE.
#KT-54297 Fixed

Properly substitute surrogate UnitSerializer in the Companion.serializer()
function generated on classes that use polymorphic or sealed serializer
by default. (Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1692)
2022-10-12 10:36:26 +00:00
Leonid Startsev 2a626b27d3 Correctly determine the type of serializable property
when supertype of serializable class is generic and also serializable,
and contains the property with type with its generic parameter.

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1264
#KT-43910 Fixed
#KT-49660 Fixed
2022-10-12 10:34:53 +00:00
Daniel Santiago 189be2b117 [KAPT] Setup KaptJavaLog writers during initialization.
Migrate KaptJavaLog to not used deprecated constructor in newer JDKs and instead set up the writers during initialization. This enables us to get rid of KaptJavaLog17.

Fixes KT-54030
2022-10-11 23:48:18 +02:00
Sergey.Shanshin f4845b8dd9 Marked write$Self and $serializer from serialization as synthetic 2022-10-11 17:05:03 +00:00
Ilya Muradyan 7f6bd2ab1e Fix compatibility issue for kotlin.jupyter 2022-10-08 04:02:39 +02:00
mvicsokolova cb23dbb492 atomicfu-compiler-plugin: support declaration of properties in objects for JVM IR
Fix: https://github.com/Kotlin/kotlinx-atomicfu/issues/241
Merge-request: KT-MR-6871
Merged-by: Maria Sokolova <maria.sokolova@jetbrains.com>
2022-10-07 17:10:41 +00:00
pyos 8d33de4297 JVM: partially reify typeOf and signatures as soon as possible
E.g. when substituting T -> Array<T>, write the bytecode for the
Array<...> part for typeOf.

This fixes various issues where either Array nesting levels, nullability
information (for typeOf), or entire reification markers were missing,
causing incorrect outputs ranging from missing `?`s to missing `[]`s to
just reified types not really being reified.

^KT-53761 Fixed
2022-10-06 00:58:25 +02:00
Dmitriy Novozhilov c543a2e6d5 [Assign plugin] Publish embeddable version of assign plugin 2022-10-04 19:47:34 +00:00
Simon Ogorodnik 0fea8073ef Scripting Plugin. Update CoreFileTypeRegistry under lock
CoreFileTypeRegistry isn't thread-safe, so it should be updated under
application lock, to avoid concurrently mutating underlying structure
2022-10-03 13:36:06 +00:00
Leonid Startsev a20ce06102 Support @Serializable(ContextualSerializer) on class
It was fixed some time ago (https://github.com/Kotlin/kotlinx.serialization/issues/957)
but for some reason only for old backend.

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1776
2022-09-28 12:40:20 +00:00
pyos 72e671c8f1 FIR Parcelize: allow anonymous local objects if they're enum entries 2022-09-28 15:14:25 +03:00
Nicklas Ansman Giertz b02948b5f7 KAPT: Kapt generates illegal stubs for private interface methods
Interface methods that were private got both the `default` and `private`
modifiers when using `jvm-default=all` which is not valid.

The stub will now just contain `private` in this case.

This fixes KT-48013.
2022-09-26 12:21:56 +02:00
Dmitriy Novozhilov 7ce3934cf7 [FIR] Add type resolution service into SerializationFirSupertypesExtension
This service allows resolve custom user types from plugins, which allows
  to support specifying type arguments of generated supertypes basing
  on arguments passed to annotations
2022-09-26 10:09:09 +00:00
Sergey.Shanshin 9210108d5a Added test on Serializable(with=...) in K2 2022-09-23 11:56:19 +00:00
Nikolay Krasko 1630386712 Move to JDK_X_Y variables 2022-09-21 22:53:19 +00:00
Ilya Goncharov d203dc35bf [JS IR] Add to IR keep possibility similar to legacy-dce one
It helps to:

- keep declarations even if they are not reachable and not exported
- not minify names of not exported declarations

Compiler argument: -Xir-keep=A,B

Can be used for top-level declarations or for member

^KT-54118 fixed
2022-09-20 16:06:17 +00:00
Dmitriy Novozhilov 367761008b [Lombok] Make FQNs of Guava collections shade-safe
^KT-53683
2022-09-20 11:08:30 +03:00
Dmitriy Novozhilov b1d42e1383 [Lombok] Update incorrect testdata according to KT-53965 2022-09-20 10:38:00 +03:00
Dmitriy Novozhilov 111dab7a88 [Lombok] Fix test configuration 2022-09-20 10:37:59 +03:00
Leonid Startsev c8647841dc Added documentation for MagicApiIntrinsics.voidMagicApiCall
Remove mavenLocal() from repos
2022-09-16 14:34:30 +00:00
Leonid Startsev 69c00785f2 Support plugin-defined instrinsics that can be non-typeOf operation types. 2022-09-16 14:34:30 +00:00
Leonid Startsev 033538161e Determine more precise conditions when to enable serialization intrinsic
Disable it if we do not have required `noCompiledSerializer` function in
runtime. Leave it enabled in tests.

Rollback some changes for old backend as it is unsupported now.
2022-09-16 14:34:30 +00:00
Leonid Startsev 637e8c7d8a Provide feature-flag to disable intrinsics in serialization plugin 2022-09-16 14:34:29 +00:00
Leonid Startsev ad2adadb36 Remove OperationType.PLUGIN_DEFINED type:
instead, plugins should emit the code similar to the TYPE_OF one with
a special call to MagicApiIntrinsics.voidMagicApiCall directly afterwards.

This is required because old compiler need to correctly inline code
rewritten by plugin.
2022-09-16 14:34:29 +00:00