Commit Graph

124 Commits

Author SHA1 Message Date
Yan Zhulanow 34d1611ed4 Add Pill support to compiler and IDE modules 2018-03-02 03:15:17 +03:00
Alexander Udalov 97314d010d Serialize default argument values presence for actual declarations correctly
When default argument value was present in the expected declaration, we
did not correctly serialize that fact to the metadata for the actual
declaration (`declaresDefaultValue` was used). Therefore, it was
impossible to use that actual declaration without passing all parameter
values in another module, where it was seen as a deserialized descriptor

 #KT-21913
2018-02-08 14:11:57 +01:00
Alexander Udalov 6da3f37fc3 Write anonymousObjectOriginName for classes copied during inline
#KT-21320
2018-02-06 13:05:22 +01:00
Mikhail Zarechenskiy 915455ebe9 Introduce InlineClasses language feature
Allow to write `inline` modifier in front of class declaration
2018-02-05 12:07:38 +03:00
Alexander Udalov 82574cb570 Do not store ClassDescriptor in EnumValue
Only store the ClassId of the enum class and the Name of the entry, and
resolve the needed descriptor in getType() instead, which now takes the
module instance where that descriptor should be resolved
2018-01-18 12:49:38 +01:00
Denis Zharkov 1702775738 Introduce JavaClassesSerializerExtension
It will be used to track java classes changes for incremental compilation

 #KT-17621 In Progress
2017-12-12 16:17:58 +03:00
Alexander Udalov 02981038f3 Split core into descriptors, descriptors.jvm, deserialization, descriptors.runtime 2017-11-10 18:58:31 +01:00
Alexander Udalov f2be34ca1c Support KClass<*> annotation arguments in serialization/deserialization
#KT-11586 Fixed
2017-10-23 19:16:44 +02:00
Dmitry Savvinov 175d23155e Effects: add (de)serialization of contracts in metadata
- Introduce new definitions in descriptors.proto
- Add new corresponding values in Flags.java
- Introduce ContractSerializer and ContractDeserializer, responsible for
for conversion ContractDescription <-> ProtoBuf.Contract
- Add dependency of 'serialization' module on 'resolution' so that it
could see contracts model.

Note that here we do a lot of seemingly unnecessary hoops, which in fact
necessary to respect existing module system (in particular, to be able
to extract ContractDescription declarations from 'descriptors' module to
make them invisible from reflection)

==========
Effect System introduction: 8/18
2017-10-11 13:34:54 +03:00
Alexander Udalov 00c846a160 Write patch version for VersionRequirement correctly 2017-10-10 13:21:50 +02:00
Alexander Udalov 6f2e6db131 Check the RequireKotlin annotation value
Similarly to SinceKotlin
2017-10-10 13:21:50 +02:00
Alexander Udalov a96861c353 Support version kind for RequireKotlin
#KT-20584 Fixed
2017-10-10 13:21:49 +02:00
Alexander Udalov 4532f7556c Introduce internal RequireKotlin annotation 2017-10-10 13:19:18 +02:00
Alexander Udalov 8962911503 Rename SinceKotlinInfo -> VersionRequirement 2017-10-10 13:19:18 +02:00
Alexander Podkhalyuzin 3f8170d369 Clean idea files generated on the gradle import, add them to .gitignore 2017-09-19 23:58:27 +02:00
Ilya Chernikov 27968c8e13 Set proper jvmTarget for projects 2017-09-19 21:37:27 +02:00
Ilya Chernikov deda50dbbb Continue switching projects to improved dsl: sourceSets and test running 2017-09-19 21:37:26 +02:00
Ilya Chernikov 61dfb75e0e Implement Gradle Kotlin DSL build 2017-09-19 21:37:06 +02:00
Stanislav Erokhin c8ee424f67 Rename isHeader to isExpect in descriptors 2017-09-15 18:25:41 +03:00
Alexander Udalov cc7ed2ba54 Change map key type in AnnotationDescriptor.getAllValueArguments
Turns out, only the parameter's name is needed at all usages of this
method. Such a map is both easier to use (no need to call
ValueParameterDescriptor.getName) and easier to construct (no need to
resolve annotation class, its constructor, its parameters). In this
commit, only usages have changed but the implementations are still using
the old logic, this is going to be refactored in subsequent commits
2017-07-20 13:25:39 +03:00
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