diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2020-12-18 14:19:03 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-18 14:19:03 +0100 |
| commit | bd6ead32f8d05a9662c7fa6fde867b71da0e79c9 (patch) | |
| tree | e610f06a230cca9d89bf075ec55e520dae83ad8e /src/check_decl.cpp | |
| parent | 934809397f1f5f567c0ec668de72d2ac28e85f74 (diff) | |
| parent | 3558848da818dc330d139ff5d756bb9b9498b1d4 (diff) | |
Merge pull request #1 from odin-lang/master
update from master
Diffstat (limited to 'src/check_decl.cpp')
| -rw-r--r-- | src/check_decl.cpp | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp index 5234955fb..9f8f460ba 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -168,18 +168,6 @@ void check_init_constant(CheckerContext *ctx, Entity *e, Operand *operand) { return; } -#if 0 - if (!is_type_constant_type(operand->type)) { - gbString type_str = type_to_string(operand->type); - error(operand->expr, "Invalid constant type: '%s'", type_str); - gb_string_free(type_str); - if (e->type == nullptr) { - e->type = t_invalid; - } - return; - } -#endif - if (e->type == nullptr) { // NOTE(bill): type inference e->type = operand->type; } @@ -388,15 +376,7 @@ void check_const_decl(CheckerContext *ctx, Entity *e, Ast *type_expr, Ast *init, e->flags |= EntityFlag_Visited; if (type_expr) { - Type *t = check_type(ctx, type_expr); - if (!is_type_constant_type(t) && !is_type_proc(t)) { - gbString str = type_to_string(t); - error(type_expr, "Invalid constant type '%s'", str); - gb_string_free(str); - e->type = t_invalid; - return; - } - e->type = t; + e->type = check_type(ctx, type_expr); } Operand operand = {}; |