Module: Yoda::Typing::Tree::NamespaceInferable

Included in:
ClassTree, ModuleTree, SingletonClassTree
Defined in:
lib/yoda/typing/tree/namespace_inferable.rb

Instance Method Summary collapse

Instance Method Details

#infer_namespaceTypes::Type

Returns:



9
10
11
12
13
14
15
16
# File 'lib/yoda/typing/tree/namespace_inferable.rb', line 9

def infer_namespace
  namespace_type = infer_child(node.receiver)

  new_context = context.derive_class_context(class_type: namespace_type)
  infer_child(node.body, context: new_context)

  namespace_type
end

#nodeAST::ModuleNode, AST::ClassNode



# File 'lib/yoda/typing/tree/namespace_inferable.rb', line 5