Commit Graph

104 Commits

Author SHA1 Message Date
Alexander Udalov 1273ac9647 Remove dependency of module 'descriptors' on 'deserialization' 2017-06-06 14:29:21 +03:00
Alexander Udalov 7f73e9f4f7 Improve hack in BuiltInsSerializerExtension for ranges
Serialize class names as qualified names in the string table, not as
simple strings. Otherwise NameResolverImpl crashes on deserialization
because it expects that all class names are indices into QualifiedName
table
2017-05-22 18:17:48 +03:00
Pavel V. Talanov 55a0e138fc Refactor: extract AnnotationDescriptor.annotationClass utility 2017-05-02 15:40:20 +03:00
Alexander Udalov db1f039586 Serialize and deserialize 'header' modifier for descriptors
This fixes KT-17001 because now 'header' modifier is loaded correctly
for deserialized members and the standard disambiguation in
OverloadingConflictResolver.compareCallsByUsedArguments takes place,
where header members are discriminated against the corresponding impl
members

 #KT-17001 Fixed
2017-03-27 19:50:25 +03:00
Alexander Udalov 7c22113c34 Refactor serialization of package FQ name extension
Instead of requiring to pass it in SerializerExtensionBase's
constructor, pass it always in serializePackage. This is more
straightforward and helps in a situation where one SerializerExtension
instance is used for the whole module, not one per-package
2017-03-06 11:03:24 +03:00
Alexander Udalov b52b90c182 Extract serialization of packageFqName extension to SerializerExtensionBase 2017-03-03 13:33:51 +03:00
Stanislav Erokhin a4272caa8c Fix serialization for suspend function types.
Since now `suspend (Int) -> String` will be serialized as `(Int, Continuation<String>) -> Any?` + suspend flag.

Before this change such type serialized like this: Function2<Int, String> + suspend flag. And yes, type `Function2<Int, String>` isn't correct, because Function2 expect 3 type arguments.
We have special logic for this case and we deserialize such error-written types correctly.

(cherry picked from commit 3518cbe)
2017-02-02 16:48:59 +03:00
Alexander Udalov f1cd2ee6fd Introduce PropertyDescriptor.isDelegated, write new flag to metadata
#KT-8384 In Progress
2017-01-23 12:25:34 +03:00
Alexander Udalov e3f4b6e77e Do not allow to use suspend functions in 1.0.6+ 2017-01-13 11:53:52 +03:00
Alexander Udalov 7107ee2eeb Write/load subclasses of sealed classes in metadata
Note that now DeserializedClassDescriptor.getSealedSubclasses works a lot
faster than before, for all newly compiled sealed classes except empty ones. It
may be optimized further if we look at the metadata version of the file the
class was loaded from, however it's not easy currently because
DeserializedClassDescriptor is declared in common (non-JVM) code and has no
direct access to the binary version information.

This will also allow to add a reflection API to get subclasses of a sealed
class

 #KT-12795 Fixed
2017-01-10 12:23:26 +03:00
Dmitry Petrov 80bd916f5d 'SuspendFunction$n' should not be visible in member scopes (should be unresolved).
'SuspendFunction$n' class descriptors are created on demand by KotlinBuiltIns (and cached).
On serialization, types constructed with 'SuspendFunction$n' are written as 'Function$n' with extra flag (SUSPEND_TYPE).
On deserialization, corresponding 'SuspendFunction$n' classes are used.
2016-12-15 23:58:05 +03:00
Stanislav Erokhin 42440f50dc Remove soft keyword coroutine & isCoroutine from ValueParameterDescriptor. 2016-12-15 23:57:56 +03:00
Alexey Andreev e6501591fa JS: serialize type of local anonymous class as its denotable supertype. See KT-14888 2016-12-15 19:05:32 +03:00
Alexander Udalov 5c1adb1258 Serialize SinceKotlinInfo and SinceKotlinInfoTable 2016-12-15 11:46:17 +03:00
Alexey Andreev 7a6b510ddb Include external modifier to serialized descriptors for classes and properties 2016-12-08 15:41:40 +03:00
Alexander Udalov 1d71c19b42 Serialize .kotlin_metadata binary files per source file
Do not serialize everything in the same package to the same file (as is done
for built-ins) because this approach is unfriendly to incremental compilation,
which is going to be supported in the future. Instead, similarly to JVM
serialize each class to its own file, and each source file with top-level
callables/typealiases to its own file.

E.g. if a file named test.kt contains a class Foo and some
functions/properties, the output will contain two files: TestKt.kotlin_metadata
and Foo.kotlin_metadata. Each one of this files contains the serialized
BuiltIns message (see builtins.proto)
2016-11-25 20:50:10 +03:00
Alexander Udalov 9e9c548ca3 Minor, print more debug info on serializing error annotation 2016-11-11 19:00:07 +03:00
Alexey Andreev 7dbada0d06 JS: repair serialization of type aliases 2016-09-19 12:30:32 +03:00
Denis Zharkov d53c53a900 Support annotations on type aliases declarations 2016-06-28 10:33:29 +03:00
Mikhael Bogdanov db5d9940df Added 'isInline' implementation to property accessor descriptors 2016-06-24 17:05:48 +03:00
Alexander Udalov 7e38b93d80 Use protobuf with renamed packages, pack to IDEA plugin
Update GenerateProtoBuf.kt to also regexp-replace com.google.protobuf with
org.jetbrains.kotlin.protobuf in generated Java sources

 #KT-12581 Fixed
