aboutsummaryrefslogtreecommitdiff
path: root/tests/run/i789.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-09-17 12:01:29 +0200
committerMartin Odersky <odersky@gmail.com>2015-09-17 12:01:44 +0200
commit50e3a7d92f4b7cc4cd922eb92c7ed8bf793b159c (patch)
treeb9e730f476167186316f9a684000cec04cd841d0 /tests/run/i789.scala
parent7ee013745699029830a822d0b9e1e8862eaa0b8c (diff)
downloaddotty-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/run/i789.scala')
-rw-r--r--tests/run/i789.scala20
1 files changed, 20 insertions, 0 deletions
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))
+
+ }
+