Class: Steep::TypeInference::LogicTypeInterpreter::Result

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#envObject

Returns the value of attribute env

Returns:

  • (Object)

    the current value of env



4
5
6
# File 'lib/steep/type_inference/logic_type_interpreter.rb', line 4

def env
  @env
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



4
5
6
# File 'lib/steep/type_inference/logic_type_interpreter.rb', line 4

def type
  @type
end

#unreachableObject

Returns the value of attribute unreachable

Returns:

  • (Object)

    the current value of unreachable



4
5
6
# File 'lib/steep/type_inference/logic_type_interpreter.rb', line 4

def unreachable
  @unreachable
end

Instance Method Details

#unreachable!Object



14
15
16
17
# File 'lib/steep/type_inference/logic_type_interpreter.rb', line 14

def unreachable!
  self.unreachable = true
  self
end

#update_envObject



5
6
7
8
# File 'lib/steep/type_inference/logic_type_interpreter.rb', line 5

def update_env
  env = yield()
  Result.new(type: type, env: env, unreachable: unreachable)
end

#update_typeObject



10
11
12
# File 'lib/steep/type_inference/logic_type_interpreter.rb', line 10

def update_type
  Result.new(type: yield, env: env, unreachable: unreachable)
end