Commit Graph

13 Commits

Author SHA1 Message Date
Yan Zhulanow ef698a5747 Fix "PSI/index mismatch" in case of @ParameterName on non-functional types (KT-34524) 2020-05-27 02:38:41 +09:00
Roman Golyshev d7667209b2 KT-37144 Respect quotes in package name during decompilation
- Odd package names (for example `try` in `arrow-core`) were pasted
as-is to the decompiled text
- Because of this, stub checks were failing, forcing completion to start
over and over again, as if something changed in the files
- See EA-5572315 for the error
- ^KT-37144 Fixed
2020-04-13 07:34:28 +00:00
Alexander Podkhalyuzin 5bb74d9840 Fixed generated text from jvm classfile, when quotes is required
#KT-34759 Fixed
2020-03-11 15:41:41 +03:00
Alexander Udalov 965e3ebab2 Do not serialize SOURCE-retained annotations
Also, fix the value of "hasAnnotations" flag to reflect if there are any
_non-source_ annotations on a declaration.

Unfortunately, after this change
IncrementalJsCompilerRunnerTestGenerated$PureKotlin.testAnnotations
starts to fail because of the following problem. The problem is that
annotations on property accessors are not serialized yet on JS (see
KT-14529), yet property proto message has setterFlags field which has
the hasAnnotations flag. Upon the full rebuild of the code in that test,
we correctly write hasAnnotations = true, but annotations themselves are
not serialized. After an incremental build, we deserialize property
setter descriptor, observe its Annotations object which happens to be an
instance of NonEmptyDeserializedAnnotationsWithPossibleTargets. Now,
because annotations itself are not serialized, that Annotations object
has no annotations, yet its isEmpty always returns false (see the code).
Everything worked correctly before the change because in
DescriptorSerializer.hasAnnotations, we used Annotations.isEmpty and the
result was the same in the full rebuild and in the incremental scenario.
But now we're actually loading annotations, to determine their
retention, and that's why the setterFlags are becoming different here
and the test fails

 #KT-23360 Fixed
2018-04-23 18:42:33 +02:00
Alexander Udalov 71fe8c02a3 Fix rendering of type aliases
- render 'actual' modifier if it's present
- do not render a space after type parameter list
2018-02-05 13:38:06 +01:00
Alexander Udalov b5fef84e9c Update tests on decompiled text for JS
Because .kjsm files now contain all declarations from the package (contrary to
the JVM decompiler which produces one file for one class/package facade), some
common decompiled text tests started to behave differently on JVM and JS.
Update two of them (Modifiers, ClassWithClassObject) to make results the same,
copy another (TypeAliases) to JVM-/JS-specific tests with different outputs
2017-01-30 11:31:02 +03:00
Alexander Udalov 4a533168d9 Rework const val generation in multifile classes
Do not query MultifileClassCodegen#classBuilder early on: this causes the class
file for the facade to be prematurely dumped to the disk in some cases, when
that class file is not yet completely generated. Instead fork the logic in
PropertyCodegen#generateSyntheticMethodIfNeeded: save metadata in parts,
generate method in the facade
2016-03-29 17:53:32 +03:00
Alexey Tsvetkov 5e90bafe18 Build stubs for modifiers 2015-10-19 20:45:02 +03:00
Pavel V. Talanov 93bb010875 Drop decompiledText/clsStub tests for package facades
(cherry picked from commit fbaa81c)
2015-10-19 16:03:16 +03:00
Dmitry Petrov cd341e957e Cleanup after review
+ stub builder test for multifile class
2015-09-09 19:08:19 +03:00
Dmitry Petrov 0c951b2ed3 Decompilation support
- class header reader for KotlinMultifileClass, KotlinMultifileClassPart
- proper implClassName for multifile class members
2015-09-09 19:08:18 +03:00
Michael Nedzelsky c861b036a0 fix tests in org.jetbrains.kotlin.idea.decompiler.textBuilder 2015-09-08 02:05:30 +03:00
Dmitry Petrov f9901f6075 Fix decompiler tests.
For now, JVM and JS backends produce different metadata for package facades (and package parts),
and thus different output is expected for JVM and JS decompiler.
Split decompiler tests into common (decompiledText), JVM-specific (decompiledTextJvm),
and JS-specific (decompiledTextJs)
Join them back together if JS backend migrates to JVM-like package model.
2015-09-07 16:29:01 +03:00