Index: src/ResolvExpr/CurrentObject.cc
===================================================================
--- src/ResolvExpr/CurrentObject.cc	(revision 5cbacf10c007573bb52e9dbace6bc7d304c98b78)
+++ src/ResolvExpr/CurrentObject.cc	(revision ba4a1d8c09106fcb307f09f287e5b399769b864c)
@@ -150,23 +150,10 @@
 
 	private:
-		void setSize( Expression * expr ) {
-			if ( ConstantExpr * constExpr = dynamic_cast< ConstantExpr * >( expr ) ) {
-				try {
-					size = constExpr->intValue();
-					PRINT( std::cerr << "array type with size: " << size << std::endl; )
-				} catch ( SemanticErrorException & ) {
-					SemanticError( expr, "Constant expression of non-integral type in array dimension: " );
-				}
-			}	else if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( expr ) ) {
-				setSize( castExpr->get_arg() ); // xxx - need to perform the conversion specified by the cast
-			} else if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( expr ) ) {
-				if ( EnumInstType * inst = dynamic_cast< EnumInstType * > ( varExpr->result ) ) {
-					long long int value;
-					if ( inst->baseEnum->valueOf( varExpr->var, value ) ) {
-						size = value;
-					}
-				}
+		void setSize( Expression * expr ) { // replace this logic with an eval call
+			auto res = eval(expr);
+			if (res.second) {
+				size = res.first;
 			} else {
-				assertf( false, "unhandled expression in setSize: %s", toString( expr ).c_str() ); // xxx - if not a constant expression, it's not simple to determine how long the array actually is, which is necessary for initialization to be done correctly -- fix this
+				SemanticError( expr->location, toString("Array designator must be a constant expression: ", expr) );
 			}
 		}
