Skip to content

Commit c804620

Browse files
Merge pull request #2720 from dotty-staging/phantom-self
Add test for scala.Phantom self type
2 parents 1d24a1b + a81dbcd commit c804620

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

tests/run/phantom-self-1.check

Whitespace-only changes.

tests/run/phantom-self-1.scala

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
object Test {
2+
def main(args: Array[String]): Unit = {
3+
Boo.any
4+
Boo.any2
5+
}
6+
}
7+
8+
object Boo extends Phantom with T
9+
10+
trait T { self: Phantom =>
11+
type X = self.Any
12+
def any: X = self.assume
13+
def any2: X = assume
14+
}

0 commit comments

Comments
 (0)