Fix cyclic polymorphic procedure usage and improve its error message

This commit is contained in:
gingerBill
2018-06-15 22:49:06 +01:00
parent ba67e474d3
commit cd7e260f4e
4 changed files with 91 additions and 29 deletions
+6 -1
View File
@@ -401,6 +401,11 @@ void check_struct_type(CheckerContext *ctx, Type *struct_type, AstNode *node, Ar
is_poly_specialized = false;
break;
}
if (struct_type == o.type) {
// NOTE(bill): Cycle
is_poly_specialized = false;
break;
}
}
}
@@ -604,7 +609,7 @@ void check_enum_type(CheckerContext *ctx, Type *enum_type, Type *named_type, Ast
if (et->is_export) {
Scope *parent = ctx->scope->parent;
if (parent->is_file) {
// NOTE(bhall): Use package scope
// NOTE(bill): Use package scope
parent = parent->parent;
}
for_array(i, fields) {