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/statements.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/compile/statements.c') diff --git a/src/compile/statements.c b/src/compile/statements.c index 3fc44ac4..db8f5b1f 100644 --- a/src/compile/statements.c +++ b/src/compile/statements.c @@ -48,7 +48,7 @@ static Text_t _compile_statement(env_t *env, ast_t *ast) { type_t *t = decl->type ? parse_type_ast(env, decl->type) : get_type(env, decl->value); if (t->tag == FunctionType) t = Type(ClosureType, t); if (t->tag == AbortType || t->tag == VoidType || t->tag == ReturnType) - code_err(ast, "You can't declare a variable with a ", type_to_str(t), " value"); + code_err(ast, "You can't declare a variable with a ", type_to_text(t), " value"); Text_t val_code = compile_declared_value(env, ast); return Texts(compile_declaration(t, Texts("_$", name)), " = ", val_code, ";"); @@ -214,7 +214,7 @@ static Text_t _compile_statement(env_t *env, ast_t *ast) { // print("Is discardable: ", ast_to_sexp_str(ast), " ==> ", // is_discardable(env, ast)); if (!is_discardable(env, ast)) - code_err(ast, "The ", type_to_str(get_type(env, ast)), " result of this statement cannot be discarded"); + code_err(ast, "The ", type_to_text(get_type(env, ast)), " result of this statement cannot be discarded"); return Texts("(void)", compile(env, ast), ";"); } } -- cgit v1.2.3