aboutsummaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index 8ef7ab03..24c63bd1 100644
--- a/compile.c
+++ b/compile.c
@@ -4213,7 +4213,10 @@ CORD compile_function(env_t *env, ast_t *ast, CORD *staticdefs)
}
}
- CORD text = CORD_all("func ", Match(fndef->name, Var)->name, "(");
+ CORD qualified_name = Match(fndef->name, Var)->name;
+ if (env->namespace && env->namespace->parent && env->namespace->name)
+ qualified_name = CORD_all(env->namespace->name, ".", qualified_name);
+ CORD text = CORD_all("func ", qualified_name, "(");
for (arg_ast_t *arg = fndef->args; arg; arg = arg->next) {
text = CORD_cat(text, type_to_cord(get_arg_ast_type(env, arg)));
if (arg->next) text = CORD_cat(text, ", ");