From 28be0ad69b98868c5a77f0fe9d2898391b1ac400 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Fri, 28 Jul 2017 11:35:01 +0100 Subject: Fix IR print bug for empty structs; --- src/checker.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/checker.cpp') 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 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"); -- cgit v1.2.3