diff dmd/interpret/Util.d @ 135:af1bebfd96a4 dmd2037

dmd 2.038
author Eldar Insafutdinov <e.insafutdinov@gmail.com>
date Mon, 13 Sep 2010 22:19:42 +0100
parents e28b18c23469
children fe2e1b93e88f
line wrap: on
line diff
--- a/dmd/interpret/Util.d	Sat Sep 11 13:03:39 2010 +0100
+++ b/dmd/interpret/Util.d	Mon Sep 13 22:19:42 2010 +0100
@@ -140,7 +140,7 @@
 	if (v)
 	{
 ///version (DMDV2) {
-		if ((v.isConst() || v.isInvariant() || v.storage_class & STCmanifest) && v.init && !v.value)
+		if ((v.isConst() || v.isImmutable() || v.storage_class & STCmanifest) && v.init && !v.value)
 ///} else {
 ///	if (v.isConst() && v.init)
 ///}
@@ -152,7 +152,7 @@
 		else
 		{   
 			e = v.value;
-			if (v.isDataseg())
+			if (v.isCTFE())
 			{	
 				error(loc, "static variable %s cannot be read at compile time", v.toChars());
 				e = EXP_CANT_INTERPRET;
@@ -232,24 +232,6 @@
 
 
 /********************************
- * Necessary because defaultInit() for a struct is a VarExp, not a StructLiteralExp.
- */
-StructLiteralExp createDefaultInitStructLiteral(Loc loc, StructDeclaration sym)
-{
-	Expressions structelems = new Expressions();
-	structelems.setDim(sym.fields.dim);
-	for (size_t j = 0; j < structelems.dim; j++)
-	{
-		structelems[j] = sym.fields[j].type.defaultInit(Loc(0));
-	}
-	StructLiteralExp structinit = new StructLiteralExp(loc, sym, structelems);
-	// Why doesn't the StructLiteralExp constructor do this, when
-	// sym.type != null ?
-	structinit.type = sym.type;
-	return structinit;
-}
-
-/********************************
  *  Add v to the istate list, unless it already exists there.
  */
 void addVarToInterstate(InterState istate, VarDeclaration v)