From 8539c10542a4be1e1127daea60bf1b1e4c37e092 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sat, 1 Aug 2026 09:30:39 +0200 Subject: Fix compile-time negation and array access --- boot/name_analysis.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'boot/name_analysis.cc') diff --git a/boot/name_analysis.cc b/boot/name_analysis.cc index b8cd83e..7ced7ea 100644 --- a/boot/name_analysis.cc +++ b/boot/name_analysis.cc @@ -789,15 +789,16 @@ namespace elna::boot } } - void name_analysis_visitor::visit(literal *literal) - { - literal->type_decoration = lookup_primitive_type("Int"); - this->current_type = literal->type_decoration; - } - void name_analysis_visitor::visit(literal *literal) { - literal->type_decoration = lookup_primitive_type("Word"); + if (literal->value.is_signed()) + { + literal->type_decoration = lookup_primitive_type("Int"); + } + else + { + literal->type_decoration = lookup_primitive_type("Word"); + } this->current_type = literal->type_decoration; } -- cgit v1.2.3