Index: src/CodeGen/CodeGenerator.cc
===================================================================
--- src/CodeGen/CodeGenerator.cc	(revision 786c438b7ede9e0327c4a0d66bff7a3af842d2d8)
+++ src/CodeGen/CodeGenerator.cc	(revision 3e5439987bdaca8e3f69edabd5a99bb0e41316b1)
@@ -348,5 +348,5 @@
 				des->accept( *visitor );
 			} else {
-				// otherwise, it has to be a ConstantExpr or CastExpr, initializing array eleemnt
+				// otherwise, it has to be a ConstantExpr or CastExpr, initializing array element
 				output << "[";
 				des->accept( *visitor );
@@ -662,4 +662,8 @@
 			output << opInfo->symbol;
 		} else {
+			if (dynamic_cast<EnumInstType *>(variableExpr->get_var()->get_type()) 
+			&& dynamic_cast<EnumInstType *>(variableExpr->get_var()->get_type())->baseEnum->base) {
+				output << '(' <<genType(dynamic_cast<EnumInstType *>(variableExpr->get_var()->get_type())->baseEnum->base, "", options) << ')';
+			}
 			output << mangleName( variableExpr->get_var() );
 		} // if
