Commit Graph

2940 Commits

Author SHA1 Message Date
Ilya Chernikov ec2d6ea5f1 Restore script testing on both backends, fix some tests 2021-12-14 13:39:19 +03:00
Ilya Chernikov 670575696f Remove forced old backend for script compilation, using common default 2021-12-14 13:39:19 +03:00
Ilya Chernikov 6d6de9dd76 Implement tests for script instance capturing in the host tests 2021-12-14 13:39:18 +03:00
Ilya Chernikov 10c5071eda Implement backend error reporting on unsupported script capturing
#KT-30616 fixed
#KT-43995 fixed
#KT-19424 fixed
#KT-49443 fixed
2021-12-14 13:39:17 +03:00
Steven Schäfer 4f3debdec6 [KAPT] Correct error types in annotations (KT-32596) 2021-12-14 11:31:25 +03:00
Ivan Kylchik b131c52889 Drop all usages of WITH_RUNTIME directive 2021-12-13 18:07:11 +03:00
Dmitry Petrov df460a842b JVM_IR KT-50076 avoid CHECKCAST on moved dispatch receiver parameter 2021-12-13 14:13:34 +00:00
Dmitry Petrov 6f148c594f Revert "JVM_IR KT-50076 avoid CHECKCAST on moved dispatch receiver parameter"
This reverts commit 627d838343.
2021-12-13 14:13:33 +00:00
mvicsokolova ff3abf9fc0 Set JS environments for kotlinx-atomicfu-runtime module (#4680) 2021-12-12 22:53:42 +03:00
Dmitry Petrov 627d838343 JVM_IR KT-50076 avoid CHECKCAST on moved dispatch receiver parameter 2021-12-11 08:04:26 +00:00
Alexander Udalov 3c9e3b7ed4 JVM IR: remove most dependencies of common backend.jvm code on codegen 2021-12-09 21:05:48 +01:00
Alexander Udalov b0c5ea4717 JVM IR: remove dependencies of lowerings on codegen
Move out utilities which are used both in lowerings and codegen to
JvmIrUtils and JvmIrTypeUtils, and introduce new JvmIrCoroutineUtils and
JvmIrInlineUtils (probably can be renamed or moved somewhere more
appropriate in the future).
2021-12-09 19:59:42 +01:00
Mikhael Bogdanov c599b58eb3 Remove obsolete options 2021-12-08 12:25:02 +01:00
Steven Schäfer 16a2aec296 Parcelize: Skip constructor checks when used with custom Parceler
See https://issuetracker.google.com/177850558
2021-12-08 11:07:10 +01:00
Steven Schäfer 58c687e42d Parcelize: Support @IgnoreOnParcel primary constructor parameters...
...with default values.

See https://issuetracker.google.com/177850560
2021-12-08 11:07:10 +01:00
Dmitriy Novozhilov 77101edfa4 [FIR] Setup tests for IC with compiler plugins
Most of those tests are ignored, because IC is not supported properly
  for compiler plugins. This commit is needed to prepare infrastructure,
  fix current behaviour and collect main problems of IC with plugins

Check fail.txt files in new testdata for explanation of problems
2021-12-03 14:17:41 +03:00
Dmitriy Novozhilov 11b9a6eed2 [FIR] Implement simple serializer like declaration generator
This generator is needed to test complex dependency between generated
  members and annotated classes in incremental compilation
2021-12-03 14:17:40 +03:00
Dmitriy Novozhilov 1d32d5c7d8 [FIR] Slightly reorganize directory structure of FIR plugin prototype 2021-12-03 14:17:38 +03:00
Dmitriy Novozhilov d585027431 [FIR] Rename tests of FIR plugin prototype 2021-12-03 14:17:36 +03:00
Dmitriy Novozhilov 86404b8027 [FIR] Implement IR body generators for all FIR declarations generators in plugin prototype 2021-12-03 14:17:34 +03:00
Dmitriy Novozhilov 974150a9d8 [FIR] Rename annotations in plugin prototype so they have meaningful names 2021-12-03 14:17:29 +03:00
Mikhael Bogdanov 0997207c7c Apply -Xjvm-default for specific modules only 2021-12-03 06:39:38 +01:00
Anastasiya Shadrina 37495bcba0 [FE] Change resolution scheme 2021-12-02 20:23:57 +03:00
Anastasiya Shadrina 3de1566f11 [Compiler plugins] Fix usage of descriptor API 2021-12-02 20:23:41 +03:00
Anastasiya Shadrina d923c95671 [FE] Add context receivers to scope 2021-12-02 20:23:22 +03:00
Anastasiya Shadrina a39fbd3822 [FE] Add getContextReceivers to CallableDescriptor interface 2021-12-02 20:23:17 +03:00
Steven Schäfer a5fa69b8ee jvm-abi-gen: use kotlinx-metadata 0.4.0 from maven
(cherry picked from commit f5e95444f82bb8e4be72dcef18da3a92277911e0)
2021-12-02 01:41:57 +01:00
mvicsokolova 93561a1a55 kotlinx.atomicfu compiler plugin for JS_IR backend (#4581)
* kotlinx.atomicfu compiler plugin for JS_IR

Support transformations of atomic operations introduced by the kotlinx.atomicfu library for the JS_IR backend. Compiler plugin is applied externally by the kotlinx.atomicfu gradle plugin.

* Apply compiler plugin for JS platform only

* New plugin test structure

* testGroupOutputDirPrefix changed
2021-12-01 22:33:13 +03:00
Steven Schäfer 05695761ec jvm-abi-gen: Add test to check the declaration order in interface jars 2021-12-01 19:20:47 +01:00
Steven Schäfer b8625cd233 jvm-abi-gen: Do not sort stripped methods and fields
The order is visible to annotation processors and should be considered
part of the ABI of a class.
2021-12-01 19:20:47 +01:00
Leonid Startsev de128a5406 kotlinx.serialization: Support @Serializable on sealed interfaces.
Interfaces (regular and sealed) are by default polymorphic. To benefit
from sealing (i.e. knowledge of all inheritors in compile-time), @Serializable
annotation may be added on sealed interface, generating the same serializer
that can be used for sealed classes.

Synthetic nested classes are not generated in DEFAULT_IMPLS mode because
it causes problems when adding a synthetic companion to an interface.

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1576
2021-12-01 14:14:47 +00:00
Dmitriy Novozhilov c46e9943cc [FIR] Get rid of FirExtension.key
In reality plugin key was used only in two ways:
- found corresponding generator for member scope of generated class
- pass it to declaration origin so it can be read in backend IR plugin

Because of first usage plugin key was required to be an object, which
  reduces functionality of second usage, because there was no way to
  pass any additional info via key to IR (in future this usecase will be
  covered with IR declaration attributes, but right now we don't have
  them)

So now generator which created some class is now saved in its attributes
  and plugins can use any keys they want. And since there is no other
  usages of `FirExtension.key` it removed from FirExtension API at all
2021-11-30 12:57:53 +03:00
Dmitriy Novozhilov ce218b8a0b [FIR] Make FirExtensionRegistrar a proper extension point
After that commit it's allowed to register any FIR plugin using
  existing extension infrastructure (`-Xplugin` CLI argument,
  plugin.xml for IDE plugins, etc)
2021-11-30 12:57:50 +03:00
Ilya Muradyan 6917ff7d2a [scripting] Move earlierScripts to the frontend descriptor
^KT-20488 fixed
2021-11-30 09:11:59 +03:00
Dmitriy Novozhilov 98934e15c0 [Build] Fix dependency on JUnit in :pill:generate-all-tests 2021-11-26 11:26:22 +03:00
Nikolay Krasko 4e806a6322 Bump junit-bom in our project 5.7.0 -> 5.8.1 and clean up old versions 2021-11-24 19:35:35 +03:00
pyos 001ddda935 IR/Android: place the cache field first
to avoid NPEs if it is used during instance initialization.
2021-11-23 13:39:11 +01:00
Dmitriy Novozhilov ae967ec31b [FIR] Fix detecting version of plugin annotations if it differs from 1.6.255-SNAPSHOT 2021-11-23 15:01:36 +03:00
Dmitriy Novozhilov edb62e247f [FIR] Drop redundant class from fir plugin annotations module 2021-11-23 15:01:35 +03:00
Dmitriy Novozhilov 2d0bbf6e4b [FIR] Fix build configuration for tests in :fir-plugin-prototype 2021-11-23 15:01:34 +03:00
Dmitriy Novozhilov 409f96678a [Parcelize] Extract common names, class ids and FQNs into separate object 2021-11-23 15:01:33 +03:00
Dmitriy Novozhilov edc74b8838 [Parcelize] Add test for Parcelable implementation with overriden describeContents 2021-11-23 15:01:33 +03:00
Dmitriy Novozhilov 8cdddbfd9d [FIR] Implement checkers for FIR parcelize plugin
There is one of checks left unimplemented (FirParcelizePropertyChecker.checkParcelableClassProperty)
  because it requires huge commonization of detecting which type can be
  serialized and which not, which is not prioritized job for now
2021-11-23 15:01:31 +03:00
Dmitriy Novozhilov eac9a9fc79 [FIR] Implement FIR version of parcelize plugin
This commit includes only generation of declarations and
  ir backend part, checkers are added in separate commit
2021-11-23 15:01:29 +03:00
Dmitriy Novozhilov cb0705ec03 [FIR] Change scheme of generating declarations by plugins
Methods `needToGenerateAdditionalMembersInClass` and
  `needToGenerateNestedClassifiersInClass` are removed, now compiler
  uses `get...Names` and `getTopLevel...` methods to determine which
  extension may generate declaration with specific classId/callableId

This is needed to simplify API of FirDeclarationGenerationExtension and
  provide guarantee that `generate...` method will be called with
  specific classId/callableId only if specific extensions returned name
  for this id from `getName...` functions
2021-11-23 15:01:28 +03:00
Dmitriy Novozhilov 40d8451698 Add compiler diagnostic tests for parcelize checkers 2021-11-23 15:01:26 +03:00
Dmitriy Novozhilov b84ee64994 Move parcelize checkers testdata to :parcelize-compiler module 2021-11-23 15:01:23 +03:00
Dmitriy Novozhilov a093052b77 Delete sources of parcelize IDE plugin
They are moved to intellij community repo, so those sources in kotlin
  repository are actually redundant
2021-11-23 15:01:22 +03:00
Dmitriy Novozhilov 9948ba57c0 [FIR] Add ability to generate companion object from compiler plugin 2021-11-23 15:01:15 +03:00
Dmitriy Novozhilov 93378b1a04 [FE 1.0] Resolve private constructors of sealed classes same as for regular classes
^KT-44866
^KT-49729
2021-11-18 13:54:05 +03:00