Thread overview
[Issue 21144] A __trait should give access to interface implementation vtbl and their offsets
Aug 10, 2020
Walter Bright
Dec 17, 2022
Iain Buclaw
August 10, 2020
https://issues.dlang.org/show_bug.cgi?id=21144

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com

--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> ---
It is an array of:

    for (size_t i = 0; i < cd.vtblInterfaces.dim; i++)
    {
        BaseClass *b = (*cd.vtblInterfaces)[i];
        ClassDeclaration id = b.sym;

        /* The layout is:
         *  struct Interface
         *  {
         *      ClassInfo classinfo;
         *      void*[] vtbl;
         *      size_t offset;
         *  }
         */

        // Fill in vtbl[]
        b.fillVtbl(cd, &b.vtbl, 1);

        // classinfo
        dtb.xoff(toSymbol(id), 0, TYnptr);

        // vtbl[]
        dtb.size(id.vtbl.dim);
        dtb.xoff(cd.csym, offset, TYnptr);

        // offset
        dtb.size(b.offset);
    }

The compiler doesn't emit this as a separate symbol. A toInterfacesSymbol() function would have to be written to emit it.

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=21144

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--
December 13
https://issues.dlang.org/show_bug.cgi?id=21144

--- Comment #2 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/19766

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--