There was no place in bytecode where annotations on properties without backing
fields could be stored to. Now they're written on a synthetic empty void method
with a special name ("propertyName$annotations").
(Annotations on properties cannot simply be written on getters in bytecode,
since a getter can have annotations of its own.)
Instead of storing a string with the signature, write the name, return type and
parameter types separately, reusing the name table. Refactor the name table to
allow it to store not only names of Kotlin entities, but also arbitrary names
and fq-names
KotlinInfo annotation now has a version() field, which should be equal to the
compiler's JvmAbi.VERSION in order for this class to properly load and be used.
Create ErrorReporter class, which has a trace to which it can report errors
(now only related to ABI version). This is done because a dependency of
DeserializedDescriptorResolver from BindingTrace would be confusing.
Implementation of ErrorReporter will probably need to change when we untie
deserialization from java-resolve.
Check if PsiClass is actually a compiled class before trying to load serialized
data from it: otherwise it can be a Java source, as was in wrongAbiVersion()
test, and ASM will fail when trying to read that file. Rewrite the test so that
it now has a compiled Kotlin classes to check against (also include sources to
recompile this binary data later, although it won't probably be needed)
This is done because byte arrays in annotation arguments cannot be longer than
65535 bytes, and serialized data's length for kotlin.KotlinPackage class from
stdlib is already close to this number
Make 'Callable' message of descriptors.proto extensible, extend it in
java_descriptors.proto with a JVM signature of the member. This is needed in
order for annotation deserializer to find out which member in the compiled
bytecode corresponds to which descriptor in the hierarchy.
Create a new module 'serialization.java' containing everything related to
Java-specific serialization of descriptors.
Add an extension point to DescriptorSerializer, allowing to perform
platform-specific serialization on a callable
JavaNamespaceDescriptor creates DeserializedPackageMemberScope in case there is *Package class present for a particular package (other cases work as before)
A new special CallableKind for properties created for objects --
OBJECT_PROPERTY.
Also fix PropertyPsiData.isFinal() in case of properties backed by fields
- get rid of DescriptorNamer, always use descriptor.getName() instead
- delete AbstractClassResolver.getClassObjectName(), always use
"<class-object-for-...>", except for the case of built-ins serialization
(class object names should be replaced by "object" when writing files with
serialized data for built-ins)
- delete NestedClassResolver.resolveClassObject(), always use the other method
of this class instead
Name table is now also stored in data, before the serialized class.
ClassData is now public, since it's used in plenty of places as a holder of
deserialized protobuf classes.
KT-3760 Internal compiler error with Java interoperability and ElasticSearch 0.90.2 (IllegalStateException, Type parameter descriptor in not initialized: T declared in ...)
#KT-3760 Fixed
EA-44150 Type parameter descriptor in not initialized. Fixed