From f6589d9814e2e26bee9b7941a23b4bef68582f2f Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Sun, 2 Oct 2016 21:45:24 +0100 Subject: Refactor: Remove dead code --- src/checker/stmt.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/checker/stmt.cpp') 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; -- cgit v1.2.3