You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -282,7 +277,7 @@ abstract class Fields extends InfoTransform with ast.TreeDSL with TypingTransfor
282
277
283
278
setFieldFlags(accessor, field)
284
279
285
-
//TODO: filter getter's annotations to exclude those only meant for the field
280
+
// filter getter's annotations to exclude those only meant for the field
286
281
// we must keep them around long enough to see them here, though, when we create the field
287
282
field setAnnotations (accessor.annotations filter AnnotationInfo.mkFilter(FieldTargetClass, defaultRetention =true))
288
283
@@ -293,21 +288,25 @@ abstract class Fields extends InfoTransform with ast.TreeDSL with TypingTransfor
293
288
// println(s"new decls for $clazz: $mixedInAccessorAndFields")
294
289
295
290
// omit fields that are not memoized, retain all other members
296
-
defomittableField(sym: Symbol) = sym.isValue &&!sym.isMethod && fieldMemoizationIn(sym, clazz).effectOnly // TODO: not yet `needsField`, to produce same bytecode as M2
291
+
defomittableField(sym: Symbol) =
292
+
sym.isValue &&!sym.isMethod &&
293
+
fieldMemoizationIn(sym, clazz).effectOnly // TODO: not yet `needsField`, to produce same bytecode as 2.12.0-M3
297
294
298
295
valnewDecls=
299
296
if (mixedInAccessorAndFields.isEmpty) oldDecls.filterNot(omittableField)
300
297
else { // must not alter `decls` directly
301
-
valnewDecls= newScope
302
-
oldDecls foreach { d =>if (!omittableField(d)) newDecls.enter(d) }
303
-
valenter= { mixedin: Symbol=> newDecls enter mixedin }
304
-
mixedInAccessorAndFields foreach { _ foreach enter }
305
-
306
-
// subst from accessors to corresponding clonedAccessors in types in newDecls
307
-
val (origs, mixedins) = (accessorsMaybeNeedingImpl, mixedInAccessorAndFields).zipped.collect {
298
+
// compute subst from accessors to corresponding clonedAccessors in types in newDecls
299
+
val (_origs, _mixedins) = (accessorsMaybeNeedingImpl, mixedInAccessorAndFields).zipped.collect {
308
300
case (traitAccessor, mixedin :: _) => (traitAccessor, mixedin)
Copy file name to clipboardExpand all lines: src/reflect/scala/reflect/internal/Flags.scala
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -173,9 +173,10 @@ class Flags extends ModifierFlags {
173
173
finalvalSYNCHRONIZED=1L<<45// symbol is a method which should be marked ACC_SYNCHRONIZED
174
174
175
175
finalvalSYNTHESIZE_IMPL_IN_SUBCLASS=1L<<50// Like MIXEDIN, but used in Fields
176
-
finalvalNEEDS_TREES=1L<<59// Communicate from Fields' info transform to its tree transform -- this symbol needs a tree. (distinct from SYNTHESIZE_IMPL_IN_SUBCLASS)
177
-
finalvalOVERRIDDEN_TRAIT_SETTER=1L<<60// Communicate from Fields' info transform to its tree transform -- this setter gets a unit body.
178
-
finalvalFINAL_TRAIT_ACCESSOR=1L<<61// Communicate from Fields' info transform to its tree transform -- this accessor's synthesized implementation should be final.
176
+
177
+
// flags used strictly internally in the Fields phase (info/tree transform):
178
+
finalvalNEEDS_TREES=1L<<59// this symbol needs a tree. (distinct from SYNTHESIZE_IMPL_IN_SUBCLASS)
179
+
finalvalOVERRIDDEN_TRAIT_SETTER=1L<<60// this setter gets a unit body.
0 commit comments