aboutsummaryrefslogtreecommitdiff
path: root/src/checker.cpp
diff options
context:
space:
mode:
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 47b720736..d8da08dc9 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -1734,7 +1734,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");