/** ** \file type/named.cc ** \brief Implementation for type/named.hh. */ #include #include #include namespace type { Named::Named(misc::symbol name) : name_(name) , type_(nullptr) {} Named::Named(misc::symbol name, const Type* type) : name_(name) , type_(type) {} // Inherited functions void Named::accept(ConstVisitor& v) const { // FIXME DONE: Some code was deleted here. v(*this); } void Named::accept(Visitor& v) { // FIXME DONE: Some code was deleted here. v(*this); } bool Named::sound() const { // FIXME DONE: Some code was deleted here (Sound). auto reference = dynamic_cast(type_); std::vector previous; while (reference != nullptr) { if (std::ranges::find(previous, reference) != previous.end()) { return false; } previous.push_back(reference); reference = dynamic_cast(reference->type_get()); } return true; } bool Named::compatible_with(const Type& other) const { // FIXME DONE: Some code was deleted here (Special implementation of "compatible_with" for Named). return type_->compatible_with(other); } } // namespace type