Mercurial > projects > ddmd
diff dmd/NewDeclaration.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/NewDeclaration.d Sun Oct 17 07:42:00 2010 +0400 +++ b/dmd/NewDeclaration.d Sun Oct 17 20:56:07 2010 +0400 @@ -45,20 +45,18 @@ override void semantic(Scope sc) { - ClassDeclaration cd; - Type tret; - //printf("NewDeclaration.semantic()\n"); parent = sc.parent; Dsymbol parent = toParent(); - cd = parent.isClassDeclaration(); + ClassDeclaration cd = parent.isClassDeclaration(); if (!cd && !parent.isStructDeclaration()) { error("new allocators only are for class or struct definitions"); } - tret = Type.tvoid.pointerTo(); - type = new TypeFunction(arguments, tret, varargs, LINKd); + Type tret = Type.tvoid.pointerTo(); + if (!type) + type = new TypeFunction(arguments, tret, varargs, LINKd); type = type.semantic(loc, sc); assert(type.ty == Tfunction);