class Steep::AST::Types::Record

def ==(other)

def ==(other)
  other.is_a?(Record) && other.elements == elements
end

def free_variables

def free_variables
  elements.each_value.with_object(Set.new) do |type, set|
    set.merge(type.free_variables)
  end
end

def hash

def hash
  self.class.hash ^ elements.hash
end

def initialize(elements:, location: nil)

def initialize(elements:, location: nil)
  @elements = elements
  @location = location
end

def level

def level
  [0] + level_of_children(elements.values)
end

def subst(s)

def subst(s)
  self.class.new(location: location,
                 elements: elements.transform_values {|type| type.subst(s) })
end

def to_s

def to_s
  "{ #{elements.map {|key, value| "#{key.inspect} => #{value}" }.join(", ")} }"
end

def with_location(new_location)

def with_location(new_location)
  self.class.new(elements: elements, location: new_location)
end