Class: Steep::Errors::IncompatibleAssignment

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

Instance Attribute Summary collapse

Attributes inherited from Base

#node

Instance Method Summary collapse

Methods included from ResultPrinter

#print_result_to, #print_to

Methods inherited from Base

#location_to_str, #print_to

Constructor Details

#initialize(node:, lhs_type:, rhs_type:, result:) ⇒ IncompatibleAssignment

Returns a new instance of IncompatibleAssignment.



40
41
42
43
44
45
# File 'lib/steep/errors.rb', line 40

def initialize(node:, lhs_type:, rhs_type:, result:)
  super(node: node)
  @lhs_type = lhs_type
  @rhs_type = rhs_type
  @result = result
end

Instance Attribute Details

#lhs_typeObject (readonly)

Returns the value of attribute lhs_type.



34
35
36
# File 'lib/steep/errors.rb', line 34

def lhs_type
  @lhs_type
end

#resultObject (readonly)

Returns the value of attribute result.



36
37
38
# File 'lib/steep/errors.rb', line 36

def result
  @result
end

#rhs_typeObject (readonly)

Returns the value of attribute rhs_type.



35
36
37
# File 'lib/steep/errors.rb', line 35

def rhs_type
  @rhs_type
end

Instance Method Details

#to_sObject



47
48
49
# File 'lib/steep/errors.rb', line 47

def to_s
  "#{location_to_str}: IncompatibleAssignment: lhs_type=#{lhs_type}, rhs_type=#{rhs_type}"
end