Class: Steep::Diagnostic::Signature::InvalidVarianceAnnotation

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

Instance Attribute Summary collapse

Attributes inherited from Base

#location

Instance Method Summary collapse

Methods inherited from Base

#detail_lines, #diagnostic_code, #path

Methods included from Helper

#error_name, #full_message

Constructor Details

#initialize(name:, param:, location:) ⇒ InvalidVarianceAnnotation

Returns a new instance of InvalidVarianceAnnotation.



241
242
243
244
245
# File 'lib/steep/diagnostic/signature.rb', line 241

def initialize(name:, param:, location:)
  super(location: location)
  @name = name
  @param = param
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



238
239
240
# File 'lib/steep/diagnostic/signature.rb', line 238

def name
  @name
end

#paramObject (readonly)

Returns the value of attribute param.



239
240
241
# File 'lib/steep/diagnostic/signature.rb', line 239

def param
  @param
end

Instance Method Details

#header_lineObject



247
248
249
# File 'lib/steep/diagnostic/signature.rb', line 247

def header_line
  "The variance of type parameter `#{param.name}` is #{param.variance}, but used in incompatible position here"
end