Class: Steep::TypeInference::Context::BreakContext

Inherits:
Object
  • Object
show all
Defined in:
lib/steep/type_inference/context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(break_type:, next_type:) ⇒ BreakContext

Returns a new instance of BreakContext.



46
47
48
49
# File 'lib/steep/type_inference/context.rb', line 46

def initialize(break_type:, next_type:)
  @break_type = break_type
  @next_type = next_type
end

Instance Attribute Details

#break_typeObject (readonly)

Returns the value of attribute break_type.



43
44
45
# File 'lib/steep/type_inference/context.rb', line 43

def break_type
  @break_type
end

#next_typeObject (readonly)

Returns the value of attribute next_type.



44
45
46
# File 'lib/steep/type_inference/context.rb', line 44

def next_type
  @next_type
end

Instance Method Details

#subst(s) ⇒ Object



51
52
53
# File 'lib/steep/type_inference/context.rb', line 51

def subst(s)
  BreakContext.new(break_type: break_type.subst(s), next_type: next_type&.subst(s))
end