2016-06-14 14:17:22 +03:00
Stanislav Erokhin 53bf720503 Fix type alias problems after rebase. 2016-06-09 16:42:41 +03:00
Alexander Udalov 0c0a451d20 J2K serialization: fix compilation and prettify 2016-06-09 15:54:49 +03:00
Alexander Udalov 6692aca5f3 J2K serialization: invoke automatic J2K conversion 2016-06-09 15:54:49 +03:00
Alexander Udalov 89c0af0d80 J2K serialization: move .java -> .kt 2016-06-09 15:54:49 +03:00
Stanislav Erokhin 797ef8d143 Refactoring. Removed all usages of asSimpleType except related to TypeSubstitution. 2016-06-09 12:58:05 +03:00
Stanislav Erokhin 1d9ca06b96 Remake KotlinTypes. 2016-06-09 12:57:59 +03:00
Stanislav Erokhin a5c1e009c3 Remove type capability AbbreviatedType. 2016-06-09 12:57:55 +03:00
Stanislav Erokhin 1eaefa7fed Refactoring. Remove type capability Flexibility. 2016-06-09 12:57:50 +03:00
Stanislav Erokhin 669558c4ba Refactoring. Move flexible type factory to deserialization module. 2016-06-09 12:57:48 +03:00
Denis Zharkov 329fb9d619 Introduce 'coroutine'/'suspend' modifiers 2016-06-08 18:53:16 +03:00
Dmitry Petrov 0319d5a5aa KT-11588 Type aliases
- Nested type aliases
- UNSUPPORTED_TYPEALIAS error (language level < 1.1)
- tests for is/as/as? with type alias
2016-06-01 14:32:46 +03:00
Dmitry Petrov 32f61c3918 KT-11588 Type aliases
Deserialization
2016-05-20 14:17:25 +03:00
Dmitry Petrov 65293008fd KT-11588 Type aliases
Type alias descriptor serialization
Types with type aliases serialization
2016-05-20 14:17:24 +03:00
Alexey Tsvetkov f2ca788ea3 Serialize error type to proto when generating stubs 2016-05-11 20:41:48 +03:00
Stanislav Erokhin 0a4ad3f267 Refactoring. Rename FlexibleTypeCapabilities -> FlexibleTypeFactory. Also use factory.create instead of DelegatingFlexibleType.create. 2016-04-25 15:28:46 +03:00
Denis Zharkov d7e035fd9b Serialize annotations on type parameters in builtins 2016-01-22 19:17:22 +03:00
Alexander Udalov 0b7d2e3a68 Do not write old callable proto flags, use only new ones 2016-01-22 05:51:14 +03:00
Alexander Udalov 693a9c9453 Write new flags to proto messages for callables
This is needed to get rid of two unused bits: Flags.RESERVED_1 and
Flags.RESERVED_2. The old flags are still there temporarily because of the
bootstrap dependency on built-ins. Soon the old flags will be dropped and the
current flags will be transformed to the new format
2016-01-19 18:39:59 +03:00
Alexander Udalov a4daa08e5c Write module name as proto extension instead of another annotation argument 2016-01-19 18:39:59 +03:00
Dmitry Jemerov 117a0d8b7b compiler: cleanup 'public', property access syntax 2016-01-07 17:57:38 +01:00
Ilya Gorbunov b71b336a69 Fix fq names of moved facade classes in imports and other code occurrences 2015-12-29 18:04:13 +03:00
Alexander Udalov fc74759231 Drop old enum entries from binary format 2015-12-25 20:16:18 +03:00
Alexander Udalov 7592f31596 Serialize built-ins to separate file .kotlin_builtins 2015-12-25 20:16:18 +03:00
Alexander Udalov 3e2eb8c1a0 Serialize/deserialize annotations on enum entries
#KT-10338 Fixed
2015-12-13 03:52:41 +03:00
Pavel V. Talanov 6164566cad Extract duplicate logic between javascript and builtins serialization/deserialization 2015-12-09 18:51:27 +03:00
Pavel V. Talanov e458534c93 Write package_fq_name to for Package message when serializing builtins 2015-12-09 18:51:24 +03:00
Denis Zharkov 7500447e72 Implement serialization of inner types 2015-11-13 14:59:03 +03:00
Denis Zharkov c9aa75259b Introduce ClassDescriptor.declaredTypeParameters
Should be a subset of type constructor's parameters
2015-11-13 14:47:28 +03:00
Stanislav Erokhin 0b5de434fa Removed usages KtScope.getAllDescriptors 2015-11-04 12:41:34 +03:00