Commit Graph

1978 Commits

Author SHA1 Message Date
Dmitriy Novozhilov 5cb7cf040a Update some testdata according switching compiler to 1.4 2020-01-20 16:41:46 +03:00
Leonid Startsev 137c500e3a Support SerializerFactory in Native
kotlinx.serialization plugin now adds additional function to companions
of generic classes in order to overcome lack of reflection. This
helps retrieving generic serializers from KType.
2020-01-20 13:16:17 +03:00
Yan Zhulanow 520f9a6da5 Kapt: Support all kinds of constant types (KT-35536) 2020-01-20 17:39:22 +09:00
Nikolay Krasko f01b4706d1 Switch to 193 platform 2020-01-19 12:01:53 +03:00
Mikhail Zarechenskiy 39e0f101b1 Add dependency because some SAM related classes moved to core module 2020-01-17 19:37:48 +03:00
Mikhail Zarechenskiy 0fdebdfeba Refactoring: move SamConversionResolverImpl to core module 2020-01-17 19:36:07 +03:00
Mikhail Zarechenskiy c93c82236c Refactoring: move common parts about SAMs to frontend module 2020-01-17 19:36:06 +03:00
Michael Kuzmin e8a821986f Build: drop IntelliJ 2018.3 support (KT-35374)
Delete references in code
2020-01-17 18:20:38 +03:00
Dmitriy Novozhilov 76b3964e96 Update testdata according to change compiler version to 1.4 2020-01-17 10:33:50 +03:00
Alexander Udalov c3d5a88e52 Add -Xno-use-ir to compiler modules where JVM IR currently fails
This option has no effect on the production code. But in a custom
scenario of a local bootstrap, where the compiler is replaced with the
one where JVM IR backend is enabled by default, this option allows to
switch back to the old backend.

All of these arguments (except the one for compiling experimental
coroutines) are supposed to go away as soon as we fix related problems
in the JVM IR backend.
2020-01-16 12:21:47 +01:00
Igor Yakovlev fb56e14654 Fix UAST method NPE for incomplete method PSI
Fixed #KT-35871
2020-01-15 13:14:41 +03:00
Leonid Startsev 9bd966c123 Supply correct Native platform for module descriptor while compiling from CLI 2020-01-15 12:48:49 +03:00
Leonid Startsev f2026a49bb Support .decodeSequentially call on JVM and Native and remove READ_ALL handling from all platforms
Fix codegen test

Ignore JVM IR codegen test for a while since it requires updated kotlinx-serialization-runtime in classpath
2020-01-15 12:46:25 +03:00
Nicolay Mitropolsky ed57a53ad6 191: Uast: fix compilation for 191 2020-01-15 11:40:47 +03:00
Nicolay Mitropolsky 54285d328f Uast: KotlinIDERenderLogTest for running UAST tests with ULC
In case of result difference the `-ide`-suffixed testdata is used.
Actually the difference in results is more likely to be a bug
but currently we are fixating at least some behaviour to protect from
 unexpected regressions in Ultra Light Classes.

`object Local` were removed because there is no local objects in actual
 Kotlin syntax
2020-01-14 19:48:40 +03:00
Nicolay Mitropolsky 23c2a5c830 Uast: fake light method for uast is created only when containing class exists (KT-35310, EA-219604) 2020-01-10 12:46:37 +03:00
Ilya Chernikov 995c6a32b8 Allow only single expression eval in cli compiler and kotlin runner
#KT-35740 fixed
also add tests and drop logger usage in the cli dependencies manager:
the logger is normally unitialized in the usage scenarios, but related
warnings are annoying.
2020-01-09 10:51:25 +01:00
Nicolay Mitropolsky ed4e73c8e9 Uast: the returnType support for light methods for reified functions (KT-35610) 2020-01-09 11:55:22 +03:00
Nicolay Mitropolsky c04ba009e6 Uast: properly handling annotations on destructured variables (KT-35673, EA-220128) 2020-01-09 11:55:22 +03:00
Alexander Udalov 8a4510c21b Regenerate tests 2020-01-02 10:31:00 +01:00
Nikolay Krasko 70067bc9bf Better fix for compiler plugin test initialization
The previous one didn't work in 191.
Also revert changes in tests-common module.
2019-12-30 13:22:34 +03:00
Vyacheslav Gerasimov 7b1c4e72ba Build: Fix android-wizardTemplate-plugin dependencies
Present only in AS 3.6
2019-12-26 16:25:12 +03:00
Vyacheslav Gerasimov 68f1d91e1b as40: Upgrade to AS 4.0 C7 2019-12-25 20:19:36 +03:00
Nikolay Krasko 70ff3d36d0 Fix running tests in compiler plugins 2019-12-25 14:05:16 +03:00
Svyatoslav Kuzmich 31c84e9ac4 [JS IR] Build stdlib using compiler from repo
Previously JS IR versions of stdlib and kotlin-test were build
by default using compiler previously built on a buildserver.

