[Issue 1728] alias hides mixin member func?

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 25 21:18:25 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=1728


davidl at 126.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch




------- Comment #1 from davidl at 126.com  2008-06-25 23:18 -------
a patch
in template.c
TemplateMixin::semantic
    // Declare each template parameter as an alias for the argument type
    declareParameters(scope);

++  ScopeDsymbol *parent = sc -> parent;

    // Add members to enclosing scope, as well as this scope
    for (unsigned i = 0; i < members->dim; i++)
    {   Dsymbol *s;

        s = (Dsymbol *)members->data[i];
+++     // for fixing bug 1728
http://d.puremagic.com/issues/show_bug.cgi?id=1728
+++     // actually we provide the sugar of introducing the funcdeclaration
transparently from this anonymous scope

+++     if (s -> isFuncDeclaration())
+++     {
+++         s->addMember(scope, parent, i);
+++         s->parent = this;
+++     }
+++     else
        s->addMember(scope, this, i);
        //sc->insert(s);
        //printf("sc->parent = %p, sc->scopesym = %p\n", sc->parent,
sc->scopesym);
        //printf("s->parent = %s\n", s->parent->toChars());
    }

and in dsymbol.c:
Dsymbol::addMember

            s2 = sd->symtab->lookup(ident);
+++         s2 = s2 -> toAlias();
            if (!s2->overloadInsert(this))
            {
                sd->multiplyDefined(0, this, s2);
            }


-- 



More information about the Digitalmars-d-bugs mailing list