This commit is contained in:
gingerBill
2024-05-07 11:42:48 +01:00
parent 05a1704898
commit 0da6a3e214
2 changed files with 11 additions and 2 deletions

View File

@@ -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;
}