comparison dmd/declaration.c @ 1132:76e72fdef04d

Fix tuple declarations in aggregates.
author Christian Kamm <kamm incasoftware de>
date Mon, 23 Mar 2009 14:47:51 +0100
parents b30fe7e1dbb9
children 1860414bf3b7
comparison
equal deleted inserted replaced
1131:f2f13f111e2e 1132:76e72fdef04d
765 } 765 }
766 766
767 VarDeclaration *v = new VarDeclaration(loc, arg->type, id, ti); 767 VarDeclaration *v = new VarDeclaration(loc, arg->type, id, ti);
768 //printf("declaring field %s of type %s\n", v->toChars(), v->type->toChars()); 768 //printf("declaring field %s of type %s\n", v->toChars(), v->type->toChars());
769 v->semantic(sc); 769 v->semantic(sc);
770 770
771 /*
772 // removed for LDC since TupleDeclaration::toObj already creates the fields;
773 // adding them to the scope again leads to duplicates
771 if (sc->scopesym) 774 if (sc->scopesym)
772 { //printf("adding %s to %s\n", v->toChars(), sc->scopesym->toChars()); 775 { //printf("adding %s to %s\n", v->toChars(), sc->scopesym->toChars());
773 if (sc->scopesym->members) 776 if (sc->scopesym->members)
774 sc->scopesym->members->push(v); 777 sc->scopesym->members->push(v);
775 } 778 }
776 779 */
777 Expression *e = new DsymbolExp(loc, v); 780 Expression *e = new DsymbolExp(loc, v);
778 exps->data[i] = e; 781 exps->data[i] = e;
779 } 782 }
780 TupleDeclaration *v2 = new TupleDeclaration(loc, ident, exps); 783 TupleDeclaration *v2 = new TupleDeclaration(loc, ident, exps);
781 v2->isexp = 1; 784 v2->isexp = 1;