Skip to content

Commit d975d53

Browse files
committed
Fix flag mutation for Scala2xPartiallyAugmented
Calling `setFlag` on the current denotation is not enough: there might be other more recent denotations created, if we don't also set the flag on these denotations, then the `is(Scala2xPartiallyAugmented)` check in `LinkScala2Impls` will fail. FIXME: we probably need to do the same for all the other usages of setFlag/resetFlag/flags_= in the compiler.
1 parent c8371e4 commit d975d53

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/transform/AugmentScala2Traits.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +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)
67+
mixin.transformAfter(thisPhase, d => { d.setFlag(Scala2xPartiallyAugmented); d })
6868
}
6969
}

compiler/src/dotty/tools/dotc/transform/LinkScala2Impls.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class LinkScala2Impls extends MiniPhase with IdentityDenotTransformer { thisPhas
6060
if (needsMixinForwarder(sym) || sym.isConstructor || sym.isGetter && sym.is(Lazy) || sym.is(Method, butNot = Deferred))
6161
newImpl(sym.asTerm).enteredAfter(thisPhase)
6262
// The trait is now fully augmented so the flag isn't needed anymore.
63-
mixin.resetFlag(Scala2xPartiallyAugmented)
63+
mixin.transformAfter(thisPhase, d => { d.resetFlag(Scala2xPartiallyAugmented); d })
6464
}
6565

6666
override def prepareForTemplate(impl: Template)(implicit ctx: Context): Context = {

0 commit comments

Comments
 (0)