https://issues.dlang.org/show_bug.cgi?id=23819
--- Comment #1 from Felix Hufnagel <[email protected]> --- To add to that, my initial problem was, that when using two mixins, somehow the order i mix them in is important. but shouldn't the vtable automatically be correct when i inherit an interface? in my mixin IMPLEMENT_REFCOUNT; and mixin QUERY_INTERFACE!(FUnknown, IMessage); will generate the wrong vtable, unless swapped. extern (C++) class HostMessage : IMessage { public: // somehow the order of the two mixins matters mixin IMPLEMENT_REFCOUNT; mixin QUERY_INTERFACE!(FUnknown, IMessage); } mixin template IMPLEMENT_REFCOUNT() { override uint addRef() { return 1; } override uint release() { return 1; } } mixin template QUERY_INTERFACE(Interfaces...) { override tresult queryInterface (ref const TUID _iid, void** obj) { return 1; } } interface IMessage : FUnknown { public: nothrow: // @nogc: /** Returns the message ID (for example "TextMessage"). */ FIDString getMessageID(); /** Sets a message ID (for example "TextMessage"). */ void setMessageID(FIDString id /*in*/); /** Returns the attribute list associated to the message. */ IAttributeList getAttributes(); __gshared immutable TUID iid = INLINE_UID(0x936F033B, 0xC6C047DB, 0xBB0882F8, 0x13C1E613); } interface FUnknown : IUnknown { __gshared immutable TUID iid = INLINE_UID(0x00000000, 0x00000000, 0xC0000000, 0x00000046); } interface IUnknown { tresult queryInterface(ref const(TUID) _iid, void** obj); uint addRef(); uint release(); } --
