summaryrefslogtreecommitdiff
path: root/test/files/pos/S5.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2003-03-06 19:14:59 +0000
committerMartin Odersky <odersky@gmail.com>2003-03-06 19:14:59 +0000
commita16dd265fddd7da26564109f4026fb1d12c1071a (patch)
tree702ba02d30d68d21d51ac5c83f31b448cd654ce1 /test/files/pos/S5.scala
parentbcc3899778ce607df11b471a641493037a8c962f (diff)
downloadscala-a16dd265fddd7da26564109f4026fb1d12c1071a.tar.gz
scala-a16dd265fddd7da26564109f4026fb1d12c1071a.tar.bz2
scala-a16dd265fddd7da26564109f4026fb1d12c1071a.zip
*** empty log message ***
Diffstat (limited to 'test/files/pos/S5.scala')
-rw-r--r--test/files/pos/S5.scala30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/files/pos/S5.scala b/test/files/pos/S5.scala
new file mode 100644
index 0000000000..87325b47e4
--- /dev/null
+++ b/test/files/pos/S5.scala
@@ -0,0 +1,30 @@
+/* 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
+ }
+}
+abstract class 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
+ }
+}
+module O {
+ val system = new M() with N() {}
+}