Class: Steep::Diagnostic::Signature::InstanceVariableTypeError

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:, location:, var_type:, parent_type:) ⇒ InstanceVariableTypeError

Returns a new instance of InstanceVariableTypeError.



322
323
324
325
326
327
328
# File 'lib/steep/diagnostic/signature.rb', line 322

def initialize(name:, location:, var_type:, parent_type:)
  super(location: location)

  @name = name
  @var_type = var_type
  @parent_type = parent_type
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



318
319
320
# File 'lib/steep/diagnostic/signature.rb', line 318

def name
  @name
end

#parent_typeObject (readonly)

Returns the value of attribute parent_type.



320
321
322
# File 'lib/steep/diagnostic/signature.rb', line 320

def parent_type
  @parent_type
end

#var_typeObject (readonly)

Returns the value of attribute var_type.



319
320
321
# File 'lib/steep/diagnostic/signature.rb', line 319

def var_type
  @var_type
end

Instance Method Details

#header_lineObject



330
331
332
# File 'lib/steep/diagnostic/signature.rb', line 330

def header_line
  "Instance variable cannot have different type with parents: #{var_type} <=> #{parent_type}"
end