diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-10-15 14:46:38 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-10-15 14:46:38 +0200 |
| commit | 56a1244380133ab400f98d2da15353e080ffb360 (patch) | |
| tree | f4e0aef02c8d356fc2c67bfdb2f1c490858c24cf /boot/type_check.cc | |
| parent | de6ecae0f072bb32be95382c536a517eabe4b1f1 (diff) | |
| download | elna-56a1244380133ab400f98d2da15353e080ffb360.tar.gz | |
Diffstat (limited to 'boot/type_check.cc')
| -rw-r--r-- | boot/type_check.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/boot/type_check.cc b/boot/type_check.cc index 797282c..5a8170a 100644 --- a/boot/type_check.cc +++ b/boot/type_check.cc @@ -250,7 +250,7 @@ namespace elna::boot return "Condition must be a boolean expression, but got '" + this->actual.to_string() + "'"; case array_index: - return "Array index must be an integral type, but got '" + return "Array index must be of type 'Word' or 'Int', but got '" + this->actual.to_string() + "'"; case non_indexable: return "Indexing is not allowed on type '" @@ -1528,12 +1528,12 @@ namespace elna::boot { walking_visitor::visit(expression); - if (!is_integral_type(resolve_underlying_type(expression->start().type_decoration))) + if (!is_index_type(expression->start().type_decoration, this->target)) { add_error<type_requirement_error>(expression->start().position(), expression->start().type_decoration, type_requirement_error::kind::array_index); } - if (!is_integral_type(resolve_underlying_type(expression->end().type_decoration))) + if (!is_index_type(expression->end().type_decoration, this->target)) { add_error<type_requirement_error>(expression->end().position(), expression->end().type_decoration, type_requirement_error::kind::array_index); @@ -1551,7 +1551,7 @@ namespace elna::boot add_error<type_requirement_error>(expression->position(), expression->base().type_decoration, type_requirement_error::kind::non_indexable); } - if (!is_integral_type(resolve_underlying_type(expression->index().type_decoration))) + if (!is_index_type(expression->index().type_decoration, this->target)) { add_error<type_requirement_error>(expression->index().position(), expression->index().type_decoration, type_requirement_error::kind::array_index); |
