/** ** \file type/method.cc ** \brief Implementation for type/method.hh. */ #include #include #include namespace type { Method::Method(misc::symbol name, const Class* owner, const Record* formals, const Type& result, ast::MethodDec* def) : Function(formals, result) , name_(name) , owner_(owner) , def_(def) {} Method::Method(misc::symbol name, const Record* formals, const Type& result, ast::MethodDec* def) : Function(formals, result) , name_(name) , owner_(nullptr) , def_(def) {} void Method::accept(ConstVisitor& v) const { v(*this); } void Method::accept(Visitor& v) { v(*this); } // FIXME DONE: Some code was deleted here. bool Method::compatible_with(const Type& other) const { const auto other_method = dynamic_cast(&other); return other_method != nullptr \ && other_method->formals_get().compatible_with(other) \ && other_method->result_get().compatible_with(other); } } // namespace type