diff dmd/TemplateInstance.d @ 96:acd69f84627e

further work
author Trass3r
date Tue, 31 Aug 2010 02:12:15 +0200
parents 21a53563c840
children 12c0c84d13fd
line wrap: on
line diff
--- a/dmd/TemplateInstance.d	Mon Aug 30 23:08:44 2010 +0200
+++ b/dmd/TemplateInstance.d	Tue Aug 31 02:12:15 2010 +0200
@@ -1255,21 +1255,18 @@
 			else if (sa)
 			{
 			  Lsa:
-				Declaration d = null;
 				TemplateDeclaration td = sa.isTemplateDeclaration();
-				if (td && td.literal)
-				{
-					goto L2;
-				}
-				d = sa.isDeclaration();
-				if (d && !d.isDataseg() &&
-///		version (DMDV2) {
+				Declaration d = sa.isDeclaration();
+				if ((td && td.literal) ||
+					(d && !d.isDataseg() &&
+
+///		version (DMDV2) { // TODO:
 					!(d.storage_class & STCmanifest) &&
 ///		}
 					(!d.isFuncDeclaration() || d.isFuncDeclaration().isNested()) &&
-					!isTemplateMixin())
+					!isTemplateMixin()
+					))
 				{
-					 L2:
 					// if module level template
 					if (tempdecl.toParent().isModule())
 					{   
@@ -1321,13 +1318,11 @@
     Identifier genIdent()
 	{
 		scope OutBuffer buf = new OutBuffer();
-		string id;
-		Objects args;
 
 		//printf("TemplateInstance.genIdent('%s')\n", tempdecl.ident.toChars());
-		id = tempdecl.ident.toChars();
+		string id = tempdecl.ident.toChars();
 		buf.printf("__T%d%s", id.length, id);	///!
-		args = tiargs;
+		Objects args = tiargs;
 		for (int i = 0; i < args.dim; i++)
 		{   
 			Object o = cast(Object)args.data[i];