From f5612e38183dc20d18f207f8ab055574a4d93ad0 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 21 Sep 2025 15:14:37 -0400 Subject: Bugfixes for anonymous enums, code cleanup to remove type_to_string(), and changed it so anonymous enums show up in doctests with their full type instead of `enum$20` --- src/compile/declarations.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/compile/declarations.c') diff --git a/src/compile/declarations.c b/src/compile/declarations.c index 3f2164af..f1c59f73 100644 --- a/src/compile/declarations.c +++ b/src/compile/declarations.c @@ -32,7 +32,7 @@ Text_t compile_declared_value(env_t *env, ast_t *declare_ast) { type_t *t = decl->type ? parse_type_ast(env, decl->type) : get_type(env, decl->value); if (t->tag == AbortType || t->tag == VoidType || t->tag == ReturnType) - code_err(declare_ast, "You can't declare a variable with a ", type_to_str(t), " value"); + code_err(declare_ast, "You can't declare a variable with a ", type_to_text(t), " value"); if (decl->value) { Text_t val_code = compile_maybe_incref(env, decl->value, t); @@ -44,7 +44,7 @@ Text_t compile_declared_value(env_t *env, ast_t *declare_ast) { } else { Text_t val_code = compile_empty(t); if (val_code.length == 0) - code_err(declare_ast, "This type (", type_to_str(t), + code_err(declare_ast, "This type (", type_to_text(t), ") cannot be uninitialized. You must provide a value."); return val_code; } -- cgit v1.2.3