It had some issues:
 - This required us to advance bootstrap every time we made any
   incompatible IR changes. This happens often since IR ABI is
   not quite stable yet.

 - We never tested the exact combination of compiler and stdlib we publish

   We tested:
    - new compiler with new stdlib build by new compiler (in box tests)
    - old compiler with new stdlib build by old compiler (in stdlib tests)

   We published:
    - new compiler with new stdlib build by old compiler

After this change JS IR compiler tests, builds and publishes
single configuration:

    new compiler with new stdlib build by new compiler

JS IR stdlib and kotlin-test are now built using JavaExec of CLI instead
of Gradle plugin to avoid troubles of loading a freshly built plugin.

This also allows to have a granular dependencies: we don't rebuild klib
if we changed a lowering in a compiler backend, but we do rebuild it if
we changed IR serialization algorithm.
2019-12-25 13:44:57 +03:00
Ivan Gavrilovic eab6864269 KT-35536: Fix enum constants in KAPT
Enum constants are Pair, so make sure to unpack them correctly.
2019-12-24 15:14:47 +09:00
Michael Kuzmin 254dc8f71c Build: Drop IntelliJ 2018.3 and Android Studio 3.4 support
Delete *.183 and *.as34 bunch-files
2019-12-19 18:31:07 +03:00
Dmitriy Novozhilov e7f8c8e155 [TEST] Regenerate tests after previous commit 2019-12-12 16:11:45 +03:00
Mikhael Bogdanov 8225c5a9ce Remove obsolete logic to IS_BUILT_WITH_ASM6 2019-12-11 13:49:34 +01:00
Ilya Chernikov 354be2b14f [minor] Change expression evaluation cli argument to -Xexpression 2019-12-11 12:20:49 +01:00
Pavel Kirpichenkov 3de6289c6c [NI] Run completion on subatoms of error calls
Call transformer previously ran completion of argument atoms
only for non-error candidates. This led to missing diagnostics,
i.e. from collection literal resolver.

Now arguments of calls resolved to error descriptor are completed,
with exception to not found provideDelegate calls.
provideDelegate's subatoms are not completed after failure, because
it is a part of delegate competion, which does not end with
unresolved provideDelegate.
Completing after provideDelegate failure removes constraint system
from resolved arguments, which breaks resolve for get/setValue.

^KT-33592 Fixed
2019-12-03 18:19:32 +03:00
Alexander Udalov fd627603a0 Refactor CompilationErrorHandler
It only had one implementation THROW_EXCEPTION, inline it everywhere
with a call to a static method
2019-12-03 10:48:34 +01:00
Ilya Chernikov 3cae90dd26 [minor] fix source root creation from imported scripts:
make the usages of KotlinSourceRoot consistent everywhere
2019-12-02 16:46:55 +01:00
Ilya Chernikov f2a4a835e7 Improve script cli diagnostics 2019-12-02 16:46:55 +01:00
Ilya Chernikov 531ff92791 Implement support for expression evaluation in jvm cli compiler 2019-12-02 16:46:54 +01:00
Ilya Chernikov b8034567ef Change script definition lookup key from File to ScriptSource
to make it more generic and allow easier implementation fo the
non-file based scripts.
2019-12-02 16:46:54 +01:00
Ilya Chernikov 4439582d23 Remove unnecessary update of the source roots, simplify interface accordingly
The update became unnecessary after the packagePartProvider fix above.
2019-12-02 16:46:53 +01:00
Ilya Chernikov a190ab260e Load main-kts jar automatically from scripting plugin, if available 2019-12-02 16:46:52 +01:00
Nicolay Mitropolsky bfa6bd1396 Uast: buildLightMethodFake provides proper containing class and parent 2019-11-29 12:28:02 +03:00
Nicolay Mitropolsky c06f737519 Uast: SimpleKotlinRenderLogTest.testBitwise UMethod testdata fix 2019-11-28 11:41:00 +03:00
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