Commit Graph

1938 Commits

Author SHA1 Message Date
Georgy Bronnikov 1ed23d7c54 IR: reorganize IrProvider handling
Make DeclarationStubGenerator a subclass of IrProvider,
anticipating deserialization of IR structures for JVM_IR backend.
2019-11-27 20:02:27 +03:00
Kevin Bierhoff e8252ea874 handle kotlin shifts like bitwise binary ops 2019-11-27 12:42:31 +03:00
Natalia Selezneva 07b6dadbf0 Scripting: move additional classpath to the end of script classpath (KT-34626)
Do not add duplicated entries
Original script dependencies should go first
2019-11-27 11:08:44 +03:00
Nicolay Mitropolsky 3d1061ee3c Uast: KotlinUMethodWithFakeLightDelegate 183-related fixes 2019-11-26 19:42:30 +03:00
Nicolay Mitropolsky c5fb51bd85 191: Uast: KotlinUMethod compilation fix 2019-11-26 19:42:29 +03:00
Leonid Startsev 19c28c55c5 Allow serialization plugin to work with inline types which are primitives (e.g. Char in JS IR) 2019-11-26 19:34:49 +03:00
Leonid Startsev 3d2800f99b Move out symbols that do not depend on a BackendContext to a separate BuiltinSymbolsBase class.
The goal was to be able to use such symbols before BackendContext is even created – in psi2ir postprocessing step (i.e., IR compiler plugins).

Remove old code from serialization ir plugin.
2019-11-26 15:26:35 +03:00
Leonid Startsev 3e18350a1f Rewrite IR plugin infrastructure (and serialization plugin) so it won't emit LazyIR.
LazyIR was emitted because plugin was not able to declare symbols, only to reference them.
Moreover, declarations added by frontend plugin were also unbound symbols produced by psi2ir,
and declaration stub generator was stubbing them with LazyIR – therefore access to global symbol table is not enough for plugins. IrProvider won't help here, because some functions produced by plugin have circular dependencies.

