blob: 751c8b1c888b97853b270a73ea4662bcf7e45bd2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
/*
module A requires B {
B.X getX() {
return B.getX();
}
void setX(B.X x) {}
}
module B {
class X {}
X getX() {
return new X();
}
void setX(X x) {}
}
module C requires B {
module A;
void test() {
A.setX(B.getX());
}
}
*/
trait _a extends Object with _b {
val a: _a;
val A: A;
type A <: a.AModule;
trait AModule {
def getX(): B.X;
def setX(x: B.X): Unit;
}
}
abstract class a() extends Object with _a with _b {
val a: this.type = this;
val A: A = new A();
class A() extends AModule {
def getX(): B.X = B.getX();
def setX(x: B.X) = B.setX(x);
}
}
trait _b {
val b: _b;
val B: B;
type B <: b.BModule;
trait BModule {
type X;
def getX(): X;
def setX(x: X): Unit;
}
}
abstract class b() extends Object with _b {
val b: this.type = this;
val B: B = new B();
class B() extends BModule {
class X() {}
def getX(): X = new X();
def setX(x: X) = ();
}
}
trait _m {
val m: _m;
val M: M;
type M <: m.MModule;
trait MModule {}
}
abstract class m() extends Object with _m with _b {
val m: this.type = this;
val M: M = new M();
class M() extends MModule with a() with Linker() {
def test() = {
val x: B.X = B.getX();
A.setX(x);
}
}
abstract class Linker() {
val b: m.this.b.type = m.this.b;
val B: m.this.B.type = m.this.B;
type B = m.this.B;
val m: m.this.m.type = m.this.m;
val M: m.this.M.type = m.this.M;
type M = m.this.M;
}
}
|