www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Spec bug or dmd bug?

reply Christopher Wright <dhasenan gmail.com> writes:
struct Interface;
     Information about an interface. A pointer to this appears as the 
first entry in the interface's vtbl[].


interface IFoo { void foo(); }

auto a = IFoo.classinfo.vtbl[0]; // array bounds exception
writefln("%x", IFoo.classinfo.vtbl.ptr); // prints '0'

Using dmd 2.008.
Dec 02 2007
parent Christopher Wright <dhasenan gmail.com> writes:
Christopher Wright wrote:
 struct Interface;
     Information about an interface. A pointer to this appears as the 
 first entry in the interface's vtbl[].
 
 
 interface IFoo { void foo(); }
 
 auto a = IFoo.classinfo.vtbl[0]; // array bounds exception
 writefln("%x", IFoo.classinfo.vtbl.ptr); // prints '0'
 
 Using dmd 2.008.

I'm calling it an implementation bug; see my next post on why.
Dec 02 2007