By moving compiler plugins step between psi2ir and declaration stub generator, both problems are resolved
– unbound symbols produced by psi2ir and compiler plugins are declared where they would be declared if this was a user code,
and only unbound symbols left are external dependencies, which is a correct input for lazy ir.
2019-11-26 15:26:28 +03:00
Nicolay Mitropolsky e4d0d450ab Uast: keeping annotations from sources in non-light-methods backed UMethods (KT-27806) 2019-11-26 15:13:40 +03:00
Nicolay Mitropolsky 833571d8b2 Uast: tests for suspend and DeprecationLevel.HIDDEN functions appears in Uast tree (KT-27806, KT-32031) 2019-11-26 15:13:40 +03:00
Nicolay Mitropolsky 2772659ed2 Uast: Uast produces reified methods on his own because light-classes doesn't (KT-34316) 2019-11-26 15:13:40 +03:00
Nicolay Mitropolsky 9c18df61ca Uast: KotlinUMethod and KotlinUAnnotationMethod are separated (KT-30489) 2019-11-26 15:13:40 +03:00
Mikhail Zarechenskiy eb73650209 Fix race in IDE: inject proper storage manager for type parameters
With NO_LOCKS strategy we can easily end up in a situation when
 constraint system for a generic call is built incorrectly,
 producing flaky errors (or don't produce errors at all)

 Now proper storage manager is injected for all cases except:
 - IR
 - Codegen
 - Serialization plugin
 - Fake local objects

 Most likely, NO_LOCKS strategy for these cases is fine as at that point
 the compiler works in one thread

 #KT-34786 Fixed
2019-11-26 10:52:45 +03:00
Leonid Startsev b9ac1341ff Export generic serializer constructor from JS module
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/609
2019-11-25 20:06:15 +03:00
Leonid Startsev 73b9d2466a Do not report 'Missing @Serializable on enum with @SerialInfo' if enum
has custom serializer

#KT-34991 Fixed
2019-11-25 20:06:14 +03:00
Kevin Bierhoff 0285b26e40 make FunctionCodegen skip method bodies we don't need, which avoids problems with inlining methods inside methods we don't need
KT-33604
2019-11-22 12:54:42 +03:00
Natalia Selezneva ca71b2fe90 Add script configuration dependencies to script classpath
It was missing during configuration refinement thought new scripting API and during loading script configuration on Gradle project import

Do not pass additional classpath to configuration classpath: this may only affects Gradle with New scripting API (because it isn't used from other places)
In additional classpath kotlin-compiler and kotlin-stdlib was passed and there is no needs for this during loading Script Definitions through new scripting API

^KT-34626 Fixed
2019-11-22 11:43:34 +03:00
Natalia Selezneva 72ef43f462 Show filePattern in settings for new script definitions if present 2019-11-22 11:43:32 +03:00
Ivan Gavrilovic d269c194c7 Fix java version parsing in KAPT
Handle case when "java.version" returns
"11" or "12". Previously, we expected it to
contain at least one dot in the version string.
2019-11-22 16:06:35 +09:00
Ivan Gavrilovic f4c6f57354 KT-34194: Pass error/NonExistentClass for incremental KAPT run
When running KAPT incrementally, make sure to pass error/NonExistentClass.java
when there is at least one source file to process. This is to make sure
APs that must resolve all types are able to do so.

Test: updated KaptIncrementalWithAggregating/WithIsolating
2019-11-22 16:06:34 +09:00
Alexander Udalov e4afbae954 Minor, fix test data for kotlinx.serialization bytecode text test 2019-11-21 16:44:30 +01:00
Alexander Udalov 608449f41d IR: introduce StubGeneratorExtensions for ExternalDependenciesGenerator
This is a refactoring to simplify the API of
ExternalDependenciesGenerator and to constrain future additions of
platform-specific stub generator extensions.
2019-11-20 15:16:57 +01:00
Anatoly Nikitin 81e2e119e2 Fix propagation of dependency resolution failure reports during script compilation 2019-11-14 08:38:50 +01:00
Roman Artemev 63110ab636 [IR] Remove deprecated correspondingProperty from IrField 2019-11-12 20:45:11 +03:00
Roman Artemev ed79ab68ab [IR] Remove DeclarationDescriptor from IrExpression* tree API 2019-11-12 20:45:11 +03:00
Roman Artemev b391c066d6 [IR] Pass class Type Parameters into IrConstructorCall factory explicitly
to avoid unexpected crash on uninitialized parent in psi2ir phase
2019-11-12 20:45:11 +03:00
Roman Artemev ba373c67d7 [IR] Remove FunctionDescriptor from IrCall-like node's constructor interface 2019-11-12 20:45:11 +03:00
Alexander Udalov 57a674e9e6 Make fast class files reading mode default in compiler tests
This makes sense because this mode is the default in the production
compiler. Forgetting to enable it where necessary led to different
bizarre test failures, see for example changes around 3fee84b966 and
KT-34826
2019-11-11 15:40:49 +01:00
Alexander Udalov ce09be3f59 Add TargetBackend.isIR, simplify JVM IR test configuration 2019-11-11 12:10:29 +01:00
Georgy Bronnikov 688a2185fa Tests for Kapt3 with JVM_IR backend 2019-11-07 13:28:09 +03:00
Nikolay Krasko c50e60f90f More mutes for 193 branch
One more test for KT-34689.
2019-11-05 20:13:30 +03:00
Alexander Udalov efaf779133 Minor, fix test data for kotlinx.serialization bytecode text test 2019-11-04 16:17:58 +01:00
Georgy Bronnikov 51459adb8c Add integration test for Kapt3+IR 2019-11-04 11:26:45 +03:00
Georgy Bronnikov 195f225e36 Run Kapt3 with old backend, even if IR is specified in configuration
Kapt does not currently work with IR backend. Temporarily switch to the
old JVM backend when running it.
2019-11-04 11:26:45 +03:00
Vyacheslav Gerasimov 3b088818a5 Build: Add sources and javadocs to Kotlin Plugin publication 2019-11-01 16:22:42 +03:00
Ilya Chernikov 9aaf08de08 Fix equality for the KtFileScriptSource 2019-10-29 20:44:18 +01:00
Alexander Udalov cf61957e3c Minor, fix kotlinx-serialization bytecode test data
After some changes to the JVM IR backend
2019-10-25 11:23:11 +02:00
Vyacheslav Gerasimov b1d7df697d Build: Add dependency on gradle plugin to android-extensions-idea module 2019-10-24 21:01:27 +03:00
Vyacheslav Gerasimov 38ea5a85a3 Build: Add maven publication for Kotlin plugin artifacts 2019-10-24 17:06:19 +03:00
Ivan Gavrilovic 68723125f2 Clean up KAPT incremental tests
Remove redundant class to invalidate sources, because it is already
handled in the KaptContext constructor.
2019-10-24 21:33:01 +09:00
Yan Zhulanow 7fc25a9c04 Pill: Add GenerateRuntimeDescriptorTests to the "Generate all tests" run configuration (KT-34494) 2019-10-24 21:33:01 +09:00
Yan Zhulanow 6bf15b6d37 Kapt: Generate constant value initializers for mutable properties (KT-30164, KT-29355) 2019-10-24 21:33:01 +09:00
Yan Zhulanow 9edd4554a9 Kapt: Support @Deprecated annotations (KT-30368) 2019-10-24 21:33:01 +09:00
Yan Zhulanow f93549748a Fix a number of compiler/IDE warnings in IDE and kapt modules 2019-10-24 21:32:57 +09:00
Nikolay Krasko 4ed64b0283 Regenerate tests with TargetBackend.ANY remove and using runTest with this 2019-10-23 12:49:48 +03:00
Nikolay Krasko 2c0ce40f75 Refactoring: extract test dummy traces 2019-10-23 12:49:47 +03:00
Leonid Startsev e89aabbba1 Provide a diagnostic when @Serializable annotation is missing on enum.
It is required when enum members contain some special annotations which should be recorded in descriptor.
Due to some recursive/lazy resolve problems, compiler plugin frontend can't infer @Serializable on enum automatically, therefore, we ask a user to explicitly provide it.

Also fix ir tests
2019-10-21 19:48:29 +03:00
Leonid Startsev 3c9a02e271 Associate serializers added via @UseSerializers by argument class, not type
Use class instead of type because MyType<T> and MyType<Int> are different types, therefore map lookup was failing.

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/533
2019-10-21 19:48:27 +03:00
Leonid Startsev 855a867893 Support sealed, generic and abstract polymorphic inheritors in sealed class serialization 2019-10-21 19:48:26 +03:00
Leonid Startsev 1ebc65b8e4 Sealed classes serialization 2019-10-21 19:48:26 +03:00