stage3/narrow_candidate_datatypes.cc
changeset 472 d26759a2274a
parent 470 d2cd05c5e01a
child 478 b13feab3b918
--- a/stage3/narrow_candidate_datatypes.cc	Sat Mar 10 11:21:04 2012 +0000
+++ b/stage3/narrow_candidate_datatypes.cc	Sat Mar 10 11:21:41 2012 +0000
@@ -889,7 +889,7 @@
 	/* if the next IL instructions needs us to provide a datatype other than a bool, 
 	 * then we have an internal compiler error - most likely in fill_candidate_datatypes_c 
 	 */
-	if ((NULL != symbol->datatype) && (!is_type(symbol->datatype, bool_type_name_c))) ERROR;
+	if ((NULL != symbol->datatype) && (!is_ANY_BOOL_compatible(symbol->datatype))) ERROR;
 	if (symbol->candidate_datatypes.size() > 1) ERROR;
 
 	/* NOTE: If there is no IL instruction following this CALC, CALCN, JMPC, JMPC, ..., instruction,
@@ -898,7 +898,7 @@
 	 */
 	if (symbol->candidate_datatypes.size() == 0)    symbol->datatype = NULL;
 	else    symbol->datatype = symbol->candidate_datatypes[0]; /* i.e. a bool_type_name_c! */
-	if ((NULL != symbol->datatype) && (!is_type(symbol->datatype, bool_type_name_c))) ERROR;
+	if ((NULL != symbol->datatype) && (!is_ANY_BOOL_compatible(symbol->datatype))) ERROR;
 
 	/* set the required datatype of the previous IL instruction, i.e. a bool_type_name_c! */
 	set_datatype_in_prev_il_instructions(symbol->datatype, fake_prev_il_instruction);
@@ -1400,7 +1400,7 @@
 
 void *narrow_candidate_datatypes_c::visit(if_statement_c *symbol) {
 	for(unsigned int i = 0; i < symbol->expression->candidate_datatypes.size(); i++) {
-		if (is_type(symbol->expression->candidate_datatypes[i], bool_type_name_c))
+		if (is_ANY_BOOL_compatible(symbol->expression->candidate_datatypes[i]))
 			symbol->expression->datatype = symbol->expression->candidate_datatypes[i];
 	}
 	symbol->expression->accept(*this);
@@ -1416,7 +1416,7 @@
 
 void *narrow_candidate_datatypes_c::visit(elseif_statement_c *symbol) {
 	for (unsigned int i = 0; i < symbol->expression->candidate_datatypes.size(); i++) {
-		if (is_type(symbol->expression->candidate_datatypes[i], bool_type_name_c))
+		if (is_ANY_BOOL_compatible(symbol->expression->candidate_datatypes[i]))
 			symbol->expression->datatype = symbol->expression->candidate_datatypes[i];
 	}
 	symbol->expression->accept(*this);