diff --git a/PExpr.cc b/PExpr.cc index 1a76ee5db..1a151bc3f 100644 --- a/PExpr.cc +++ b/PExpr.cc @@ -382,12 +382,11 @@ PEIdent::~PEIdent() static bool find_enum_constant(LexicalScope*scope, perm_string name) { - std::any_of(scope->enum_sets.cbegin(), scope->enum_sets.cend(), - [name](const enum_type_t *cur) { + return std::any_of(scope->enum_sets.cbegin(), scope->enum_sets.cend(), + [name](const enum_type_t *cur) { return std::any_of(cur->names->cbegin(), cur->names->cend(), [name](const named_pexpr_t idx){return idx.name == name;}); }); - return false; } void PEIdent::declare_implicit_nets(LexicalScope*scope, NetNet::Type type)