class TypeProf::Core::AST::SigFuncType::SigTyAliasNode::SigTyUnionNode::SigTySingletonNode::SigTyInstanceNode::SigTyTupleNode::SigTyVarNode::SigTyOptionalNode - typeprof: Ruby Standard Library Documentation

# class TypeProf::Core::AST::SigFuncType::SigTyAliasNode::SigTyUnionNode::SigTySingletonNode::SigTyInstanceNode::SigTyTupleNode::SigTyVarNode::SigTyOptionalNode

### Attributes

type[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 525
    def initialize(raw_decl, lenv)
      super(raw_decl, lenv)
      @type = AST.create_rbs_type(raw_decl.type, lenv)
    end

### Public Instance Methods

contravariant_vertex0(genv, changes, vtx, subst) click to toggle source

    # File typeprof-0.30.1/lib/typeprof/core/ast/sig_type.rb, line 538
    def contravariant_vertex0(genv, changes, vtx, subst)
      @type.contravariant_vertex0(genv, changes, vtx, subst)
      changes.add_edge(genv, Source.new(genv.nil_type), 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 533
    def covariant_vertex0(genv, changes, vtx, subst)
      @type.covariant_vertex0(genv, changes, vtx, subst)
      changes.add_edge(genv, Source.new(genv.nil_type), vtx)
    end

show() click to toggle source

    # File typeprof-0.30.1/lib/typeprof/core/ast/sig_type.rb, line 543
    def show
      s = @type.show
      if @type.is_a?(SigTyIntersectionNode) || @type.is_a?(SigTyUnionNode)
        s = "(#{ s })"
      end
      s + "?"
    end

subnodes(= { type: }) click to toggle source

    # File typeprof-0.30.1/lib/typeprof/core/ast/sig_type.rb, line 531
      def subnodes = { type: }

      def covariant_vertex0(genv, changes, vtx, subst)
        @type.covariant_vertex0(genv, changes, vtx, subst)
        changes.add_edge(genv, Source.new(genv.nil_type), vtx)
      end

      def contravariant_vertex0(genv, changes, vtx, subst)
        @type.contravariant_vertex0(genv, changes, vtx, subst)
        changes.add_edge(genv, Source.new(genv.nil_type), vtx)
      end

      def show
        s = @type.show
        if @type.is_a?(SigTyIntersectionNode) || @type.is_a?(SigTyUnionNode)
          s = "(#{ s })"
        end
        s + "?"
      end
    end