class Steep::TypeInference::LocalVariableTypeEnv::Entry
def +(other)
def +(other) self.class.new(type: AST::Types::Union.build(types: [type, other.type]), annotations: annotations + other.annotations, nodes: nodes + other.nodes) end
def ==(other)
def ==(other) other.is_a?(Entry) && other.type == type && other.annotations == annotations && other.nodes == nodes end
def initialize(type:, annotations: [], nodes: [])
def initialize(type:, annotations: [], nodes: []) @type = type @annotations = Set.new(annotations) @nodes = Set[].compare_by_identity.merge(nodes) end
def optional
def optional self.class.new(type: AST::Types::Union.build(types: [type, AST::Builtin.nil_type]), annotations: annotations, nodes: nodes) end
def update(type: self.type, annotations: self.annotations, nodes: self.nodes)
def update(type: self.type, annotations: self.annotations, nodes: self.nodes) Entry.new(type: type, annotations: annotations, nodes: nodes) end