mirror of
https://codeberg.org/ProgramSnail/lang.git
synced 2025-12-08 16:08:46 +00:00
result / optional return type modifiers for functions (one for all returns)
This commit is contained in:
parent
68463509d8
commit
195a26f9b7
10 changed files with 74 additions and 36 deletions
|
|
@ -22,9 +22,13 @@ FunctionDefinition::combine(FunctionDefinition &&other_function_definition) {
|
|||
if (*name_.get() != *other_function_definition.name_.get()) {
|
||||
return CombineResult::DIFFERENT_NAME_ERROR;
|
||||
}
|
||||
if (modifier_ != other_function_definition.modifier_) {
|
||||
if (return_modifier_ != other_function_definition.return_modifier_) {
|
||||
return CombineResult::DIFFERNENT_MODIFIER_ERROR;
|
||||
}
|
||||
if (method_modifier_ != other_function_definition.method_modifier_) {
|
||||
return CombineResult::DIFFERNENT_MODIFIER_ERROR;
|
||||
}
|
||||
|
||||
if (are_annotations_same_to_names_ !=
|
||||
other_function_definition.are_annotations_same_to_names_) {
|
||||
return CombineResult::ARGUMENTS_ERROR;
|
||||
|
|
@ -158,7 +162,7 @@ FunctionDefinition::combine(FunctionDefinition &&other_function_definition) {
|
|||
error_handling::handle_internal_error(
|
||||
"Function arguments are not properly checked before merging "
|
||||
"during combination",
|
||||
this);
|
||||
*this);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue