Commit Graph

251 Commits

Author SHA1 Message Date
Dmitriy Novozhilov d1fd1da56f Rename Visibility to DescriptorVisibility 2020-09-04 11:07:42 +03:00
Leonid Startsev c881347110 Use correct return type for constructor call when creating EnumDescriptor
Previous one was converted using obsolete API, which caused unbound symbols to appear.

#KT-41321 Fixed
2020-09-02 13:22:23 +03:00
Leonid Startsev 8b0bb430e7 Fix multiple serialization plugin problems
Do not use fallback serializer if it is the same (fixes
https://github.com/Kotlin/kotlinx.serialization/issues/957).

Use correct number of serializable KClasses when creating sealed class
serializer (fixes https://github.com/Kotlin/kotlinx.serialization/issues/925).
2020-09-02 13:22:23 +03:00
Dmitriy Novozhilov a764732020 Rename KotlinBuiltInsNames to StandardNames 2020-08-25 10:41:33 +03:00
Dmitriy Novozhilov 7a7fe77b8e Move static constants with builtin names to :core:descriptors.common module 2020-08-25 10:31:36 +03:00
Yunir Salimzyanov 27b2e16141 Cleanup as36 patchset files (KTI-315) 2020-08-19 19:40:00 +03:00
Alexander Udalov a810dbb41b IR: fix compiler warnings 2020-08-18 10:33:25 +02:00
Alexander Udalov 256f4449ce IR: annotate obsolete API in IrPluginContext with ObsoleteDescriptorBasedAPI 2020-08-17 21:18:19 +02:00
Alexander Udalov bcf1ee3907 Minor, fix test data for kotlinx.serialization bytecode text test 2020-08-11 15:14:06 +02:00
Mads Ager 7f2efabe6a [JVM_IR]: Improve stepping for when.
Additionally, use the line number of the class for default interface
dispatch methods.
2020-08-07 09:16:01 +02:00
Leonid Startsev 96d0b1c47a Update serialization runtime and fix test data
Revert "Mute/ignore 'PROVIDED_RUNTIME_TOO_LOW' in tests"
2020-07-29 14:20:33 +03:00
Alexander Udalov 4892737cc9 Use IrFactory in kotlin-serialization-compiler 2020-07-28 19:04:44 +02:00
Alexander Udalov cce55f1609 IR: add module ir.tree.impl, move main IR implementation there 2020-07-28 19:04:44 +02:00
Leonid Startsev e3f42721e9 Mute/ignore 'PROVIDED_RUNTIME_TOO_LOW' in tests 2020-07-21 15:10:08 +03:00
Leonid Startsev df5f38fec8 Implement reading kx.serialization runtime metadata from jar manifest
That allows to check whether current compiler plugin can work with
a given runtime version. Implementation-Version can help to detect whether
runtime version is too low, and Require-Kotlin-Version detects whether
runtime version is too high.

Corresponding diagnostic for Require-Kotlin included.
Implement minimal runtime version check for kotlinx.serialization
plugin.

 #KT-40036 Fixed

Cache result from getVersionsForCurrentModule in BindingTrace.
Hide check in the IDE, because caching in trace does not work there.
2020-07-21 15:10:08 +03:00
Leonid Startsev 7db0bf8195 Add new serialization runtime packages
encoding and descriptors. Rename ContextSerializer to Contextual.
Unify getClassFrom*Package functions.
2020-07-21 15:02:06 +03:00
Georgy Bronnikov c901e82a55 IR: add IrSimpleFunction.isInfix 2020-07-18 11:03:33 +03:00
Alexander Udalov e674226a3b IR: do not use Ir*Impl elements where it's not necessary 2020-07-10 16:17:06 +02:00
Alexander Udalov ef94716af5 IR: remove deprecated constructor of IrFieldImpl 2020-07-09 18:51:04 +02:00
Alexander Udalov 7f9ef5e11d IR: remove deprecated constructors of IrFunctionImpl 2020-07-09 18:51:04 +02:00
Alexander Udalov fd83596c91 IR: remove deprecated constructor of IrTypeParameterImpl 2020-07-09 18:51:03 +02:00
Alexander Udalov 0691595ed2 IR: remove deprecated constructor of IrValueParameterImpl 2020-07-09 18:51:03 +02:00
Alexander Udalov d8a2b92098 IR: remove deprecated constructors of IrPropertyImpl 2020-07-09 18:51:02 +02:00
Dmitry Gridin 1c4d7c5772 Regenerate test data 2020-07-09 18:37:37 +07:00
Leonid Startsev 340deb01dd Add 'Incorrect Transient' diagnostic
when users write @Transient, they get @kotlin.jvm.Transient, because it's always in auto-import.
This annotation does not work with @Serializable classes; @kotlinx.serialization.Transient should be used instead.

Add quickfix for 'incorrect transient' diagnostic:
'Import kotlinx.serialization.Transient'
2020-07-08 20:17:11 +03:00
Leonid Startsev 6ef597a4ee Split ContextualSerialization annotation in two 2020-07-08 20:15:56 +03:00
Leonid Startsev 80561ec125 Update kx.serialization dependency
so tests won't fail due to
'library was compiled with pre-release flag' error.

Update test data
2020-07-07 01:14:32 +03:00
Alexander Udalov d4605f5816 IR: add type parameter to IrMemberAccessExpression and some subclasses
This is needed to get rid of the diamond hierarchy:

                 IrMemberAccessExpression
                 /                       \
                /                         \
IrFunctionAccessExpression     IrCallableReference
                \                      /
                 \                    /
                   IrFunctionReference

In the subsequent commit, IrFunctionReference no longer inherits from
IrFunctionAccessExpression; the more precise type of `val symbol:
IrFunctionSymbol` is now carried via the generic type argument.

This will help to refactor IR element hierarchy from interfaces to
classes, improving performance of visitors and transformers.
2020-07-01 13:03:56 +02:00
Leonid Startsev 6ea0c37e52 Update test data with new package name after 901d8f3e7a 2020-06-29 15:09:30 +03:00
Leonid Startsev 901d8f3e7a Rename several core entities as a part of kx.serialization abi change 2020-06-26 20:31:23 +03:00
Leonid Startsev 5208bbcd21 Support new ContextSerializer signature 2020-06-26 20:31:22 +03:00
Mikhail Bogdanov 929bb0e8d1 Move common logic from CodegenTestCase to KotlinBaseTest 2020-06-19 11:57:36 +02:00
Ilya Muradyan 8c2baf0704 Add missing definitelyDoesNotContainName methods 2020-06-18 09:51:16 +02:00
Mikhail Glukhikh 175e94c0aa Revert kotlinx-serialization-compiler-plugin OptIn dependency 2020-06-16 19:17:18 +03:00
Mikhail Glukhikh ab5cb13dae Rename: DescriptorBasedIr -> ObsoleteDescriptorBasedAPI 2020-06-16 19:17:14 +03:00
Mikhail Glukhikh cbbb497edf Make descriptor-based API in ir:tree more granular 2020-06-16 19:17:12 +03:00
Mikhail Glukhikh 1c2fbb61fe [IR] Introduce & use declaration-based SymbolTable.withReferenceScope 2020-06-16 19:17:04 +03:00
Vyacheslav Gerasimov 4aa3040550 Build: Use runtimeOnly instead of deprecated runtime
maven-publish plugin uses `runtimeOnly` for runtime scope instead of
`runtime`
2020-06-14 20:31:26 +03:00
Mads Ager dc34d355bc [JVM_IR] Generate line numbers and nops for init blocks.
This seems to be what JVM does and it allows you to set a
breakpoint on the init line.
2020-06-10 08:05:52 +02:00
Dmitry Gridin 3fdf048e51 Regenerate Serialization* tests 2020-06-05 17:13:28 +07:00
Yunir Salimzyanov 7ab7ca5ff0 Cleanup as35 extension files (KTI-240) 2020-06-01 18:43:10 +03:00
Leonid Startsev 1d589e3f56 Rework access to properties in IR plugin
use accessors instead of fields whenever possible
2020-06-01 17:48:17 +03:00
Leonid Startsev 7c8c5b057f Extensible mechanism for plugin metadata during descriptor serialization
A mechanism that allows kotlinx.serialization plugin to preserve the
correct (program) order of properties after serializing/deserializing
descriptors to kotlin metadata, which is needed for correct and stable
json serialization of class hierarchies in incremental/multi-module scenario.
It uses protobuf extensions.
2020-06-01 17:48:16 +03:00
Vyacheslav Gerasimov af2dce0549 as41: Build against AS 4.1 C10 2020-05-27 18:46:57 +03:00
Mikhail Glukhikh 03f2c6d38a [IR] Unbind construction methods of IrFieldImpl from symbol.descriptor 2020-05-25 15:40:36 +03:00
Mikhail Glukhikh ab15a88ce4 [IR] Unbind construction methods of IrPropertyImpl from symbol.descriptor 2020-05-25 15:40:36 +03:00
Mikhail Glukhikh 262548fd5b [IR] Unbind construction methods of IrFunctionImpl from symbol.descriptor 2020-05-25 15:40:36 +03:00
Roman Artemev 6bdd473eff [JVM IR] Fix plugin API for JVM IR
- Unmute ktx.serialization test
2020-05-12 14:29:55 +03:00
Roman Artemev 1949b11bb2 [KTX.SERIALIZATION] Refactor plugin once again 2020-05-12 14:29:54 +03:00
Mikhail Bogdanov 639af69185 Minor. Fix test data 2020-04-29 12:54:47 +02:00