aboutsummaryrefslogtreecommitdiff
path: root/boot/type_check.cc
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-10-03 00:46:51 +0200
committerEugen Wissner <belka@caraus.de>2026-10-03 00:46:51 +0200
commit128a564be05afb1cb2ec76884a81c2bd536899fd (patch)
tree12bcd5e877aaff326edb253c6b53a3e8b762d699 /boot/type_check.cc
parentc8c9cb33f400031a697b4cad7ccc6b8555776e4f (diff)
downloadelna-128a564be05afb1cb2ec76884a81c2bd536899fd.tar.gz
Replace noreturn type with an attribute
Diffstat (limited to 'boot/type_check.cc')
-rw-r--r--boot/type_check.cc37
1 files changed, 17 insertions, 20 deletions
diff --git a/boot/type_check.cc b/boot/type_check.cc
index 15a01dc..ea0bcd5 100644
--- a/boot/type_check.cc
+++ b/boot/type_check.cc
@@ -413,8 +413,8 @@ namespace elna::boot
return opaque;
}
}
- return !procedure->return_type.proper_type.empty()
- ? find_opaque_type(procedure->return_type.proper_type)
+ return !procedure->return_type.empty()
+ ? find_opaque_type(procedure->return_type)
: std::nullopt;
}
return std::nullopt;
@@ -723,18 +723,18 @@ namespace elna::boot
}
++parameter_index;
}
- if (declaration->heading().return_type.proper_type != nullptr)
+ if (declaration->heading().return_type != nullptr)
{
- if (auto opaque = find_opaque_type(this->current_procedure->symbol.return_type.proper_type))
+ if (auto opaque = find_opaque_type(this->current_procedure->symbol.return_type))
{
add_error<type_requirement_error>(
- declaration->heading().return_type.proper_type->position(),
+ declaration->heading().return_type->position(),
opaque.value(), type_requirement_error::kind::opaque_return);
}
- else if (auto found = find_zero_sized(this->current_procedure->symbol.return_type.proper_type, this->target))
+ else if (auto found = find_zero_sized(this->current_procedure->symbol.return_type, this->target))
{
add_error<type_requirement_error>(
- declaration->heading().return_type.proper_type->position(),
+ declaration->heading().return_type->position(),
found.value(), type_requirement_error::kind::zero_sized);
}
}
@@ -750,7 +750,7 @@ namespace elna::boot
void type_analysis_visitor::check_return(const procedure_body& body,
const source_position position, const std::string& name)
{
- const type return_type = this->current_procedure->symbol.return_type.proper_type;
+ const type return_type = this->current_procedure->symbol.return_type;
if (body.return_expression == nullptr)
{
@@ -990,18 +990,17 @@ namespace elna::boot
parameter, type_requirement_error::kind::zero_sized);
}
}
- if (!procedure->return_type.proper_type.empty())
+ if (!procedure->return_type.empty())
{
- if (const auto opaque = find_opaque_type(procedure->return_type.proper_type))
+ if (const auto opaque = find_opaque_type(procedure->return_type))
{
add_error<type_requirement_error>(declaration->position(),
opaque.value(), type_requirement_error::kind::opaque_return);
}
- else if (has_zero_size(procedure->return_type.proper_type, this->target))
+ else if (has_zero_size(procedure->return_type, this->target))
{
add_error<type_requirement_error>(declaration->position(),
- procedure->return_type.proper_type,
- type_requirement_error::kind::zero_sized);
+ procedure->return_type, type_requirement_error::kind::zero_sized);
}
}
}
@@ -1079,8 +1078,8 @@ namespace elna::boot
return true;
}
}
- return !procedure->return_type.proper_type.empty()
- && occurs_in(parameter, procedure->return_type.proper_type);
+ return !procedure->return_type.empty()
+ && occurs_in(parameter, procedure->return_type);
}
else if (const auto instance = subject.get<instantiated_type>())
{
@@ -1206,10 +1205,8 @@ namespace elna::boot
return false;
}
}
- return left_procedure->return_type.proper_type.empty()
- || bind_arguments(parameters, bindings,
- left_procedure->return_type.proper_type,
- right_procedure->return_type.proper_type);
+ return left_procedure->return_type.empty()
+ || bind_arguments(parameters, bindings, left_procedure->return_type, right_procedure->return_type);
}
return true;
}
@@ -1424,7 +1421,7 @@ namespace elna::boot
// just bound.
if (const auto substituted = callable_type.get<procedure_type>())
{
- call->type_decoration = substituted->return_type.proper_type;
+ call->type_decoration = substituted->return_type;
}
}
}