aboutsummaryrefslogtreecommitdiff
path: root/src/checker.cpp
diff options
context:
space:
mode:
authorgingerBill <bill+github@gingerbill.org>2017-07-28 11:35:01 +0100
committergingerBill <bill+github@gingerbill.org>2017-07-28 11:35:01 +0100
commit28be0ad69b98868c5a77f0fe9d2898391b1ac400 (patch)
tree74ca2ff1efd92e544054afe7b6984b0440c147d2 /src/checker.cpp
parentf0980c0a98aad1ce4712197e98608e0b1a886a44 (diff)
Fix IR print bug for empty structs;
Diffstat (limited to 'src/checker.cpp')
-rw-r--r--src/checker.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/checker.cpp b/src/checker.cpp
index 4c77f25ee..f5528a022 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -1733,7 +1733,8 @@ void check_collect_entities(Checker *c, Array<AstNode *> nodes, bool is_file_sco
DeclInfo *d = make_declaration_info(c->allocator, c->context.scope, c->context.decl);
Entity *e = nullptr;
- if (is_ast_node_type(init)) {
+ if (is_ast_node_type(init) ||
+ (vd->type != nullptr && vd->type->kind == AstNode_TypeType)) {
e = make_entity_type_name(c->allocator, d->scope, token, nullptr);
if (vd->type != nullptr) {
error(name, "A type declaration cannot have an type parameter");