123456789_123456789_123456789_123456789_123456789_

Class: TypeProf::Type::Symbol

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(sym, base_type) ⇒ Symbol

[ GitHub ]

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

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

Instance Attribute Details

#base_type (readonly)

[ GitHub ]

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

attr_reader :sym, :base_type

#sym (readonly)

[ GitHub ]

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

attr_reader :sym, :base_type

Instance Method Details

#consistent?(other) ⇒ Boolean

[ GitHub ]

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

def consistent?(other)
  case other
  when Symbol
    @sym == other.sym
  else
    @base_type.consistent?(other)
  end
end

#inspect

[ GitHub ]

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

def inspect
  "Type::Symbol[#{ @sym ? @sym.inspect : "(dynamic symbol)" }, #{ @base_type.inspect }]"
end

#method_dispatch_info

[ GitHub ]

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

def method_dispatch_info
  @base_type.method_dispatch_info
end

#screen_name(scratch)

[ GitHub ]

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

def screen_name(scratch)
  if @sym
    @sym.inspect
  else
    @base_type.screen_name(scratch)
  end
end

#substitute(_subst, _depth)

[ GitHub ]

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

def substitute(_subst, _depth)
  self # dummy
end