Permalink
Browse files

counterpart in GenASM to 241c760

  • Loading branch information...
magarciaEPFL committed Jun 7, 2012
1 parent 961092b commit f47870da6db82686d28a6f44bbb4fdcaac5369df
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala
@@ -283,12 +283,16 @@ abstract class GenASM extends SubComponent with BytecodeWriters {
&& !sym.isMutable // lazy vals and vars both
)
+ // Primitives are "abstract final" to prohibit instantiation
+ // without having to provide any implementations, but that is an
+ // illegal combination of modifiers at the bytecode level so
+ // suppress final if abstract if present.
import asm.Opcodes._
mkFlags(
if (privateFlag) ACC_PRIVATE else ACC_PUBLIC,
if (sym.isDeferred || sym.hasAbstractFlag) ACC_ABSTRACT else 0,
if (sym.isInterface) ACC_INTERFACE else 0,
- if (finalFlag) ACC_FINAL else 0,
+ if (finalFlag && !sym.hasAbstractFlag) ACC_FINAL else 0,
if (sym.isStaticMember) ACC_STATIC else 0,
if (sym.isBridge) ACC_BRIDGE | ACC_SYNTHETIC else 0,
if (sym.isClass && !sym.isInterface) ACC_SUPER else 0,

0 comments on commit f47870d

Please sign in to comment.