Recursively check the datatype compatibility of values/expressions passed in function/FB invocations.
authormjsousa
Fri, 23 Aug 2013 12:06:08 +0100
changeset 847 079ab7d4b728
parent 846 24d0be6c31f7
child 848 db78824cec23
Recursively check the datatype compatibility of values/expressions passed in function/FB invocations.
stage3/print_datatypes_error.cc
--- a/stage3/print_datatypes_error.cc	Fri Aug 23 09:34:04 2013 +0100
+++ b/stage3/print_datatypes_error.cc	Fri Aug 23 12:06:08 2013 +0100
@@ -250,10 +250,12 @@
 					if (function_invocation_error)
 						/* when handling a IL function call, and an error is found in the first parameter, then we bug out and do not print out any more error messages. */
 						return;
-				}
-				else if (!get_datatype_info_c::is_type_valid(param_value->datatype)) {
-					function_invocation_error = true;
-					STAGE3_ERROR(0, param_value, param_value, "Data type incompatibility for value passed in position %d when invoking %s '%s'", i, POU_str, ((identifier_c *)fcall_data.function_name)->value);
+				} else {
+					if (!get_datatype_info_c::is_type_valid(param_value->datatype)) {
+						function_invocation_error = true;
+						STAGE3_ERROR(0, param_value, param_value, "Data type incompatibility for value passed in position %d when invoking %s '%s'", i, POU_str, ((identifier_c *)fcall_data.function_name)->value);
+					}
+					param_value->accept(*this);
 				}
 			}
 	}