stage3/fill_candidate_datatypes.cc
changeset 456 ca8d98289ff9
parent 455 933c0dccc82f
child 457 67d8b07bac22
equal deleted inserted replaced
455:933c0dccc82f 456:ca8d98289ff9
   281 	 * more informative error messages!
   281 	 * more informative error messages!
   282 	 */
   282 	 */
   283 	called_fb_declaration = fb_decl;
   283 	called_fb_declaration = fb_decl;
   284 
   284 
   285 	/* This implicit FB call does not change the value stored in the current/default IL variable */
   285 	/* This implicit FB call does not change the value stored in the current/default IL variable */
       
   286 	/* It does, however, require that the datatype be compatible with the input parameter of the FB being called. 
       
   287 	 * If we were to follow the filling & narrowing algorithm correctly (implemented in fill_candidate_datatypes_c
       
   288 	 * & narrow_candidate_datatypes_c respectively), we should be restricting the candidate_datatpes to the datatypes
       
   289 	 * that are compatible to the FB call. 
       
   290 	 * However, doing the above will often result in some very confusing error messages for the user, especially in the case
       
   291 	 * in which the FB call is wrong, so the resulting cadidate datatypes is an empty list. In this case, the user would see
       
   292 	 * many error messages related to the IL instructions that follow the FB call, even though those IL instructions may be perfectly
       
   293 	 * correct.
       
   294 	 * For now, we will simply let the narrow_candidate_datatypes_c verify if the datatypes are compatible (something that should be done
       
   295 	 * here).
       
   296 	 */
   286 	if (NULL != prev_il_instruction)
   297 	if (NULL != prev_il_instruction)
   287 		copy_candidate_datatype_list(prev_il_instruction/*from*/, il_instruction/*to*/);
   298 		copy_candidate_datatype_list(prev_il_instruction/*from*/, il_instruction/*to*/);
   288 
   299 
   289 	if (debug) std::cout << "handle_implicit_il_fb_call() [" << prev_il_instruction->candidate_datatypes.size() << "] ==> " << il_instruction->candidate_datatypes.size() << " result.\n";
   300 	if (debug) std::cout << "handle_implicit_il_fb_call() [" << prev_il_instruction->candidate_datatypes.size() << "] ==> " << il_instruction->candidate_datatypes.size() << " result.\n";
   290 }
   301 }