Class: Steep::TypeInference::TypeEnvBuilder::Command::ImportConstantAnnotations

Inherits:
AnnotationsBase show all
Defined in:
lib/steep/type_inference/type_env_builder.rb

Instance Attribute Summary

Attributes inherited from AnnotationsBase

#annotations

Instance Method Summary collapse

Methods inherited from AnnotationsBase

#initialize

Constructor Details

This class inherits a constructor from Steep::TypeInference::TypeEnvBuilder::Command::AnnotationsBase

Instance Method Details

#call(env) ⇒ Object



115
116
117
118
119
120
121
# File 'lib/steep/type_inference/type_env_builder.rb', line 115

def call(env)
  constant_types = annotations.const_type_annotations.transform_values do |const|
    annotations.absolute_type(const.type) || const.type
  end

  env.update(constant_types: constant_types)
end