aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-05-07 11:42:48 +0100
committergingerBill <bill@gingerbill.org>2024-05-07 11:42:48 +0100
commit0da6a3e214c66e2955307e2aad12d844a051f8d8 (patch)
tree4440453fe498dd2c4957a9bda42ddf38d9637637 /src/parser.cpp
parent05a17048982dea73ac0c7db1e743582abf73233b (diff)
Fix #3530
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index 2bf25c768..04505cbd7 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -3499,6 +3499,10 @@ gb_internal Ast *parse_type(AstFile *f) {
Token token = advance_token(f);
syntax_error(token, "Expected a type");
return ast_bad_expr(f, token, f->curr_token);
+ } else if (type->kind == Ast_ParenExpr &&
+ unparen_expr(type) == nullptr) {
+ syntax_error(type, "Expected a type within the parentheses");
+ return ast_bad_expr(f, type->ParenExpr.open, type->ParenExpr.close);
}
return type;
}