Class: Steep::Diagnostic::Ruby::FalseAssertion

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

Instance Attribute Summary collapse

Attributes inherited from Base

#location

Instance Method Summary collapse

Methods inherited from Base

#detail_lines, #diagnostic_code

Methods included from Helper

#error_name, #full_message

Constructor Details

#initialize(node:, assertion_type:, node_type:) ⇒ FalseAssertion

Returns a new instance of FalseAssertion.



840
841
842
843
844
# File 'lib/steep/diagnostic/ruby.rb', line 840

def initialize(node:, assertion_type:, node_type:)
  super(node: node)
  @assertion_type = assertion_type
  @node_type = node_type
end

Instance Attribute Details

#assertion_typeObject (readonly)

Returns the value of attribute assertion_type.



838
839
840
# File 'lib/steep/diagnostic/ruby.rb', line 838

def assertion_type
  @assertion_type
end

#nodeObject (readonly)

Returns the value of attribute node.



838
839
840
# File 'lib/steep/diagnostic/ruby.rb', line 838

def node
  @node
end

#node_typeObject (readonly)

Returns the value of attribute node_type.



838
839
840
# File 'lib/steep/diagnostic/ruby.rb', line 838

def node_type
  @node_type
end

Instance Method Details

#header_lineObject



846
847
848
# File 'lib/steep/diagnostic/ruby.rb', line 846

def header_line
  "Assertion cannot hold: no relationship between inferred type (`#{node_type.to_s}`) and asserted type (`#{assertion_type.to_s}`)"
end