comparison dmd/TypeStruct.d @ 85:8e69d041a99d

Previous commit didn't compile. Fixed.
author Eldar Insafutdinov <e.insafutdinov@gmail.com>
date Mon, 30 Aug 2010 16:16:30 +0100
parents be2ab491772e
children e28b18c23469
comparison
equal deleted inserted replaced
84:be2ab491772e 85:8e69d041a99d
514 override bool hasPointers() 514 override bool hasPointers()
515 { 515 {
516 StructDeclaration s = sym; 516 StructDeclaration s = sym;
517 517
518 sym.size(Loc(0)); // give error for forward references 518 sym.size(Loc(0)); // give error for forward references
519 foreach (Dsymbol sm; s.fields) 519 foreach (VarDeclaration sm; s.fields)
520 { 520 {
521 Declaration d = sm.isDeclaration(); 521 Declaration d = sm.isDeclaration();
522 if (d.storage_class & STC.STCref || d.hasPointers()) 522 if (d.storage_class & STC.STCref || d.hasPointers())
523 return true; 523 return true;
524 } 524 }
540 m = MATCHconst; 540 m = MATCHconst;
541 else 541 else
542 { /* Check all the fields. If they can all be converted, 542 { /* Check all the fields. If they can all be converted,
543 * allow the conversion. 543 * allow the conversion.
544 */ 544 */
545 foreach (Dsymbol s; sym.fields) 545 foreach (VarDeclaration v; sym.fields)
546 { 546 {
547 VarDeclaration v = s.isVarDeclaration();
548 assert(v && v.storage_class & STCfield); 547 assert(v && v.storage_class & STCfield);
549 548
550 // 'from' type 549 // 'from' type
551 Type tvf = v.type.addMod(mod); 550 Type tvf = v.type.addMod(mod);
552 551