Commit Graph

20 Commits

Author SHA1 Message Date
Dmitriy Novozhilov a4e8be8687 [FIR] Deserialize enum entries access in annotations into FirEnumEntryDeserializedAccessExpression
^KT-64975 Fixed
^KT-62900
2024-01-25 15:55:19 +00:00
Kirill Rakhman 8ff67218f5 [FIR] Fix serialization of annotation vararg arguments
#KT-58937 Fixed
2023-06-14 08:41:27 +00:00
Dmitriy Novozhilov 6521729466 [Test] Update dumps of fir metadata where it differs on different platforms 2023-06-07 10:58:01 +00:00
Dmitriy Novozhilov 357c552b5f [Test] Set JVM target backend for load compiled tests which use JDK classes 2023-06-07 10:58:01 +00:00
Leonid Startsev c4255f9a9e [K2] Instantiation of annotations having default values for properties
This commit adds missing pieces for the puzzle:

Annotation instantiation feature uses IrProperty's initializer to instantiate
properties from other modules that have default values which weren't
specified on call site.

To support this feature properly, Fir2IrVisitor should fill LazyIrProperty's
backing field initializer with information from Fir.

To get this information into Fir, FirMemberDeserializer should be able to read
it from KotlinJvmBinaryClass with AnnotationLoaderVisitorImpl. (klibs are unsupported for now)

There's a catch with enum entries references: we can't access session.SymbolProvider to resolve it
because we're still at the deserialization stage, and it can cause StackOverflow if enum is nested in the
same class (see RequiresOptIn.Level). To mitigate this, a new FirEnumEntryDeserializedAccessExpression is produced
instead; it is later replaced with the correct reference in the Fir2IrVisitor.

^KT-58137 Fixed

Also add test to loadJava folder with annotations default values that
verifies metadata loading
2023-05-12 16:08:02 +00:00
Kirill Rakhman e7bad26a4c [FIR] Unmute test for #KT-58080 2023-05-10 09:01:21 +00:00
Dmitriy Novozhilov af60681705 [FIR] Save declarations in metadata in source order
^KT-54792 Fixed
^KT-54801
^KT-54800
2023-05-09 07:36:32 +00:00
Mikhail Glukhikh f6bf7560a6 K2: fix field annotation handling around serialization
#KT-57135 Fixed
2023-04-25 12:18:27 +00:00
Dmitriy Novozhilov 6287968511 [FIR Test] Migrate AbstractFirLoadCompiledKotlin to new test infrastructure
Also introduce two different modes for those tests:
- load metadata compiled with K1
- load metadata compiled with K2
2023-04-19 14:33:25 +00:00
Dmitriy Novozhilov e94a64a4f2 [FE Test] Move FIR dumps for LoadCompiledKotlin tests close to original testdata 2023-04-19 14:33:24 +00:00
Mikhail Glukhikh d3648bce0c Run LoadJava.CompiledKotlin test group with stdlib if some enum is inside
This commit makes compiler tests working similarly to ResolveByStub IDE tests.
2022-08-19 10:08:11 +00:00
Vladimir Dolzhenko 918a91dbdf Escape special names with backticks in test data
#KT-51248
2022-02-10 21:20:47 +00:00
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00
Alexander Udalov 3c4e5d7615 Fix JvmFieldInInterfaceCompanion.kt for language version 1.4
Since 1.4, constant value is no longer written to the class file (and
thus cannot be read) for non-const properties. But in sources,
corresponding property descriptors still have the initializer which is
rendered to text. Therefore we disable the source-vs-binary check and
update the test data to check the new behavior.
2020-01-17 20:35:46 +01:00
Alexander Udalov de683c0768 JVM IR: mute more tests after advancing language to 1.4 2020-01-17 12:47:20 +01:00
Alexander Udalov 2a3786e3f8 Retain "is moved from interface companion" property flag in kotlinx-metadata-jvm
#KT-31338 Fixed
2019-05-24 14:42:25 +02:00
Mikhail Zarechenskiy d28488eaed Remove WITH_UNSIGNED directive from tests
#KT-25226 Fixed
2018-11-13 11:48:32 +03:00
Mikhail Zarechenskiy 14b8ff7d71 Load unsigned constants from class file with the use of expected type 2018-07-09 20:19:26 +03:00
Mikhail Zarechenskiy 0c6757a8b0 Write is_unsigned flag into metadata for an annotation arguments
Instead of adding new kind of types, we'll use flag to disambiguate
 usual types from unsigned ones, this approach has two advantages:
 - less changes in the metadata format
 - it allows naturally extend format for unsigned arrays,
  which will be supported later

 #KT-25310 Fixed
 #KT-25273 Fixed
2018-07-09 20:06:05 +03:00
Alexander Udalov a8bebeb48d Load annotations of const properties from multifile classes
Rework backing field generation logic in PropertyCodegen to switch the
ClassBuilder instance for a multifile part to that of the corresponding facade
class. This became needed because multifile parts, and their metadata, are
generated _before_ the multifile facade class and otherwise we would never
record that there's a synthetic '$annotations' method for a const val and would
not write that to the protobuf message for the property.

See also bad83200

 #KT-10892 Fixed
2016-03-28 21:11:14 +03:00