Skip to content

Commit 410adde

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 410adde

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,6 @@ class AugmentScala2Traits extends MiniPhase with IdentityDenotTransformer { this
6565
sym.ensureNotPrivate.installAfter(thisPhase)
6666
}
6767
mixin.setFlag(Scala2xPartiallyAugmented)
68+
mixin.transformAfter(thisPhase, d => { d.setFlag(Scala2xPartiallyAugmented); d })
6869
}
6970
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class LinkScala2Impls extends MiniPhase with IdentityDenotTransformer { thisPhas
6161
newImpl(sym.asTerm).enteredAfter(thisPhase)
6262
// The trait is now fully augmented so the flag isn't needed anymore.
6363
mixin.resetFlag(Scala2xPartiallyAugmented)
64+
mixin.transformAfter(thisPhase, d => { d.resetFlag(Scala2xPartiallyAugmented); d })
6465
}
6566

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

0 commit comments

Comments
 (0)