Class: Steep::TypeInference::TypeEnvBuilder::Command::ImportInstanceVariableAnnotations
Instance Attribute Summary
#annotations
Instance Method Summary
collapse
#initialize
Instance Method Details
#call(env) ⇒ Object
65
66
67
68
69
70
71
72
73
74
75
|
# File 'lib/steep/type_inference/type_env_builder.rb', line 65
def call(env)
ivar_types = annotations.ivar_type_annotations.transform_values do |annotation|
annotations.absolute_type(annotation.type) || annotation.type
end
if @merge
env.merge(instance_variable_types: ivar_types)
else
env.update(instance_variable_types: ivar_types)
end
end
|
#merge!(merge = true) ⇒ Object
77
78
79
80
|
# File 'lib/steep/type_inference/type_env_builder.rb', line 77
def merge!(merge = true)
@merge = merge
self
end
|