236
|
1 // $HeadURL$
|
|
2 // $Date$
|
|
3 // $Author$
|
|
4
|
|
5 // @author@ teqDruid <me@teqdruid.com>
|
|
6 // @date@ 2005-01-12
|
|
7 // @uri@ news:pan.2005.01.12.13.20.54.546749@teqdruid.com
|
1384
|
8 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=2676
|
236
|
9
|
237
|
10 module dstress.run.opIdentity_02;
|
236
|
11
|
|
12 interface I {
|
|
13 I parent();
|
|
14 void parent(I i);
|
|
15 void addChild(I i);
|
|
16 }
|
|
17
|
|
18 interface J : I {
|
|
19 }
|
|
20
|
|
21 class A : I {
|
|
22 private I myParent;
|
|
23
|
|
24 void addChild(I i) {
|
|
25 i.parent = this;
|
|
26 }
|
|
27
|
|
28 I parent() {
|
|
29 return myParent;
|
|
30 }
|
|
31
|
|
32 void parent(I parent) {
|
|
33 myParent = parent;
|
|
34 }
|
|
35 }
|
|
36
|
|
37 class B : A, J {
|
|
38 }
|
|
39
|
|
40 int main() {
|
|
41 J a = new B;
|
|
42 J b = new B;
|
|
43 a.addChild(b);
|
570
|
44 assert(cast(J)b.parent is a);
|
236
|
45 return 0;
|
|
46 }
|