diff options
author | Martin Odersky <odersky@gmail.com> | 2014-12-19 19:01:29 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-12-19 19:02:31 +0100 |
commit | eb4bb1d092014be19b1669a7c16c6df3e11fda28 (patch) | |
tree | 1ea1833e7bfca2faeec7e6b8bba42fe28d17156c /tests/pos/S5.scala | |
parent | ed1016201ee3f1784243c6d04d84164369c56254 (diff) | |
download | dotty-eb4bb1d092014be19b1669a7c16c6df3e11fda28.tar.gz dotty-eb4bb1d092014be19b1669a7c16c6df3e11fda28.tar.bz2 dotty-eb4bb1d092014be19b1669a7c16c6df3e11fda28.zip |
New passing tests.
Diffstat (limited to 'tests/pos/S5.scala')
-rw-r--r-- | tests/pos/S5.scala | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/pos/S5.scala b/tests/pos/S5.scala new file mode 100644 index 000000000..ba87869a1 --- /dev/null +++ b/tests/pos/S5.scala @@ -0,0 +1,31 @@ +/* Original comment: + * Here's a fragment of a Scala encoding for the Keris module system; +** the compiler claims: +** +** S5.scala:28: value n in class N of type N.this._N.n +** cannot override value n in class M of type M.this._N.n +** val system = new M() with N() {} +** ^ +** To me it seems like the code is perfectly fine... +*/ +abstract class M() { + val _N: N; + val n: _N.n; + val _M: M = this; + val m: _M.m = new _M.m(); + class m() { + // module body of M + } +} +trait N { + val _N: N = this; + val n: _N.n = new _N.n(); + val _M: M; + val m: _M.m; + class n() { + // module body of N + } +} +object O { + val system = new M() with N {} +} |