Skip to content

Commit b17a836

Browse files
committed
Flags can't be used as non-monotonic signals between phases
since denotations are phase-versioned and later denotations might exist already when the flag of an earlier denotation is set. To avoid this, set flags in all following denotations, not just the current one.
1 parent 51b1f2c commit b17a836

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-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
}

tests/run/i8101/Foo.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
trait Foo {
2+
def f: String = ???
3+
}

tests/run/i8101/JavaFoo.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
public abstract class JavaFoo {
2+
public abstract int read();
3+
}

tests/run/i8101/Test.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Bar extends JavaFoo with Foo {
2+
def read(): Int = ???
3+
}
4+
5+
@main def Test =
6+
val stdout = new Bar

0 commit comments

Comments
 (0)