File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 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.
You can’t perform that action at this time.
0 commit comments