Skip to content

Commit 81b4627

Browse files
committed
Workaround for scala#3121
1 parent 1dda6e1 commit 81b4627

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

Foo.scala

Whitespace-only changes.

compiler/src/dotty/tools/dotc/typer/Checking.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,7 @@ trait Checking {
686686
val psuper = parent.superClass
687687
val csuper = cls.superClass
688688
val ok = csuper.derivesFrom(psuper) ||
689+
parent == defn.Phantom_AnyClass ||
689690
parent.is(JavaDefined) && csuper == defn.AnyClass &&
690691
(parent == defn.JavaSerializableClass || parent == defn.ComparableClass)
691692
if (!ok)

tests/pos/i3121.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
object MyPhantom extends Phantom {
2+
type Foo = this.Any { type Member = Int }
3+
4+
type Bar <: this.Any
5+
type Foo2 = Bar { type Member = Int }
6+
}

0 commit comments

Comments
 (0)