Fixed another, 50 tests passing

This commit is contained in:
Nathan Braswell
2016-03-07 20:17:23 -05:00
parent d62da74aa7
commit 9eb5db84ab
2 changed files with 5 additions and 2 deletions

View File

@@ -950,7 +950,7 @@ fun unify_type(template_type: *tree<symbol>, param_type: *type, new_map: *map<st
println(param_type->parameter_types.size)
return;
}
for (var i = 0; i < template_function_types.size; i++;)
for (var i = 0; i < template_function_types.size-1; i++;)
unify_type(template_function_types[i], param_type->parameter_types[i], new_map, template_replacements)
unify_type(template_function_types.last(), param_type->return_type, new_map, template_replacements)
} else {

View File

@@ -598,7 +598,10 @@ obj c_generator (Object) {
call_string.value = ""
} else {
var func_type = get_ast_type(node->function_call.func)
call_string.pre += string("if (")+func_name+".data) " + pre_call + " = ((" + type_to_c(func_type) + "_with_data) "+func_name+".func)("+func_name +".data," + call_string.value + ");\n"
call_string.pre += string("if (")+func_name+".data) " + pre_call + " = ((" + type_to_c(func_type) + "_with_data) "+func_name+".func)("+func_name +".data"
if (call_string.value != "")
call_string.pre += string(",") + call_string.value
call_string.pre += ");\n"
call_string.pre += string("else ") + pre_call + " = ((" + type_to_c(func_type) + "_without_data) " + func_name+".func)(" + call_string.value + ");\n"
call_string.value = pre_call
}