trying to fix basic types local types

This commit is contained in:
ProgramSnail 2023-05-22 21:00:43 +03:00
parent 25583d3edd
commit 24ff9a30d8
8 changed files with 132 additions and 54 deletions

View file

@ -18,15 +18,7 @@ bool AbstractType::Same(const AbstractType& type) const {
}
bool AbstractType::operator<(const AbstractType& type) const { // TODO: cache DependenciesSet
auto requirement_graph_ids = typeclass_graph_.GetDependenciesSet(graph_id_);
auto other_requirement_graph_ids = type.typeclass_graph_.GetDependenciesSet(type.graph_id_);
for (auto& graph_id : requirement_graph_ids) {
if (other_requirement_graph_ids.count(graph_id) == 0) {
return false;
}
}
return true;
return typeclass_graph_.GetDependenciesSet(graph_id_).count(type.graph_id_) != 0 || graph_id_ == type.graph_id_;
}
bool AbstractType::operator>(const AbstractType& type) const {