mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2026-01-25 13:07:13 +00:00
fixes, function definition search in typecheck
This commit is contained in:
parent
0b53b2f218
commit
afecbd64f5
6 changed files with 123 additions and 129 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue