# HG changeset patch
# User Mario de Sousa <msousa@fe.up.pt>
# Date 1334587212 -3600
# Node ID c2880eba49a1286a1134521301fdca368514af06
# Parent  99aa36a77703f3631b9f6069bee3f97b81a37681
Fix printing of data type errors in while and repeat statements.

diff -r 99aa36a77703 -r c2880eba49a1 stage3/print_datatypes_error.cc
--- a/stage3/print_datatypes_error.cc	Mon Apr 16 15:27:53 2012 +0100
+++ b/stage3/print_datatypes_error.cc	Mon Apr 16 15:40:12 2012 +0100
@@ -1249,7 +1249,7 @@
 
 void *print_datatypes_error_c::visit(while_statement_c *symbol) {
 	symbol->expression->accept(*this);
-	if (symbol->candidate_datatypes.size() != 1) {
+	if (!is_type_valid(symbol->expression->datatype)) {
 		STAGE3_ERROR(0, symbol, symbol, "Invalid data type for 'WHILE' condition.");
 		return NULL;
 	}
@@ -1259,7 +1259,7 @@
 }
 
 void *print_datatypes_error_c::visit(repeat_statement_c *symbol) {
-	if (symbol->candidate_datatypes.size() != 1) {
+	if (!is_type_valid(symbol->expression->datatype)) {
 		STAGE3_ERROR(0, symbol, symbol, "Invalid data type for 'REPEAT' condition.");
 		return NULL;
 	}