From 7d0d0eb69589ab8e0c8b036a3b642593a372b041 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sun, 23 Aug 2026 20:01:55 +0200 Subject: Determine array type by the first element --- boot/name_analysis.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'boot/name_analysis.cc') 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(element_type, + expression->elements.size())); this->current_type = type(); } -- cgit v1.2.3