fixes, function definition search in typecheck

This commit is contained in:
ProgramSnail 2023-05-19 17:09:14 +03:00
parent 0b53b2f218
commit afecbd64f5
6 changed files with 123 additions and 129 deletions

View file

@ -205,15 +205,21 @@ public:
return current_path_;
}
const std::vector<utils::IdType>& GetCurrentPathNamespaces() {
return namespace_stack_;
}
// use only after LinkSymbolsVisitor
std::vector<utils::IdType> GetCurrentPathTypes() {
std::vector<utils::IdType> types;
std::vector<std::optional<utils::IdType>> GetCurrentPathTypes() {
std::vector<std::optional<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());
} else {
types.push_back(std::nullopt);
}
}