[Issue 1712] vtbl[0] for interface not set to corresponding Interface*
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Jan 20 08:53:38 PST 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1712
dhasenan at gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|INVALID |
------- Comment #2 from dhasenan at gmail.com 2008-01-20 10:53 -------
So you're saying that the Interface* should appear in the vtbl of each
implementing class? Like this:
---
interface IFoo {}
class Foo : IFoo {}
// Foo implements one more interface than Object, so its vtbl includes
// one Interface* that Object doesn't. Nothing else is specific to Foo.
assert(Object.classinfo.vtbl.length + 1 == Foo.classinfo.vtbl.length);
---
Except that doesn't work.
I understand that the vtbl of an interface should not include any function
pointers. However, the spec says it should hold an Interface*.
http://www.digitalmars.com/d/phobos/object.html if you want the link. Either
the spec is incorrect or the implementation is incorrect. If the spec is
incorrect, then I cannot proxy certain objects, and you should alter the
documentation.
Or is there some other vtbl in which the Interface* should appear? If so, the
documentation is far from clear on the matter and should be altered.
--
More information about the Digitalmars-d-bugs
mailing list