diff dmd/DtorDeclaration.d @ 179:cd48cb899aee

Updated to dmd2.040
author korDen
date Sun, 17 Oct 2010 20:56:07 +0400
parents e3afd1303184
children b0d41ff5e0df
line wrap: on
line diff
--- a/dmd/DtorDeclaration.d	Sun Oct 17 07:42:00 2010 +0400
+++ b/dmd/DtorDeclaration.d	Sun Oct 17 20:56:07 2010 +0400
@@ -48,10 +48,11 @@
 		{
 			error("destructors are only for class/struct/union definitions, not %s %s", parent.kind(), parent.toChars());
 		}
-		else if (ident == Id.dtor)
+	    else if (ident == Id.dtor && semanticRun < PASSsemantic)
 			ad.dtors.push(this);
 
-		type = new TypeFunction(null, Type.tvoid, false, LINK.LINKd);
+	    if (!type)
+			type = new TypeFunction(null, Type.tvoid, false, LINK.LINKd);
 
 		sc = sc.push();
 		sc.stc &= ~STCstatic;		// not a static destructor