Skip to content

Commit eb4bb1d

Browse files
committed
New passing tests.
1 parent ed10162 commit eb4bb1d

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

tests/pos/S5.scala

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* Original comment:
2+
* Here's a fragment of a Scala encoding for the Keris module system;
3+
** the compiler claims:
4+
**
5+
** S5.scala:28: value n in class N of type N.this._N.n
6+
** cannot override value n in class M of type M.this._N.n
7+
** val system = new M() with N() {}
8+
** ^
9+
** To me it seems like the code is perfectly fine...
10+
*/
11+
abstract class M() {
12+
val _N: N;
13+
val n: _N.n;
14+
val _M: M = this;
15+
val m: _M.m = new _M.m();
16+
class m() {
17+
// module body of M
18+
}
19+
}
20+
trait N {
21+
val _N: N = this;
22+
val n: _N.n = new _N.n();
23+
val _M: M;
24+
val m: _M.m;
25+
class n() {
26+
// module body of N
27+
}
28+
}
29+
object O {
30+
val system = new M() with N {}
31+
}
File renamed without changes.

0 commit comments

Comments
 (0)