digitalmars.D.bugs - DMD 0.112: Class inheriting from another class inheriting from an
- Burton Radons (29/29) Jan 30 2005 This one's a killer to explain. The following code should print 1;
- John Demme (3/39) Jan 30 2005 Yeah... I've already posted about this one. It's in DStress. See "===
This one's a killer to explain. The following code should print 1; instead it prints 0. This is apparently caused by too many inherited instances of A, with one reference to the object getting one indexed pointer and the other object getting the other for whatever reason. So when the equivalency operator attempts to align the two instances, it gets two different pointers and bails. interface A { void call (A other); } interface Ab : A { } class B : A { void call (A other) { printf ("%d\n", this === other); } } class C : B, Ab { } void main () { C b = new C (); b.call (b); } I can work around the problem.
Jan 30 2005
Yeah... I've already posted about this one. It's in DStress. See "=== No Damn Good" Burton Radons wrote:This one's a killer to explain. The following code should print 1; instead it prints 0. This is apparently caused by too many inherited instances of A, with one reference to the object getting one indexed pointer and the other object getting the other for whatever reason. So when the equivalency operator attempts to align the two instances, it gets two different pointers and bails. interface A { void call (A other); } interface Ab : A { } class B : A { void call (A other) { printf ("%d\n", this === other); } } class C : B, Ab { } void main () { C b = new C (); b.call (b); } I can work around the problem.
Jan 30 2005