aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorDaniel Gavin <danielgavin5@hotmail.com>2021-04-19 02:13:29 +0200
committerDaniel Gavin <danielgavin5@hotmail.com>2021-04-19 02:13:29 +0200
commitc708f649ece3859306765964b22eba6302a1cd34 (patch)
tree486743fccc01b2f9e15ac5c2e471f046047f922b /src/check_type.cpp
parentf7b8b3a3400a28c4f35a6e10885bb0f0142441c8 (diff)
parentae04af4e4ed4ecd521e1a915edd5b8637b1f40ce (diff)
Merge remote-tracking branch 'upstream/master' into prototype-fmt
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index 8420c4687..39fea75db 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -731,6 +731,7 @@ void check_enum_type(CheckerContext *ctx, Type *enum_type, Type *named_type, Ast
Ast *field = et->fields[i];
Ast *ident = nullptr;
Ast *init = nullptr;
+ u32 entity_flags = 0;
if (field->kind == Ast_FieldValue) {
ast_node(fv, FieldValue, field);
if (fv->field == nullptr || fv->field->kind != Ast_Ident) {
@@ -764,6 +765,7 @@ void check_enum_type(CheckerContext *ctx, Type *enum_type, Type *named_type, Ast
}
} else {
iota = exact_binary_operator_value(Token_Add, iota, exact_value_i64(1));
+ entity_flags |= EntityConstantFlag_ImplicitEnumValue;
}
@@ -800,6 +802,7 @@ void check_enum_type(CheckerContext *ctx, Type *enum_type, Type *named_type, Ast
e->identifier = ident;
e->flags |= EntityFlag_Visited;
e->state = EntityState_Resolved;
+ e->Constant.flags |= entity_flags;
if (scope_lookup_current(ctx->scope, name) != nullptr) {
error(ident, "'%.*s' is already declared in this enumeration", LIT(name));
@@ -2461,7 +2464,6 @@ bool check_procedure_type(CheckerContext *ctx, Type *type, Ast *proc_type_node,
type->Proc.specialization_count = specialization_count;
type->Proc.diverging = pt->diverging;
type->Proc.optional_ok = optional_ok;
- type->Proc.tags = pt->tags;
if (param_count > 0) {
Entity *end = params->Tuple.variables[param_count-1];