type_check_visitor fixes, function_call_expression for typeclasses

This commit is contained in:
ProgramSnail 2023-05-17 15:08:18 +03:00
parent 8e74b3082e
commit 584bdfa54d
6 changed files with 192 additions and 73 deletions

View file

@ -205,6 +205,21 @@ public:
return current_path_;
}
// use only after LinkSymbolsVisitor
std::vector<utils::IdType> GetCurrentPathTypes() {
std::vector<utils::IdType> types;
types.reserve(namespace_stack_.size());
for (auto& namespace_id : namespace_stack_) {
definition::Namespace& namespace_info = global_info_.GetNamespaceInfo(namespace_id);
if (namespace_info.any_node.has_value() && namespace_info.any_node.value()->link_type_id_.has_value()) {
types.push_back(namespace_info.any_node.value()->link_type_id_.value());
}
}
return types;
}
utils::IdType GetCurrentNamespaceId() {
return namespace_stack_.back();
}
@ -341,10 +356,10 @@ public:
std::vector<utils::IdType>
GetAnnotatedTypeTypeclassesVector(interpreter::tokens::AnnotatedType* node);
std::unordered_map<std::string, utils::ClassInternalsModifier>
std::unordered_map<std::string, TypeclassGraph::FunctionInfo*>
GetAnnotatedTypeFunctionsMap(interpreter::tokens::AnnotatedType* node);
std::vector<std::pair<std::string, utils::ClassInternalsModifier>>
std::vector<std::pair<std::string, TypeclassGraph::FunctionInfo*>>
GetAnnotatedTypeFunctionsVector(interpreter::tokens::AnnotatedType* node);
std::unordered_map<std::string, utils::IdType>* ChooseNamespaces(