aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-06-15 22:49:06 +0100
committergingerBill <bill@gingerbill.org>2018-06-15 22:49:06 +0100
commitcd7e260f4e77ea992115b3dd26d7b92d99bae0f7 (patch)
tree83bbc57ba87aeab46be080709023a9db9df5553f /src/check_type.cpp
parentba67e474d3ab48cf15916892a15759f50930f72f (diff)
Fix cyclic polymorphic procedure usage and improve its error message
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index 7751dca59..9a2493aed 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -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) {