stage3/print_datatypes_error.cc
changeset 549 af9517cad953
parent 514 c2880eba49a1
child 550 322f063daa9f
--- a/stage3/print_datatypes_error.cc	Wed May 09 23:04:03 2012 +0100
+++ b/stage3/print_datatypes_error.cc	Wed May 09 20:05:57 2012 +0200
@@ -591,8 +591,13 @@
 
 /* subscript_list ',' subscript */
 // SYM_LIST(subscript_list_c)
-/* NOTE: we inherit from iterator visitor, so we do not need to implement this method... */
-// void *print_datatypes_error_c::visit(subscript_list_c *symbol)
+void *print_datatypes_error_c::visit(subscript_list_c *symbol) {
+	for (int i = 0; i < symbol->n; i++) {
+		if (NULL == symbol->elements[i]->datatype)
+			STAGE3_ERROR(0, symbol, symbol, "Invalid data type for array subscript field.");
+	}
+	return NULL;
+}
 
 
 /*  record_variable '.' field_selector */