aboutsummaryrefslogtreecommitdiff
path: root/src/checker/stmt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/checker/stmt.cpp')
-rw-r--r--src/checker/stmt.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/checker/stmt.cpp b/src/checker/stmt.cpp
index 341a74c4f..88fb32b4c 100644
--- a/src/checker/stmt.cpp
+++ b/src/checker/stmt.cpp
@@ -429,14 +429,14 @@ void check_const_decl(Checker *c, Entity *e, AstNode *type_expr, AstNode *init_e
if (type_expr) {
Type *t = check_type(c, type_expr);
- if (!is_type_constant_type(t)) {
- gbString str = type_to_string(t);
- defer (gb_string_free(str));
- error(ast_node_token(type_expr),
- "Invalid constant type `%s`", str);
- e->type = t_invalid;
- return;
- }
+ // if (!is_type_constant_type(t)) {
+ // gbString str = type_to_string(t);
+ // defer (gb_string_free(str));
+ // error(ast_node_token(type_expr),
+ // "Invalid constant type `%s`", str);
+ // e->type = t_invalid;
+ // return;
+ // }
e->type = t;
}
@@ -460,9 +460,7 @@ void check_type_decl(Checker *c, Entity *e, AstNode *type_expr, Type *def, Cycle
if (cycle_checker == NULL) {
cycle_checker = &local_cycle_checker;
}
- defer (if (local_cycle_checker.path != NULL) {
- gb_array_free(local_cycle_checker.path);
- });
+ defer (cycle_checker_destroy(&local_cycle_checker));
Type *bt = check_type(c, type_expr, named, cycle_checker_add(cycle_checker, e));
named->Named.base = bt;