aboutsummaryrefslogtreecommitdiff
path: root/src/compile/statements.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-12-06 14:55:00 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-12-06 14:55:00 -0500
commit48491f94c96615e8055bcf72ed9009b1d921467f (patch)
treeb30b934d71ca14a7f9602282c35d2f2c137d902a /src/compile/statements.c
parenta13b39f1e1ea220a868d99508796d06492a40611 (diff)
Use `foo!` as sugar for `foo.FirstTag!` for enum values. Also, give
better error messages for this kind of `!` assertion.
Diffstat (limited to 'src/compile/statements.c')
-rw-r--r--src/compile/statements.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compile/statements.c b/src/compile/statements.c
index 4bb8b432..01fb1a0b 100644
--- a/src/compile/statements.c
+++ b/src/compile/statements.c
@@ -219,7 +219,9 @@ static Text_t _compile_statement(env_t *env, ast_t *ast) {
case Metadata: return EMPTY_TEXT;
default:
if (!is_discardable(env, ast))
- code_err(ast, "The ", type_to_text(get_type(env, ast)), " result of this statement cannot be discarded");
+ code_err(
+ ast, "The ", type_to_text(get_type(env, ast)),
+ " value of this statement is implicitly ignored. \n Use `_ := ` if you want to explicitly discard it.");
return Texts("(void)", compile(env, ast), ";");
}
}