diff 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
line wrap: on
line diff
--- a/dmd/class.c	Mon Oct 06 14:37:00 2008 +0200
+++ b/dmd/class.c	Mon Oct 06 16:22:11 2008 +0200
@@ -477,10 +477,22 @@
 	    if (storage_class & STCstatic)
 		error("static class cannot inherit from nested class %s", baseClass->toChars());
 	    if (toParent2() != baseClass->toParent2())
-		error("super class %s is nested within %s, not %s",
+	    {
+		if (toParent2())
+		{
+		    error("is nested within %s, but super class %s is nested within %s",
+			toParent2()->toChars(),
 			baseClass->toChars(),
-			baseClass->toParent2()->toChars(),
-			toParent2()->toChars());
+			baseClass->toParent2()->toChars());
+		}
+		else
+		{
+		    error("is not nested, but super class %s is nested within %s",
+			baseClass->toChars(),
+			baseClass->toParent2()->toChars());
+		}
+		isnested = 0;
+	    }
 	}
 	else if (!(storage_class & STCstatic))
 	{   Dsymbol *s = toParent2();
@@ -579,7 +591,7 @@
      * They must be in this class, not in a base class.
      */
     ctor = (CtorDeclaration *)search(0, Id::ctor, 0);
-    if (ctor && ctor->toParent() != this)
+    if (ctor && (ctor->toParent() != this || !ctor->isCtorDeclaration()))
 	ctor = NULL;
 
 //    dtor = (DtorDeclaration *)search(Id::dtor, 0);