Class: Steep::Diagnostic::Ruby::IncompatibleAnnotation
- Includes:
- ResultPrinter
- Defined in:
- lib/steep/diagnostic/ruby.rb
Instance Attribute Summary collapse
-
#relation ⇒ Object
readonly
Returns the value of attribute relation.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#var_name ⇒ Object
readonly
Returns the value of attribute var_name.
Attributes inherited from Base
Instance Method Summary collapse
- #header_line ⇒ Object
-
#initialize(node:, var_name:, result:, relation:) ⇒ IncompatibleAnnotation
constructor
A new instance of IncompatibleAnnotation.
Methods included from ResultPrinter
#detail_lines, #relation_message
Methods inherited from Base
#detail_lines, #diagnostic_code
Methods included from Helper
Constructor Details
#initialize(node:, var_name:, result:, relation:) ⇒ IncompatibleAnnotation
Returns a new instance of IncompatibleAnnotation.
697 698 699 700 701 702 |
# File 'lib/steep/diagnostic/ruby.rb', line 697 def initialize(node:, var_name:, result:, relation:) super(node: node, location: node.location.expression) @var_name = var_name @result = result @relation = relation end |
Instance Attribute Details
#relation ⇒ Object (readonly)
Returns the value of attribute relation.
695 696 697 |
# File 'lib/steep/diagnostic/ruby.rb', line 695 def relation @relation end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
694 695 696 |
# File 'lib/steep/diagnostic/ruby.rb', line 694 def result @result end |
#var_name ⇒ Object (readonly)
Returns the value of attribute var_name.
693 694 695 |
# File 'lib/steep/diagnostic/ruby.rb', line 693 def var_name @var_name end |
Instance Method Details
#header_line ⇒ Object
706 707 708 |
# File 'lib/steep/diagnostic/ruby.rb', line 706 def header_line "Type annotation about `#{var_name}` is incompatible since #{relation} doesn't hold" end |