aboutsummaryrefslogtreecommitdiff
path: root/boot/name_analysis.cc
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-08-30 22:36:32 +0200
committerEugen Wissner <belka@caraus.de>2026-08-30 22:36:32 +0200
commit26a1b9ad9f347315bc14f2bf3ee064ede51794fc (patch)
tree64ecb7c41cb4b3f26ccbd216197c667d5cd8d8bd /boot/name_analysis.cc
parentdbca249757a98d6d56e23db43baa93ad30a91709 (diff)
downloadelna-26a1b9ad9f347315bc14f2bf3ee064ede51794fc.tar.gz
Fix record constructor for base records
Diffstat (limited to 'boot/name_analysis.cc')
-rw-r--r--boot/name_analysis.cc20
1 files changed, 6 insertions, 14 deletions
diff --git a/boot/name_analysis.cc b/boot/name_analysis.cc
index 620a32f..70b9031 100644
--- a/boot/name_analysis.cc
+++ b/boot/name_analysis.cc
@@ -385,23 +385,15 @@ namespace elna::boot
type resolving_visitor::lookup_field(const type& composite_type, const std::string& field_name)
{
- const type resolved_type = resolve_underlying_type(composite_type);
+ type record_field = elna::boot::lookup_field(composite_type, field_name);
- if (auto record = resolved_type.get<record_type>())
+ if (!record_field.empty())
{
- for (auto& field : record->fields)
- {
- if (field.first == field_name)
- {
- return field.second;
- }
- }
- if (!record->base.empty())
- {
- return lookup_field(record->base, field_name);
- }
+ return record_field;
}
- else if (auto range_base = get_range_base_type(resolved_type))
+ const type resolved_type = resolve_underlying_type(composite_type);
+
+ if (auto range_base = get_range_base_type(resolved_type))
{
if (auto field = lookup_pointer_like_field(field_name, range_base))
{