diff options
| author | gingerBill <bill@gingerbill.org> | 2022-03-14 12:28:28 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-03-14 12:28:28 +0000 |
| commit | 286549693eb2e7b216effba01d9aa192eab78d12 (patch) | |
| tree | 9a84e375fbf1ad80e76d5f641bcffa17d10e6f2e /src/check_decl.cpp | |
| parent | ffe6d81ecd3169d2cadd112fa878872ed5acd8bf (diff) | |
Fix `#1609`
Diffstat (limited to 'src/check_decl.cpp')
| -rw-r--r-- | src/check_decl.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp index 12b0e43cb..d4a320f03 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -440,6 +440,12 @@ void check_const_decl(CheckerContext *ctx, Entity *e, Ast *type_expr, Ast *init, if (type_expr) { e->type = check_type(ctx, type_expr); + if (are_types_identical(e->type, t_typeid)) { + e->type = nullptr; + e->kind = Entity_TypeName; + check_type_decl(ctx, e, init, named_type); + return; + } } Operand operand = {}; |