class Steep::Subtyping::Check
def check_interface(relation)
def check_interface(relation) relation.interface! sub_interface, super_interface = relation method_pairs = super_interface.methods.each_with_object({}) do |(method_name, sup_method), hash| #$ Hash[Symbol, Relation[Interface::Shape::Entry]] if sub_method = sub_interface.methods[method_name] hash[method_name] = Relation.new(sub_type: sub_method, super_type: sup_method) else return Failure(relation) { Result::Failure::MethodMissingError.new(name: method_name) } end end All(relation) do |result| method_pairs.each do |method_name, method_relation| result.add(method_relation) do check_method(method_name, method_relation) end end end end