File tree 3 files changed +7
-3
lines changed
compiler/src/dotty/tools/dotc
3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1485,6 +1485,11 @@ object SymDenotations {
1485
1485
override def transformAfter (phase : DenotTransformer , f : SymDenotation => SymDenotation )(implicit ctx : Context ): Unit =
1486
1486
super .transformAfter(phase, f)
1487
1487
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
+
1488
1493
/** If denotation is private, remove the Private flag and expand the name if necessary */
1489
1494
def ensureNotPrivate (implicit ctx : Context ): SymDenotation =
1490
1495
if (is(Private ))
Original file line number Diff line number Diff line change @@ -64,7 +64,6 @@ class AugmentScala2Traits extends MiniPhase with IdentityDenotTransformer { this
64
64
|| sym.isSuperAccessor) // scala2 superaccessors are pickled as private, but are compiled as public expanded
65
65
sym.ensureNotPrivate.installAfter(thisPhase)
66
66
}
67
- mixin.setFlag(Scala2xPartiallyAugmented )
68
- mixin.transformAfter(thisPhase, d => { d.setFlag(Scala2xPartiallyAugmented ); d })
67
+ mixin.setFlagFrom(thisPhase, Scala2xPartiallyAugmented )
69
68
}
70
69
}
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
118
118
// if you would use parent param-name `a` to implement param-field `b`
119
119
// overriding field `b` will actually override field `a`, that is wrong!
120
120
typr.println(i " super alias: ${sym.showLocated}" )
121
- sym.setFlag( SuperParamAlias )
121
+ sym.setFlagFrom(thisPhase, SuperParamAlias )
122
122
case _ =>
123
123
case _ =>
124
124
You can’t perform that action at this time.
0 commit comments