Commit Graph

3314 Commits

Author SHA1 Message Date
Leonid Startsev 0b3d9ffa71 Replace ad-hoc .newRef() with .toFirResolvedTypeRef() 2022-08-19 14:42:35 +00:00
Leonid Startsev dc7ba5d22b Remove module-wide ObsoleteDescriptorApi opt-in
and remove access to .descriptor whenever possible
2022-08-19 14:42:34 +00:00
Leonid Startsev 783087a551 Add tests for value classes serialization
apparently they're already working in FIR
2022-08-19 14:42:33 +00:00
Leonid Startsev 89a8bdc0f6 Support enum serialization in FIR
for all runtime versions, re-enable optimization in IR backend
by correctly determining presence of functions in runtime.
2022-08-19 14:42:32 +00:00
Leonid Startsev 472aca1491 Tests for sealed & abstract serializable classes in FIR 2022-08-19 14:42:31 +00:00
Leonid Startsev 6b32ce76c2 Support serializable objects in FIR plugin 2022-08-19 14:42:30 +00:00
Dmitriy Novozhilov 7390d8cd54 [Build] Add reflect to runtime classpath of kotlinx.serialization tests
This is needed to be able to run those tests with JPS build
2022-08-19 14:42:28 +00:00
Leonid Startsev edff4d43bf Generate writeSelf and load constructor even if they were not created by frontend
which is true in case for FIR which discourages purely synthetic declarations.
2022-08-19 14:42:27 +00:00
Leonid Startsev acd6180c30 Support generic classes in serialization FIR plugin 2022-08-19 14:42:26 +00:00
Alexander Udalov 45abea5b0a Use platform class loader in 'kotlin' runner on JDK 9+
#KT-46312 Fixed
2022-08-17 22:23:10 +02:00
Sergey.Shanshin 2cb6483e8a Added inspection for duplicating serial names in enumeration entries
Resolves Kotlin/kotlinx.serialization#1852
2022-08-17 20:17:22 +00:00
Leonid Startsev c1191e141b Re-generate copyright in obsolete tests in kotlinx.serialization 2022-08-17 15:02:38 +02:00
Leonid Startsev 18ec5d4ec1 Add additional check to IrClass.findEnumValuesMethod()
to avoid finding user-defined member function
2022-08-17 11:43:41 +00:00
Leonid Startsev 6893e210fb [K2] Remove typeWithStarProjections in favor of constructStarProjectedType 2022-08-17 11:43:40 +00:00
Leonid Startsev 638665d9b0 Refactor typeWithStarProjections() so it uses FirClassSymbol instead of FirClass
It removes necessity to access .fir in plugins
2022-08-17 11:43:40 +00:00
Leonid Startsev b17ead97bc Fix incorrect class reference in polymorphic and contextual case
Upper bound should be used for type parameters there
2022-08-17 11:43:39 +00:00
Leonid Startsev 6a6b542ae2 Extract predicates to separate file, apply other review suggestions 2022-08-17 11:43:38 +00:00
Leonid Startsev a4b35c5810 Refactor most of the new code, split huge GeneratorHelpers.kt appropriately 2022-08-17 11:43:37 +00:00
Leonid Startsev c1b0ad418b Activate MetaSerializable test and update serialization dependency 2022-08-17 11:43:37 +00:00
Leonid Startsev b0716fe725 Adapt IR serialization plugin so it works both with FIR and old FE
(except some places that are not currently supported by FIR part of plugin)
2022-08-17 11:43:36 +00:00
Leonid Startsev 89329a0e1b Introduce @FirIncompatiblePluginApi 2022-08-17 11:43:35 +00:00
Leonid Startsev 467ff30aac Support full pipeline for basic kotlinx.serialization case:
FIR frontend and IR backend plugins.

