type_check_visitor returned / brought values check, branches check

This commit is contained in:
ProgramSnail 2023-05-21 11:21:24 +03:00
parent a9d4d3a104
commit f6b50b16ae
3 changed files with 63 additions and 50 deletions

View file

@ -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;