Class: Steep::Diagnostic::Ruby::InsufficientTypeArgument

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

Instance Attribute Summary collapse

Attributes inherited from Base

#location, #node

Instance Method Summary collapse

Methods inherited from Base

#detail_lines, #diagnostic_code

Methods included from Helper

#error_name, #full_message

Constructor Details

#initialize(node:, type_args:, method_type:) ⇒ InsufficientTypeArgument

Returns a new instance of InsufficientTypeArgument.



868
869
870
871
872
# File 'lib/steep/diagnostic/ruby.rb', line 868

def initialize(node:, type_args:, method_type:)
  super(node: node)
  @type_args = type_args
  @method_type = method_type
end

Instance Attribute Details

#method_typeObject (readonly)

Returns the value of attribute method_type.



866
867
868
# File 'lib/steep/diagnostic/ruby.rb', line 866

def method_type
  @method_type
end

#type_argsObject (readonly)

Returns the value of attribute type_args.



866
867
868
# File 'lib/steep/diagnostic/ruby.rb', line 866

def type_args
  @type_args
end

Instance Method Details

#header_lineObject



874
875
876
# File 'lib/steep/diagnostic/ruby.rb', line 874

def header_line
  "Requires #{method_type.type_params.size} types, but #{type_args.size} given: `#{method_type.to_s}`"
end