Note: IR plugin is now broken for old FE, fixed in subsequent commits
2022-08-17 11:43:34 +00:00
Leonid Startsev cefc372632 Remove BindingContext, KotlinType and *Descriptor from IR plugin dependencies 2022-08-17 11:43:34 +00:00
Leonid Startsev 6f6342dafc Prototype of kotlinx.serialization FIR plugin:
Implement basic non-parameterized case
2022-08-17 11:43:33 +00:00
Mikhail Glukhikh 7333589663 K1/K2: add Enum.entries unconditionally and filter them out in tower
Before this commit, we added Enum.entries only in case when
LanguageFeature.EnumEntries was ON (with an exception in K1/Java case).
In this commit we add Enum.entries unconditionally, and in case
the language feature is OFF we filter them out during tower resolve.
2022-08-12 09:35:27 +00:00
Dmitriy Novozhilov fd4aafdb75 [Lombok K2] Support @Builder and @Singular annotations
^KT-46959 Fixed
2022-08-11 15:22:36 +03:00
Dmitriy Novozhilov b32f9dcac2 [Lombok K1] Support @Singular annotation
^KT-46959
2022-08-11 15:22:35 +03:00
Dmitriy Novozhilov b311f0b862 [Lombok K1] Support @Builder annotation
^KT-46959
2022-08-11 15:22:35 +03:00
Dmitriy Novozhilov 6fde784b55 [FE 1.0] Allow generation of nested classes for java classes from plugins 2022-08-11 15:22:35 +03:00
Dmitry Gridin 4ceb170917 regenerate tests 2022-08-05 14:12:41 +02:00
Sergey.Shanshin 7a8c864c5c Added serialization support for unsigned arrays as built-in 2022-08-05 10:09:56 +00:00
Sergey.Shanshin c538189501 Added serialization support for the kotlin.Nothing class as built-in 2022-08-05 10:08:39 +00:00
Sergey.Shanshin c2bdd51658 Added diagnostic for external serializers
Relates Kotlin/kotlinx.serialization#532
2022-08-05 09:31:58 +00:00
Dmitriy Novozhilov 70da19bd22 [Lombok K2] Fix name convention for @With on boolean fields
^KT-53451 Fixed
^KT-53370
2022-08-03 13:46:24 +03:00
Dmitriy Novozhilov 11f8e776af [Lombok K2] Fix generating @With methods for final fields
^KT-53370
2022-08-03 13:46:24 +03:00
Dmitriy Novozhilov 637d7678b8 [Lombok K1] Fix name convention for @With on boolean fields
^KT-53370 Fixed
2022-08-03 13:46:24 +03:00
Steven Schäfer 58e51919bd Parcelize: Add missing FIR diagnostics 2022-07-26 09:34:10 +00:00
Steven Schäfer d4aa303acb Parcelize: Avoid KotlinTypeMapper in ParcelizeDeclarationChecker 2022-07-26 09:34:10 +00:00
Mikhail Glukhikh eba0e94429 K2: get rid of manual diagnostic suppression in checkers 2022-07-22 11:35:28 +00:00
Ilya Chernikov ceea563d63 Scripting: avoid creating multiple PSIs for every imported script
#KT-53009 fixed
#KT-42810 should be possible now too, but more testing is needed
#KT-42101 can also be addressed now, but first the serialization
 of the imported scripts property should be solved
2022-07-21 13:53:41 +00:00
Yahor Berdnikau b28819a186 Enable signing for publication into Gradle plugin portal
^KT-53172 Fixed
2022-07-21 11:52:46 +02:00
Dmitriy Novozhilov af8caae387 [KAPT] Fix formatting 2022-07-20 10:12:25 +00:00
Dmitriy Novozhilov 8b960de76a [KAPT] Add additional test tasks for running tests on JDK 11 2022-07-20 10:12:24 +00:00
Dmitriy Novozhilov 9c41e75802 [KAPT] Migrate kapt tests to new test infrastructure 2022-07-20 10:12:24 +00:00
Dmitriy Novozhilov fdf1b8b1c0 [KAPT] Migrate tests in kapt3-base and kapt3-cli to JUnit 5 2022-07-20 10:12:24 +00:00
Dmitriy Novozhilov c249eb9d2d [Build] Specify lombok dependency version in versions.properties 2022-07-20 10:12:22 +00:00
Alexander Udalov bd0fe2f146 Remove dependency of compiler tests on fir2ir tests
Compiler tests use the old test infrastructure, but fir2ir tests use the
new one (tests-common-new). Removing this dependency means that now the
two big modules, `:compiler:compileTestKotlin` and
`:compiler:tests-common-new:compileTestKotlin` can be compiled in
parallel, which improves the total build time.
2022-07-18 13:13:01 +02:00
mvicsokolova 6c6717da5a Revert renaming the kotlinx-atomicfu-runtime module 2022-07-07 00:37:06 +02:00
Nikolay Krasko 5b8a4ccd56 Use cache-redirector for downloading in parcelize tests
There's a flaky failures when
~/.m2/repository/org/robolectric/android-all/5.0.2_r3-robolectric-r0/android-all-5.0.2_r3-robolectric-r0.jar
is partially downloaded during tests execution.
This led to Parcelize tests failure with:

Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
 at java.util.zip.ZipFile.read(Native Method)
 at java.util.zip.ZipFile.access$1400(ZipFile.java:60)
 at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:734)
 at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:434)
 at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
 at java.io.FilterInputStream.read(FilterInputStream.java:133)
 at java.io.FilterInputStream.read(FilterInputStream.java:107)
 at org.robolectric.util.Util.copy(Util.java:21)
 at org.robolectric.util.Util.readBytes(Util.java:38)
 at org.robolectric.internal.bytecode.SandboxClassLoader.getByteCode(SandboxClassLoader.java:166)
... 36 more

Option used was found at https://github.com/robolectric/robolectric/blob/7697d1217c5eb0dee454004efe60ba219f398255/plugins/maven-dependency-resolver/src/main/java/org/robolectric/MavenRoboSettings.java#L19

^KTI-842 Fixed
2022-07-01 18:44:48 +00:00
Ilya Chernikov 513f490502 Scripting: notify writer in REPL on errors reporting complete
required for restoring compatibility with IDE REPL usages (scratch
files included), since IDE counterpart needs a reliable signal
when the processing of the REPL snippet/command is completed
2022-07-01 10:14:42 +00:00