Module: Steep::Errors::ResultPrinter
- Included in:
- BlockTypeMismatch, BreakTypeMismatch, IncompatibleAnnotation, IncompatibleAssignment, IncompatibleMethodTypeAnnotation, IncompatibleTuple, IncompatibleTypeCase, MethodBodyTypeMismatch, MethodReturnTypeAnnotationMismatch, ReturnTypeMismatch, UnsatisfiableConstraint
- Defined in:
- lib/steep/errors.rb
Instance Method Summary collapse
Instance Method Details
#print_result_to(io, level: 2) ⇒ Object
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.}" end |
#print_to(io) ⇒ Object
36 37 38 39 |
# File 'lib/steep/errors.rb', line 36 def print_to(io) super print_result_to io end |