123456789_123456789_123456789_123456789_123456789_

Class: TypeProf::SymbolBlock

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Block
Instance Chain:
Inherits: TypeProf::Block
Defined in: lib/typeprof/block.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(sym) ⇒ SymbolBlock

[ GitHub ]

  
# File 'lib/typeprof/block.rb', line 105

def initialize(sym)
  @sym = sym
end

Instance Attribute Details

#iseq (readonly)

[ GitHub ]

  
# File 'lib/typeprof/block.rb', line 109

attr_reader :iseq, :outer_ep

#outer_ep (readonly)

[ GitHub ]

  
# File 'lib/typeprof/block.rb', line 109

attr_reader :iseq, :outer_ep

Instance Method Details

#consistent?(other) ⇒ Boolean

[ GitHub ]

  
# File 'lib/typeprof/block.rb', line 115

def consistent?(other)
  true # XXX
end

#do_call(aargs, caller_ep, caller_env, scratch, replace_recv_ty:, replace_cref:, &ctn)

[ GitHub ]

  
# File 'lib/typeprof/block.rb', line 123

def do_call(aargs, caller_ep, caller_env, scratch, replace_recv_ty:, replace_cref:, &ctn)
  if aargs.lead_tys.size >= 1
    recv = aargs.lead_tys[0]
    recv = Type.any if recv == Type.bot
    aargs = ActualArguments.new(aargs.lead_tys[1..], aargs.rest_ty, aargs.kw_tys, aargs.blk_ty)
  elsif aargs.rest_ty
    recv = aargs.rest_ty.elems.squash_or_any # XXX: need to shift
  else
    recv = Type.any
  end

  scratch.add_block_signature!(self, aargs.to_block_signature)

  recv.each_child do |recv|
    scratch.do_send(recv, @sym, aargs, caller_ep, caller_env, &ctn)
  end
end

#inspect

[ GitHub ]

  
# File 'lib/typeprof/block.rb', line 111

def inspect
  "#<SymbolBlock: #{ @sym }>"
end

#substitute(_subst, _depth)

[ GitHub ]

  
# File 'lib/typeprof/block.rb', line 119

def substitute(_subst, _depth)
  self
end