June 04, 2011 [Issue 1747] interface inheritance + casting ==> wrong method invoked | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=1747 Brad Roberts <braddr@puremagic.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |braddr@puremagic.com Component|Phobos |DMD Version|0.24 |D1 & D2 AssignedTo|ibuclaw@ubuntu.com |nobody@puremagic.com Product|DGCC aka GDC |D Summary|math.hypot and conv.toReal |interface inheritance + |& toString unittests failed |casting ==> wrong method |on FreeBSD8 |invoked Severity|minor |normal --- Comment #4 from Brad Roberts <braddr@puremagic.com> 2011-06-04 00:13:48 PDT --- This is a general front end bug, not a gdc specific bug. Recategorizing it. Changing the attached code slightly shows that mA is what's being invoked rather than the intended mB. class ClassX : IntyD { void mA() { g |= 1; } void mB() { g |= 2; } void mD() { g |= 4; } } void main() { ClassX x = new ClassX; assert(g == 0); IntyB b = test(x); assert(g == 0); b.mB(); printf("g = %d\n", g); assert(g == 2); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation