From 4268d8aa27287ff03197481140cecc0c4f54fa66 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Fri, 8 Nov 2013 17:21:43 +0400 Subject: [PATCH] Generate parameter annotations even in LIGHT_CLASSES mode --- .../src/org/jetbrains/jet/codegen/FunctionCodegen.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java index 9f41c5bb90e..8f9b0ac2869 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java @@ -119,12 +119,13 @@ public class FunctionCodegen extends ParentCodegenAwareImpl { } AnnotationCodegen.forMethod(mv, typeMapper).genAnnotations(functionDescriptor); - if (state.getClassBuilderMode() == ClassBuilderMode.LIGHT_CLASSES) return; generateParameterAnnotations(functionDescriptor, mv, jvmSignature); generateJetValueParameterAnnotations(mv, functionDescriptor, jvmSignature); + if (state.getClassBuilderMode() == ClassBuilderMode.LIGHT_CLASSES) return; + if (isAbstractMethod(functionDescriptor, methodContext.getContextKind())) return; generateMethodBody(mv, functionDescriptor, methodContext, jvmSignature, strategy); @@ -210,7 +211,10 @@ public class FunctionCodegen extends ParentCodegenAwareImpl { } } - private static void markEnumConstructorParameterAsSynthetic(MethodVisitor mv, int i) { + private void markEnumConstructorParameterAsSynthetic(MethodVisitor mv, int i) { + // IDEA's ClsPsi builder fails to annotate synthetic parameters + if (state.getClassBuilderMode() == ClassBuilderMode.LIGHT_CLASSES) return; + // This is needed to avoid RuntimeInvisibleParameterAnnotations error in javac: // see MethodWriter.visitParameterAnnotation()