Fix IR print bug for empty structs;

This commit is contained in:
gingerBill
2017-07-28 11:35:01 +01:00
parent f0980c0a98
commit 28be0ad69b
5 changed files with 29 additions and 11 deletions
+2 -1
View File
@@ -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");