123456789_123456789_123456789_123456789_123456789_

Class: TypeProf::Type::Proc

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: TypeProf::Type
Defined in: lib/typeprof/type.rb

Constant Summary

::TypeProf::Type - Inherited

Builtin, DummySubstitution

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(block_body, base_type) ⇒ Proc

[ GitHub ]

  
# File 'lib/typeprof/type.rb', line 628

def initialize(block_body, base_type)
  @block_body, @base_type = block_body, base_type
end

Instance Attribute Details

#base_type (readonly)

[ GitHub ]

  
# File 'lib/typeprof/type.rb', line 632

attr_reader :block_body, :base_type

#block_body (readonly)

[ GitHub ]

  
# File 'lib/typeprof/type.rb', line 632

attr_reader :block_body, :base_type

Instance Method Details

#consistent?(other) ⇒ Boolean

[ GitHub ]

  
# File 'lib/typeprof/type.rb', line 634

def consistent?(other)
  case other
  when Type::Proc
    @block_body.consistent?(other.block_body)
  else
    self == other
  end
end

#include_untyped?(scratch) ⇒ Boolean

[ GitHub ]

  
# File 'lib/typeprof/type.rb', line 655

def include_untyped?(scratch)
  false # XXX: need to check the block signatures recursively
end

#method_dispatch_info

[ GitHub ]

  
# File 'lib/typeprof/type.rb', line 643

def method_dispatch_info
  @base_type.method_dispatch_info
end

#screen_name(scratch)

[ GitHub ]

  
# File 'lib/typeprof/type.rb', line 651

def screen_name(scratch)
  scratch.show_proc_signature([self])
end

#substitute(subst, depth)

[ GitHub ]

  
# File 'lib/typeprof/type.rb', line 647

def substitute(subst, depth)
  Proc.new(@block_body.substitute(subst, depth), @base_type)
end