From 4a3632f70ecabd79a3b5a4a424adbc2567254556 Mon Sep 17 00:00:00 2001 From: "Pavel V. Talanov" Date: Wed, 28 Oct 2015 15:25:26 +0300 Subject: [PATCH] Backend: generate default values for annotation parameters in light classes mode --- .../org/jetbrains/kotlin/codegen/PropertyCodegen.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/PropertyCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/PropertyCodegen.java index c23680fe9a1..fcc7f30af7d 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/PropertyCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/PropertyCodegen.java @@ -203,11 +203,12 @@ public class PropertyCodegen { null ); - if (state.getClassBuilderMode() == ClassBuilderMode.FULL) { - KtExpression defaultValue = p.getDefaultValue(); - if (defaultValue != null) { - ConstantValue constant = ExpressionCodegen.getCompileTimeConstant(defaultValue, bindingContext); - assert constant != null : "Default value for annotation parameter should be compile time value: " + defaultValue.getText(); + KtExpression defaultValue = p.getDefaultValue(); + if (defaultValue != null) { + ConstantValue constant = ExpressionCodegen.getCompileTimeConstant(defaultValue, bindingContext); + assert state.getClassBuilderMode() != ClassBuilderMode.FULL || constant != null + : "Default value for annotation parameter should be compile time value: " + defaultValue.getText(); + if (constant != null) { AnnotationCodegen annotationCodegen = AnnotationCodegen.forAnnotationDefaultValue(mv, typeMapper); annotationCodegen.generateAnnotationDefaultValue(constant, descriptor.getType()); }