diff options
Diffstat (limited to 'boot/semantic.cc')
| -rw-r--r-- | boot/semantic.cc | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/boot/semantic.cc b/boot/semantic.cc index cd50742..bc7c2d2 100644 --- a/boot/semantic.cc +++ b/boot/semantic.cc @@ -272,15 +272,18 @@ namespace elna::boot for (auto& field : fields) { - if (field_names.find(field.first) != field_names.cend()) + field.second->accept(this); + for (auto& field_name : field.first) { - add_error<field_duplication_error>(field.first, field.second->position()); - } - else - { - field_names.insert(field.first); - field.second->accept(this); - result.push_back(std::make_pair(field.first, this->current_type)); + if (field_names.find(field_name) != field_names.cend()) + { + add_error<field_duplication_error>(field_name, field.second->position()); + } + else + { + field_names.insert(field_name); + result.push_back(std::make_pair(field_name, this->current_type)); + } } } return result; |
