File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1485,6 +1485,11 @@ object SymDenotations {
14851485 override def transformAfter (phase : DenotTransformer , f : SymDenotation => SymDenotation )(implicit ctx : Context ): Unit =
14861486 super .transformAfter(phase, f)
14871487
1488+ /** Set flag `flags` in current phase and in all phases that follow */
1489+ def setFlagFrom (phase : DenotTransformer , flags : FlagSet )(using Context ): Unit =
1490+ setFlag(flags)
1491+ transformAfter(phase, sd => { sd.setFlag(flags); sd })
1492+
14881493 /** If denotation is private, remove the Private flag and expand the name if necessary */
14891494 def ensureNotPrivate (implicit ctx : Context ): SymDenotation =
14901495 if (is(Private ))
Original file line number Diff line number Diff line change @@ -64,7 +64,6 @@ class AugmentScala2Traits extends MiniPhase with IdentityDenotTransformer { this
6464 || sym.isSuperAccessor) // scala2 superaccessors are pickled as private, but are compiled as public expanded
6565 sym.ensureNotPrivate.installAfter(thisPhase)
6666 }
67- mixin.setFlag(Scala2xPartiallyAugmented )
68- mixin.transformAfter(thisPhase, d => { d.setFlag(Scala2xPartiallyAugmented ); d })
67+ mixin.setFlagFrom(thisPhase, Scala2xPartiallyAugmented )
6968 }
7069}
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
118118 // if you would use parent param-name `a` to implement param-field `b`
119119 // overriding field `b` will actually override field `a`, that is wrong!
120120 typr.println(i " super alias: ${sym.showLocated}" )
121- sym.setFlag( SuperParamAlias )
121+ sym.setFlagFrom(thisPhase, SuperParamAlias )
122122 case _ =>
123123 case _ =>
124124
You can’t perform that action at this time.
0 commit comments