Module: Steep::Errors::ResultPrinter

Instance Method Summary collapse

Instance Method Details



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/steep/errors.rb', line 21

def print_result_to(io, level: 2)
  indent = " " * level
  result.trace.each do |s, t|
    case s
    when Interface::Method
      io.puts "#{indent}#{s.name}(#{s.type_name}) <: #{t.name}(#{t.type_name})"
    when Interface::MethodType
      io.puts "#{indent}#{s} <: #{t} (#{s.location.name}:#{s.location.start_line})"
    else
      io.puts "#{indent}#{s} <: #{t}"
    end
  end
  io.puts "#{indent}  #{result.error.message}"
end


36
37
38
39
# File 'lib/steep/errors.rb', line 36

def print_to(io)
  super
  print_result_to io
end