Class: Steep::Errors::IncompatibleMethodTypeAnnotation

Inherits:
Base
  • Object
show all
Includes:
ResultPrinter
Defined in:
lib/steep/errors.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#node

Instance Method Summary collapse

Methods included from ResultPrinter

#print_result_to, #print_to

Methods inherited from Base

#location_to_str, #print_to

Constructor Details

#initialize(node:, interface_method:, annotation_method:, result:) ⇒ IncompatibleMethodTypeAnnotation

Returns a new instance of IncompatibleMethodTypeAnnotation.



256
257
258
259
260
261
# File 'lib/steep/errors.rb', line 256

def initialize(node:, interface_method:, annotation_method:, result:)
  super(node: node)
  @interface_method = interface_method
  @annotation_method = annotation_method
  @result = result
end

Instance Attribute Details

#annotation_methodObject (readonly)

Returns the value of attribute annotation_method.



251
252
253
# File 'lib/steep/errors.rb', line 251

def annotation_method
  @annotation_method
end

#interface_methodObject (readonly)

Returns the value of attribute interface_method.



250
251
252
# File 'lib/steep/errors.rb', line 250

def interface_method
  @interface_method
end

#resultObject (readonly)

Returns the value of attribute result.



252
253
254
# File 'lib/steep/errors.rb', line 252

def result
  @result
end

Instance Method Details

#to_sObject



263
264
265
# File 'lib/steep/errors.rb', line 263

def to_s
  "#{location_to_str}: IncompatibleMethodTypeAnnotation: interface_method=#{interface_method.type_name}.#{interface_method.name}, annotation_method=#{annotation_method.name}"
end