Class: TypeProf::CustomBlock
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Block
|
|
Instance Chain:
self,
Block ,
Utils::StructuralEquality
|
|
Inherits: |
TypeProf::Block
|
Defined in: | lib/typeprof/block.rb |
Class Method Summary
- .new(caller_ep, mid, &blk) ⇒ CustomBlock constructor
Instance Method Summary
Constructor Details
.new(caller_ep, mid, &blk) ⇒ CustomBlock
# File 'lib/typeprof/block.rb', line 144
def initialize(caller_ep, mid, &blk) @caller_ep = caller_ep @mid = mid @blk = blk end
Instance Method Details
#consistent?(other) ⇒ Boolean
# File '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)
[ GitHub ]# File '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
[ GitHub ]# File 'lib/typeprof/block.rb', line 150
def inspect "#<CustomBlock>" end
#substitute(_subst, _depth)
[ GitHub ]# File 'lib/typeprof/block.rb', line 158
def substitute(_subst, _depth) self end