# HG changeset patch
# User Mario de Sousa <msousa@fe.up.pt>
# Date 1358093160 0
# Node ID d21e598b0b75c7dbd74cc30d4d1e4270d770c03c
# Parent  3444c331efc91004fd6b222dd198eef72fdcb6aa
Set the symbol->datatpe of function_declaration_c

diff -r 3444c331efc9 -r d21e598b0b75 stage3/narrow_candidate_datatypes.cc
--- a/stage3/narrow_candidate_datatypes.cc	Sun Jan 13 14:25:38 2013 +0000
+++ b/stage3/narrow_candidate_datatypes.cc	Sun Jan 13 16:06:00 2013 +0000
@@ -716,6 +716,10 @@
 /* B 1.5.1 Functions */
 /*********************/
 void *narrow_candidate_datatypes_c::visit(function_declaration_c *symbol) {
+	/* set the function_declaration_c->datatype to the datatype returned by the function! */
+	symbol->type_name->datatype = search_base_type_c::get_basetype_decl(symbol->type_name);
+	symbol->datatype = symbol->type_name->datatype;
+	
 	search_varfb_instance_type = new search_varfb_instance_type_c(symbol);
 	symbol->var_declarations_list->accept(*this);
 	if (debug) printf("Narrowing candidate data types list in body of function %s\n", ((token_c *)(symbol->derived_function_name))->value);