diff options
author | Martin Odersky <odersky@gmail.com> | 2015-09-17 12:01:29 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-09-17 12:01:44 +0200 |
commit | 50e3a7d92f4b7cc4cd922eb92c7ed8bf793b159c (patch) | |
tree | b9e730f476167186316f9a684000cec04cd841d0 /tests | |
parent | 7ee013745699029830a822d0b9e1e8862eaa0b8c (diff) | |
download | dotty-50e3a7d92f4b7cc4cd922eb92c7ed8bf793b159c.tar.gz dotty-50e3a7d92f4b7cc4cd922eb92c7ed8bf793b159c.tar.bz2 dotty-50e3a7d92f4b7cc4cd922eb92c7ed8bf793b159c.zip |
New phase: ExplicitSelf
Makes self types explicit, if this is needed to identify
a member in a select. Fixes #789.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/run/i789.check | 1 | ||||
-rw-r--r-- | tests/run/i789.scala | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/run/i789.check b/tests/run/i789.check new file mode 100644 index 000000000..d41f69423 --- /dev/null +++ b/tests/run/i789.check @@ -0,0 +1 @@ +atPhase: 2 diff --git a/tests/run/i789.scala b/tests/run/i789.scala new file mode 100644 index 000000000..99b081f0a --- /dev/null +++ b/tests/run/i789.scala @@ -0,0 +1,20 @@ + trait Periods { self: Context => + + def atPhase(id: Int): Unit = println(s"atPhase: $id") + + } + + class Phase(val id: Int) + + trait Phases { self: Context => + def atPhase(phase: Phase): Unit = self.atPhase(phase.id) + } + + trait Context extends Phases with Periods + + object Test extends Context { + + def main(args: Array[String]) = atPhase(new Phase(2)) + + } + |