class TypeProf::CustomBlock

Public Class Methods

new(caller_ep, mid, &blk) click to toggle source
# File typeprof-0.21.2/lib/typeprof/block.rb, line 144
def initialize(caller_ep, mid, &blk)
  @caller_ep = caller_ep
  @mid = mid
  @blk = blk
end

Public Instance Methods

consistent?(other) click to toggle source
# File typeprof-0.21.2/lib/typeprof/block.rb, line 154
def consistent?(other)
  true # XXX
end
do_call(aargs, caller_ep, caller_env, scratch, replace_recv_ty:, replace_cref:, &ctn) click to toggle source
# File typeprof-0.21.2/lib/typeprof/block.rb, line 162
def do_call(aargs, caller_ep, caller_env, scratch, replace_recv_ty:, replace_cref:, &ctn)
  aargs = scratch.globalize_type(aargs, caller_env, caller_ep)

  dummy_ctx = TypedContext.new(@caller_ep, @mid)

  scratch.add_block_signature!(self, aargs.to_block_signature)
  scratch.add_block_to_ctx!(self, dummy_ctx)

  @blk.call(aargs, caller_ep, caller_env, scratch, replace_recv_ty: replace_recv_ty, replace_cref: replace_cref) do |ret_ty, ep, env|
    scratch.add_return_value!(dummy_ctx, ret_ty)
    ctn[ret_ty, ep, env]
  end
end
inspect() click to toggle source
# File typeprof-0.21.2/lib/typeprof/block.rb, line 150
def inspect
  "#<CustomBlock>"
end
substitute(_subst, _depth) click to toggle source
# File typeprof-0.21.2/lib/typeprof/block.rb, line 158
def substitute(_subst, _depth)
  self
end