summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-07-10 16:57:22 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-07-10 16:57:22 -0400
commit2aea7ec331f80c72822dedfa2c9c0054a72975d1 (patch)
treef0aed7b0f01f6ebe123b5e63cf8814ebba3cff1e
parent2978835a86ef7041f0ff0367882c0d4e82b17635 (diff)
note
-rw-r--r--types.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/types.c b/types.c
index fc877af..a008832 100644
--- a/types.c
+++ b/types.c
@@ -2263,7 +2263,7 @@ static Status types_expr(Typer *tr, Expression *e) {
expr->kind = EXPR_VAL;
expr->flags = EXPR_FOUND_TYPE;
expr->val = arg_val;
- param_decl->expr = *expr;
+ param_decl->expr = *expr; /* this is so that an error occurs if the type of expr doesn't match param_decl->type (we can't check here because param_decl->type isn't resolved yet) */
param_decl->flags |= DECL_FOUND_VAL|DECL_HAS_EXPR;
copy_val(tr->allocr, &param_decl->val, arg_val, type);
if (!(param_decl->flags & DECL_ANNOTATES_TYPE)) {