comparison dmd/class.c @ 658:50383e476c7e

Upgraded frontend to DMD 1.035
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Mon, 06 Oct 2008 16:22:11 +0200
parents aaade6ded589
children 69a5e4a6fc0f
comparison
equal deleted inserted replaced
657:c42173b3557b 658:50383e476c7e
475 { // Use the base class's 'this' member 475 { // Use the base class's 'this' member
476 isnested = 1; 476 isnested = 1;
477 if (storage_class & STCstatic) 477 if (storage_class & STCstatic)
478 error("static class cannot inherit from nested class %s", baseClass->toChars()); 478 error("static class cannot inherit from nested class %s", baseClass->toChars());
479 if (toParent2() != baseClass->toParent2()) 479 if (toParent2() != baseClass->toParent2())
480 error("super class %s is nested within %s, not %s", 480 {
481 if (toParent2())
482 {
483 error("is nested within %s, but super class %s is nested within %s",
484 toParent2()->toChars(),
481 baseClass->toChars(), 485 baseClass->toChars(),
482 baseClass->toParent2()->toChars(), 486 baseClass->toParent2()->toChars());
483 toParent2()->toChars()); 487 }
488 else
489 {
490 error("is not nested, but super class %s is nested within %s",
491 baseClass->toChars(),
492 baseClass->toParent2()->toChars());
493 }
494 isnested = 0;
495 }
484 } 496 }
485 else if (!(storage_class & STCstatic)) 497 else if (!(storage_class & STCstatic))
486 { Dsymbol *s = toParent2(); 498 { Dsymbol *s = toParent2();
487 if (s) 499 if (s)
488 { 500 {
577 589
578 /* Look for special member functions. 590 /* Look for special member functions.
579 * They must be in this class, not in a base class. 591 * They must be in this class, not in a base class.
580 */ 592 */
581 ctor = (CtorDeclaration *)search(0, Id::ctor, 0); 593 ctor = (CtorDeclaration *)search(0, Id::ctor, 0);
582 if (ctor && ctor->toParent() != this) 594 if (ctor && (ctor->toParent() != this || !ctor->isCtorDeclaration()))
583 ctor = NULL; 595 ctor = NULL;
584 596
585 // dtor = (DtorDeclaration *)search(Id::dtor, 0); 597 // dtor = (DtorDeclaration *)search(Id::dtor, 0);
586 // if (dtor && dtor->toParent() != this) 598 // if (dtor && dtor->toParent() != this)
587 // dtor = NULL; 599 // dtor = NULL;