mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-05 22:48:42 +00:00
type_check_visitor returned / brought values check, branches check
This commit is contained in:
parent
a9d4d3a104
commit
f6b50b16ae
3 changed files with 63 additions and 50 deletions
|
|
@ -163,6 +163,15 @@ private:
|
|||
info::definition::AnyType* defined_type,
|
||||
bool is_method);
|
||||
|
||||
void ResetReturnedAndBroughtTypes() {
|
||||
if (returned_type_.has_value()) {
|
||||
all_branches_returned_value_ = false;
|
||||
}
|
||||
if (brought_type_.has_value()) {
|
||||
all_branches_brought_value_ = false;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
bool HandleBuiltinFunctionCall(FunctionCallExpression* node);
|
||||
|
|
@ -177,8 +186,13 @@ private:
|
|||
|
||||
std::unordered_set<utils::IdType> type_namespaces_;
|
||||
utils::IdType current_type_;
|
||||
|
||||
std::optional<utils::IdType> returned_type_;
|
||||
bool all_branches_returned_value_ = true;
|
||||
|
||||
std::optional<utils::IdType> brought_type_;
|
||||
bool all_branches_brought_value_ = true;
|
||||
|
||||
std::optional<utils::IsConstModifier> is_const_definition_;
|
||||
|
||||
bool is_in_statement_ = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue