Permalink
Browse files

@volatile ok on accessor in trait

      // allow ACCESSOR: trait accessors keep around the annotations that must be passed down to fields in subclasses
  • Loading branch information...
adriaanm committed Jul 18, 2016
1 parent 3ff97fa commit cbffad9db29702368aed0902a9f5377f4b9d740d
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -2002,7 +2002,8 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
val tpt1 = checkNoEscaping.privates(sym, typedType(vdef.tpt))
checkNonCyclic(vdef, tpt1)
if (sym.hasAnnotation(definitions.VolatileAttr) && !sym.isMutable && !sym.isAccessor) // a trait val is a ValDef with a method symbol
// allow ACCESSOR: trait accessors keep around the annotations that must be passed down to fields in subclasses
if (sym.hasAnnotation(definitions.VolatileAttr) && !(sym hasFlag MUTABLE | ACCESSOR))
VolatileValueError(vdef)
val rhs1 =

0 comments on commit cbffad9

Please sign in to comment.