Class: Yoda::Typing::Tree::SingletonClassTree
- Includes:
- NamespaceInferable
- Defined in:
- lib/yoda/typing/tree/singleton_class_tree.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods included from NamespaceInferable
Methods inherited from Base
#build_child, #generator, #infer_child, #initialize, #inspect, #pretty_print, #type
Constructor Details
This class inherits a constructor from Yoda::Typing::Tree::Base
Instance Method Details
#infer_type ⇒ Types::Type
13 14 15 16 17 18 19 20 |
# File 'lib/yoda/typing/tree/singleton_class_tree.rb', line 13 def infer_type receiver_type = infer_child(node.receiver) new_context = context.derive_class_context(class_type: receiver_type.singleton_type) infer_child(node.body, context: new_context) generator.nil_type end |