/** ** \file type/function.cc ** \brief Implementation for type/function.hh. */ #include #include #include #include namespace type { Function::Function(const Record* formals, const Type& result) : result_(result) { precondition(formals); formals_ = formals; } Function::~Function() { delete formals_; } void Function::accept(ConstVisitor& v) const { v(*this); } void Function::accept(Visitor& v) { v(*this); } // FIXME DONE: Some code was deleted here. bool Function::compatible_with(const Type& other) const { const auto other_function = dynamic_cast(&other); return other_function != nullptr \ && other_function->formals_get().compatible_with(this->formals_get()) \ && other_function->result_get().compatible_with(this->result_get()); } } // namespace type