class TypeProf::Core::AST::SigFuncType::SigTyAliasNode::SigTyUnionNode::SigTyIntersectionNode::SigTySingletonNode::SigTyInstanceNode::SigTyTupleNode::SigTyRecordNode::SigTyVarNode::SigTyOptionalNode::SigTyLiteralNode::SigTyProcNode::SigTyInterfaceNode
Attributes
Public Class Methods
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/sig_type.rb, line 963 def initialize(raw_decl, lenv) super(raw_decl, lenv) name = raw_decl.name @cpath = name.namespace.path + [name.name] @toplevel = name.namespace.absolute? # "::Foo" or "Foo" @args = raw_decl.args.map {|arg| AST.create_rbs_type(arg, lenv) } end
Calls superclass method
TypeProf::Core::AST::Node::new
Public Instance Methods
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/sig_type.rb, line 974 def attrs = { cpath:, toplevel: } def define0(genv) @args.each {|arg| arg.define(genv) } const_reads = [] const_read = BaseConstRead.new(genv, @cpath.first, @toplevel ? CRef::Toplevel : @lenv.cref, false) const_reads << const_read unless @cpath.empty? @cpath[1..].each do |cname| const_read = ScopedConstRead.new(cname, const_read, false) const_reads << const_read end end const_reads end def undefine0(genv) @static_ret.each do |const_read| const_read.destroy(genv) end @args.each {|arg| arg.undefine(genv) } end def covariant_vertex0(genv, changes, vtx, subst) changes.add_depended_static_read(@static_ret.last) cpath = @static_ret.last.cpath return unless cpath mod = genv.resolve_cpath(cpath) args = @args.map {|arg| arg.covariant_vertex(genv, changes, subst) } changes.add_edge(genv, Source.new(Type::Instance.new(genv, mod, args)), vtx) end def contravariant_vertex0(genv, changes, vtx, subst) changes.add_depended_static_read(@static_ret.last) cpath = @static_ret.last.cpath return unless cpath mod = genv.resolve_cpath(cpath) args = @args.map {|arg| arg.contravariant_vertex(genv, changes, subst) } changes.add_edge(genv, Source.new(Type::Instance.new(genv, mod, args)), vtx) end def typecheck(genv, changes, vtx, subst) changes.add_depended_static_read(@static_ret.last) cpath = @static_ret.last.cpath return unless cpath f_mod = genv.resolve_cpath(cpath) # self/f_mod: formal, vtx: actual AST.typecheck_for_module(genv, changes, f_mod, @args, vtx, subst) end def show s = "::#{ @cpath.join("::") }" if !@args.empty? s << "[...]" end s end end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/sig_type.rb, line 1006 def contravariant_vertex0(genv, changes, vtx, subst) changes.add_depended_static_read(@static_ret.last) cpath = @static_ret.last.cpath return unless cpath mod = genv.resolve_cpath(cpath) args = @args.map {|arg| arg.contravariant_vertex(genv, changes, subst) } changes.add_edge(genv, Source.new(Type::Instance.new(genv, mod, args)), vtx) end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/sig_type.rb, line 997 def covariant_vertex0(genv, changes, vtx, subst) changes.add_depended_static_read(@static_ret.last) cpath = @static_ret.last.cpath return unless cpath mod = genv.resolve_cpath(cpath) args = @args.map {|arg| arg.covariant_vertex(genv, changes, subst) } changes.add_edge(genv, Source.new(Type::Instance.new(genv, mod, args)), vtx) end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/sig_type.rb, line 976 def define0(genv) @args.each {|arg| arg.define(genv) } const_reads = [] const_read = BaseConstRead.new(genv, @cpath.first, @toplevel ? CRef::Toplevel : @lenv.cref, false) const_reads << const_read unless @cpath.empty? @cpath[1..].each do |cname| const_read = ScopedConstRead.new(cname, const_read, false) const_reads << const_read end end const_reads end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/sig_type.rb, line 1024 def show s = "::#{ @cpath.join("::") }" if !@args.empty? s << "[...]" end s end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/sig_type.rb, line 973 def subnodes = { args: } def attrs = { cpath:, toplevel: } def define0(genv) @args.each {|arg| arg.define(genv) } const_reads = [] const_read = BaseConstRead.new(genv, @cpath.first, @toplevel ? CRef::Toplevel : @lenv.cref, false) const_reads << const_read unless @cpath.empty? @cpath[1..].each do |cname| const_read = ScopedConstRead.new(cname, const_read, false) const_reads << const_read end end const_reads end def undefine0(genv) @static_ret.each do |const_read| const_read.destroy(genv) end @args.each {|arg| arg.undefine(genv) } end def covariant_vertex0(genv, changes, vtx, subst) changes.add_depended_static_read(@static_ret.last) cpath = @static_ret.last.cpath return unless cpath mod = genv.resolve_cpath(cpath) args = @args.map {|arg| arg.covariant_vertex(genv, changes, subst) } changes.add_edge(genv, Source.new(Type::Instance.new(genv, mod, args)), vtx) end def contravariant_vertex0(genv, changes, vtx, subst) changes.add_depended_static_read(@static_ret.last) cpath = @static_ret.last.cpath return unless cpath mod = genv.resolve_cpath(cpath) args = @args.map {|arg| arg.contravariant_vertex(genv, changes, subst) } changes.add_edge(genv, Source.new(Type::Instance.new(genv, mod, args)), vtx) end def typecheck(genv, changes, vtx, subst) changes.add_depended_static_read(@static_ret.last) cpath = @static_ret.last.cpath return unless cpath f_mod = genv.resolve_cpath(cpath) # self/f_mod: formal, vtx: actual AST.typecheck_for_module(genv, changes, f_mod, @args, vtx, subst) end def show s = "::#{ @cpath.join("::") }" if !@args.empty? s << "[...]" end s end end end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/sig_type.rb, line 1015 def typecheck(genv, changes, vtx, subst) changes.add_depended_static_read(@static_ret.last) cpath = @static_ret.last.cpath return unless cpath f_mod = genv.resolve_cpath(cpath) # self/f_mod: formal, vtx: actual AST.typecheck_for_module(genv, changes, f_mod, @args, vtx, subst) end
Source
# File bundled-src/typeprof-0.31.1/lib/typeprof/core/ast/sig_type.rb, line 990 def undefine0(genv) @static_ret.each do |const_read| const_read.destroy(genv) end @args.each {|arg| arg.undefine(genv) } end