--- Comment #8 from Cristi Vlasceanu <>  2009-08-07 
21:28:56 PDT ---
That case is indeed illegal, AND handled correctly by my fix.

You can try it out either by downloading the dnet compiler, or by applying the
change to DMD, here's the full code:

Type *TypeIdentifier::semantic(Loc loc, Scope *sc)
    Type *t;
    Expression *e;
    Dsymbol *s;

    //printf("TypeIdentifier::semantic(%s)\n", toChars());
    resolve(loc, sc, &e, &t, &s);
    if (t)
    //printf("\tit's a type %d, %s, %s\n", t->ty, t->toChars(), t->deco);

    if (t->ty == Ttypedef)
    {   TypeTypedef *tt = (TypeTypedef *)t;

        if (tt->sym->sem == 1)
        error(loc, "circular reference of typedef %s", tt->toChars());
    t = t->addMod(mod);
#ifdef DEBUG
    if (!global.gag)
        printf("1: ");
    if (s)
        if (sc->enclosing)
             return semantic(loc, sc->enclosing);
        s->error(loc, "is used as a type");
        error(loc, "%s is used as a type", toChars());
    t = tvoid;
    return t;

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to