aboutsummaryrefslogtreecommitdiff
path: root/boot/name_analysis.cc
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-08-23 20:01:55 +0200
committerEugen Wissner <belka@caraus.de>2026-08-23 20:01:55 +0200
commit7d0d0eb69589ab8e0c8b036a3b642593a372b041 (patch)
treecf3731cec0ab67a0d574450fbe24c3cff4a7a9e6 /boot/name_analysis.cc
parentbf41d022ce9736a92097f416ab96fca7ab4594ca (diff)
downloadelna-7d0d0eb69589ab8e0c8b036a3b642593a372b041.tar.gz
Determine array type by the first element
Diffstat (limited to 'boot/name_analysis.cc')
-rw-r--r--boot/name_analysis.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/boot/name_analysis.cc b/boot/name_analysis.cc
index d4b8643..30d3cda 100644
--- a/boot/name_analysis.cc
+++ b/boot/name_analysis.cc
@@ -470,12 +470,13 @@ namespace elna::boot
void name_analysis_visitor::visit(array_constructor_expression *expression)
{
- expression->array_type().accept(this);
- expression->type_decoration = this->current_type;
for (auto *element : expression->elements)
{
element->accept(this);
}
+ const type element_type = expression->elements.front()->type_decoration;
+ expression->type_decoration = type(std::make_shared<array_type>(element_type,
+ expression->elements.size()));
this->current_type = type();
}