From c47934b3cf3ebf4edaffc52af54bc973e461eb01 Mon Sep 17 00:00:00 2001 From: Stepan Koltsov Date: Sat, 3 Mar 2012 01:10:59 +0400 Subject: [PATCH] do not rely on presence of function body to compute function modifiers this fixes generation of stubs --- .../src/org/jetbrains/jet/codegen/FunctionCodegen.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java index b33dedadfba..e762ad6790a 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/FunctionCodegen.java @@ -113,7 +113,10 @@ public class FunctionCodegen { if (isStatic || kind == OwnerKind.TRAIT_IMPL) flags |= ACC_STATIC; - boolean isAbstract = !isStatic && !(kind == OwnerKind.TRAIT_IMPL) && (bodyExpressions == null || CodegenUtil.isInterface(functionDescriptor.getContainingDeclaration())); + boolean isAbstract = ( + functionDescriptor.getModality() == Modality.ABSTRACT + || CodegenUtil.isInterface(functionDescriptor.getContainingDeclaration()) + ) && !isStatic && kind != OwnerKind.TRAIT_IMPL; if (isAbstract) flags |= ACC_ABSTRACT; final MethodVisitor mv = v.newMethod(fun, flags, jvmSignature.getAsmMethod().getName(), jvmSignature.getAsmMethod().getDescriptor(), jvmSignature.getGenericsSignature(), null);