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



299
300
301
302
303
304
305
# File 'lib/steep/diagnostic/signature.rb', line 299

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.



295
296
297
# File 'lib/steep/diagnostic/signature.rb', line 295

def name
  @name
end

#parent_typeObject (readonly)

Returns the value of attribute parent_type.



297
298
299
# File 'lib/steep/diagnostic/signature.rb', line 297

def parent_type
  @parent_type
end

#var_typeObject (readonly)

Returns the value of attribute var_type.



296
297
298
# File 'lib/steep/diagnostic/signature.rb', line 296

def var_type
  @var_type
end

Instance Method Details

#header_lineObject



307
308
309
# File 'lib/steep/diagnostic/signature.rb', line 307

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