class Steep::Subtyping::Trace

def +(other)

def +(other)
  self.class.new(array: array + other.array)
end

def add(sup, sub)

def add(sup, sub)
  array << [sup, sub]
  yield
ensure
  array.pop
end

def drop(n)

def drop(n)
  self.class.new(array: array.drop(n))
end

def each

def each
  if block_given?
    array.each do |pair|
      yield(*pair)
    end
  else
    enum_for :each
  end
end

def empty?

def empty?
  array.empty?
end

def initialize(array: [])

def initialize(array: [])
  @array = array
end

def initialize_copy(source)

def initialize_copy(source)
  @array = source.array.dup
end

def interface(sub, sup, &block)

def interface(sub, sup, &block)
  push :interface, sub, sup, &block
end

def method(name, sub, sup, &block)

def method(name, sub, sup, &block)
  push :method, sub, sup, name, &block
end

def method_type(name, sub, sup, &block)

def method_type(name, sub, sup, &block)
  push :method_type, sub, sup, name, &block
end

def push(*xs)

def push(*xs)
  array << xs
  yield
ensure
  array.pop
end

def size

def size
  array.size
end

def type(sub, sup, &block)

def type(sub, sup, &block)
  push :type, sub, sup, &block
end