Class: Steep::Diagnostic::Ruby::TypeArgumentMismatchError

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

Instance Attribute Summary collapse

Attributes inherited from Base

#location, #node

Instance Method Summary collapse

Methods included from ResultPrinter

#detail_lines, #relation_message

Methods inherited from Base

#detail_lines, #diagnostic_code

Methods included from Helper

#error_name, #full_message

Constructor Details

#initialize(type_arg:, type_param:, result:, location:) ⇒ TypeArgumentMismatchError

Returns a new instance of TypeArgumentMismatchError.



882
883
884
885
886
887
# File 'lib/steep/diagnostic/ruby.rb', line 882

def initialize(type_arg:, type_param:, result:, location:)
  super(node: nil, location: location)
  @type_argument = type_arg
  @type_parameter = type_param
  @result = result
end

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



880
881
882
# File 'lib/steep/diagnostic/ruby.rb', line 880

def result
  @result
end

#type_argumentObject (readonly)

Returns the value of attribute type_argument.



880
881
882
# File 'lib/steep/diagnostic/ruby.rb', line 880

def type_argument
  @type_argument
end

#type_parameterObject (readonly)

Returns the value of attribute type_parameter.



880
881
882
# File 'lib/steep/diagnostic/ruby.rb', line 880

def type_parameter
  @type_parameter
end

Instance Method Details

#header_lineObject



891
892
893
# File 'lib/steep/diagnostic/ruby.rb', line 891

def header_line
  "Cannot pass a type `#{type_argument}` as a type parameter `#{type_parameter.to_s}`"
end