Class: Steep::Diagnostic::Ruby::UnsatisfiableConstraint

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

Instance Attribute Summary collapse

Attributes inherited from Base

#location, #node

Instance Method Summary collapse

Methods included from ResultPrinter

#detail_lines, #relation_message

Methods inherited from Base

#detail_lines, #diagnostic_code

Methods included from Helper

#error_name, #full_message

Constructor Details

#initialize(node:, method_type:, var:, sub_type:, super_type:, result:) ⇒ UnsatisfiableConstraint

Returns a new instance of UnsatisfiableConstraint.



676
677
678
679
680
681
682
683
# File 'lib/steep/diagnostic/ruby.rb', line 676

def initialize(node:, method_type:, var:, sub_type:, super_type:, result:)
  super(node: node)
  @method_type = method_type
  @var = var
  @sub_type = sub_type
  @super_type = super_type
  @result = result
end

Instance Attribute Details

#method_typeObject (readonly)

Returns the value of attribute method_type.



670
671
672
# File 'lib/steep/diagnostic/ruby.rb', line 670

def method_type
  @method_type
end

#resultObject (readonly)

Returns the value of attribute result.



674
675
676
# File 'lib/steep/diagnostic/ruby.rb', line 674

def result
  @result
end

#sub_typeObject (readonly)

Returns the value of attribute sub_type.



672
673
674
# File 'lib/steep/diagnostic/ruby.rb', line 672

def sub_type
  @sub_type
end

#super_typeObject (readonly)

Returns the value of attribute super_type.



673
674
675
# File 'lib/steep/diagnostic/ruby.rb', line 673

def super_type
  @super_type
end

#varObject (readonly)

Returns the value of attribute var.



671
672
673
# File 'lib/steep/diagnostic/ruby.rb', line 671

def var
  @var
end

Instance Method Details

#header_lineObject



687
688
689
# File 'lib/steep/diagnostic/ruby.rb', line 687

def header_line
  "Unsatisfiable constraint `#{sub_type} <: #{var} <: #{super_type}` is generated through #{method_type}"
end