class TypeProf::Core::AST::SigFuncType::SigTyAliasNode::SigTyUnionNode::SigTySingletonNode::SigTyInstanceNode::SigTyTupleNode::SigTyVarNode::SigTyOptionalNode::SigTyLiteralNode
Attributes
lit[R]
Public Class Methods
new(raw_decl, lenv)
click to toggle source
Calls superclass method
TypeProf::Core::AST::Node::new
# File typeprof-0.30.1/lib/typeprof/core/ast/sig_type.rb, line 553 def initialize(raw_decl, lenv) super(raw_decl, lenv) @lit = raw_decl.literal end
Public Instance Methods
attrs(= { lit: })
click to toggle source
# File typeprof-0.30.1/lib/typeprof/core/ast/sig_type.rb, line 559 def attrs = { lit: } def get_type(genv) case @lit when ::Symbol Type::Symbol.new(genv, @lit) when ::Integer then genv.int_type when ::String then genv.str_type when ::TrueClass then genv.true_type when ::FalseClass then genv.false_type else raise "unknown RBS literal: #{ @lit.inspect }" end end def covariant_vertex0(genv, changes, vtx, subst) changes.add_edge(genv, Source.new(get_type(genv)), vtx) end def contravariant_vertex0(genv, changes, vtx, subst) changes.add_edge(genv, Source.new(get_type(genv)), vtx) end def show @lit.inspect end end
contravariant_vertex0(genv, changes, vtx, subst)
click to toggle source
# File typeprof-0.30.1/lib/typeprof/core/ast/sig_type.rb, line 578 def contravariant_vertex0(genv, changes, vtx, subst) changes.add_edge(genv, Source.new(get_type(genv)), vtx) end
covariant_vertex0(genv, changes, vtx, subst)
click to toggle source
# File typeprof-0.30.1/lib/typeprof/core/ast/sig_type.rb, line 574 def covariant_vertex0(genv, changes, vtx, subst) changes.add_edge(genv, Source.new(get_type(genv)), vtx) end
get_type(genv)
click to toggle source
# File typeprof-0.30.1/lib/typeprof/core/ast/sig_type.rb, line 561 def get_type(genv) case @lit when ::Symbol Type::Symbol.new(genv, @lit) when ::Integer then genv.int_type when ::String then genv.str_type when ::TrueClass then genv.true_type when ::FalseClass then genv.false_type else raise "unknown RBS literal: #{ @lit.inspect }" end end
show()
click to toggle source
# File typeprof-0.30.1/lib/typeprof/core/ast/sig_type.rb, line 582 def show @lit.inspect end