Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changeset 604

Show
Ignore:
Timestamp:
08/06/10 06:39:19 (14 years ago)
Author:
walter
Message:

bugzilla 1418 tupleof bug on nested classes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dmd-1.x/src/mtype.c

    r569 r604  
    47264726 
    47274727        if (de->e1->op == TOKimport) 
    47284728        { 
    47294729            ScopeExp *se = (ScopeExp *)de->e1; 
    47304730 
    47314731            s = se->sds->search(e->loc, ident, 0); 
    47324732            e = de->e1; 
    47334733            goto L1; 
    47344734        } 
    47354735    } 
    47364736 
    47374737    if (ident == Id::tupleof) 
    47384738    { 
    47394739        /* Create a TupleExp 
    47404740         */ 
    47414741        e = e->semantic(sc);    // do this before turning on noaccesscheck 
    47424742        Expressions *exps = new Expressions; 
    47434743        exps->reserve(sym->fields.dim); 
    47444744        for (size_t i = 0; i < sym->fields.dim; i++) 
    47454745        {   VarDeclaration *v = (VarDeclaration *)sym->fields.data[i]; 
     4746            // Don't include hidden 'this' pointer 
     4747            if (v->isThisDeclaration()) 
     4748                continue; 
    47464749            Expression *fe = new DotVarExp(e->loc, e, v); 
    47474750            exps->push(fe); 
    47484751        } 
    47494752        e = new TupleExp(e->loc, exps); 
    47504753        sc = sc->push(); 
    47514754        sc->noaccesscheck = 1; 
    47524755        e = e->semantic(sc); 
    47534756        sc->pop(); 
    47544757        return e; 
    47554758    } 
    47564759 
    47574760    s = sym->search(e->loc, ident, 0); 
    47584761L1: 
    47594762    if (!s) 
    47604763    { 
    47614764        // See if it's a base class 
    47624765        ClassDeclaration *cbase; 
    47634766        for (cbase = sym->baseClass; cbase; cbase = cbase->baseClass) 
    47644767        { 
    47654768            if (cbase->ident->equals(ident)) 
  • trunk/src/mtype.c

    r598 r604  
    71187118 
    71197119        if (de->e1->op == TOKimport) 
    71207120        { 
    71217121            ScopeExp *se = (ScopeExp *)de->e1; 
    71227122 
    71237123            s = se->sds->search(e->loc, ident, 0); 
    71247124            e = de->e1; 
    71257125            goto L1; 
    71267126        } 
    71277127    } 
    71287128 
    71297129    if (ident == Id::tupleof) 
    71307130    { 
    71317131        /* Create a TupleExp 
    71327132         */ 
    71337133        e = e->semantic(sc);    // do this before turning on noaccesscheck 
    71347134        Expressions *exps = new Expressions; 
    71357135        exps->reserve(sym->fields.dim); 
    71367136        for (size_t i = 0; i < sym->fields.dim; i++) 
    71377137        {   VarDeclaration *v = (VarDeclaration *)sym->fields.data[i]; 
     7138            // Don't include hidden 'this' pointer 
     7139            if (v->isThisDeclaration()) 
     7140                continue; 
    71387141            Expression *fe = new DotVarExp(e->loc, e, v); 
    71397142            exps->push(fe); 
    71407143        } 
    71417144        e = new TupleExp(e->loc, exps); 
    71427145        sc = sc->push(); 
    71437146        sc->noaccesscheck = 1; 
    71447147        e = e->semantic(sc); 
    71457148        sc->pop(); 
    71467149        return e; 
    71477150    } 
    71487151 
    71497152    s = sym->search(e->loc, ident, 0); 
    71507153L1: 
    71517154    if (!s) 
    71527155    { 
    71537156        // See if it's a base class 
    71547157        ClassDeclaration *cbase; 
    71557158        for (cbase = sym->baseClass; cbase; cbase = cbase->baseClass) 
    71567159        { 
    71577160            if (cbase->ident->equals(ident))