From 6b48112a2bdb400d582447a30e4ec1762d324341 Mon Sep 17 00:00:00 2001 From: pyos Date: Mon, 14 Oct 2019 14:31:32 +0200 Subject: [PATCH] IR: deserialize backing field annotations Probably going to be necessary for handling imported @JvmField annotated declarations. --- .../jetbrains/kotlin/ir/declarations/lazy/IrLazyField.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyField.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyField.kt index 3d72394044b..3c0bfc4a4b8 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyField.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyField.kt @@ -61,7 +61,11 @@ class IrLazyField( symbol.bind(this) } - override val annotations: MutableList = mutableListOf() + override val annotations: MutableList by lazy { + descriptor.backingField?.annotations + ?.mapNotNullTo(mutableListOf(), typeTranslator.constantValueGenerator::generateAnnotationConstructorCall) + ?: mutableListOf() + } override val descriptor: PropertyDescriptor = symbol.descriptor