diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/compile/files.c | 2 | ||||
| -rw-r--r-- | src/typecheck.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/compile/files.c b/src/compile/files.c index 3e91976b..4d6fb1a8 100644 --- a/src/compile/files.c +++ b/src/compile/files.c @@ -36,7 +36,7 @@ void initialize_vars_and_statics(env_t *env, ast_t *ast) { if (t->tag == FunctionType) t = Type(ClosureType, t); Text_t val_code = compile_declared_value(env, stmt->ast); if ((decl->value && !is_constant(env, decl->value)) || (!decl->value && has_heap_memory(t))) { - Text_t initialized_name = namespace_name(env, env->namespace, Texts(decl_name, "$initialized")); + Text_t initialized_name = namespace_name(env, env->namespace, Texts(decl_name, "$$initialized")); env->code->variable_initializers = Texts(env->code->variable_initializers, with_source_info(env, stmt->ast, diff --git a/src/typecheck.c b/src/typecheck.c index e34a85de..07f8aac4 100644 --- a/src/typecheck.c +++ b/src/typecheck.c @@ -606,6 +606,8 @@ type_t *get_function_type(env_t *env, ast_t *ast) { if (ast->tag == Lambda) { ast_t *body = Match(ast, Lambda)->body; + + scope->fn = NULL; type_t *ret_t = get_type(scope, body); if (ret_t->tag == ReturnType) ret_t = Match(ret_t, ReturnType)->ret; if (ret_t->tag == AbortType) ret_t = Type(VoidType); |
