From aa15f0f78214cefa9fabace61c119e01812a3050 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 6 Sep 2025 13:51:18 -0400 Subject: Refactor a bit in order to catch issue with ConvertDefs creating infinite loops --- src/compile/files.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/compile/files.c') diff --git a/src/compile/files.c b/src/compile/files.c index a6af2300..c250e6cc 100644 --- a/src/compile/files.c +++ b/src/compile/files.c @@ -95,13 +95,13 @@ static Text_t compile_top_level_code(env_t *env, ast_t *ast) { return compile_function(env, name_code, ast, &env->code->staticdefs); } case ConvertDef: { - type_t *type = get_function_def_type(env, ast); - const char *name = get_type_name(Match(type, FunctionType)->ret); + type_t *type = get_function_return_type(env, ast); + const char *name = get_type_name(type); if (!name) code_err(ast, "Conversions are only supported for text, struct, and enum " "types, not ", - type_to_str(Match(type, FunctionType)->ret)); + type_to_str(type)); Text_t name_code = namespace_name(env, env->namespace, Texts(name, "$", get_line_number(ast->file, ast->start))); return compile_function(env, name_code, ast, &env->code->staticdefs); -- cgit v1.2.3