123456789_123456789_123456789_123456789_123456789_

Class: TypeProf::Type::Literal

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

Overview

A local type

Constant Summary

::TypeProf::Type - Inherited

Builtin, DummySubstitution

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(lit, base_type) ⇒ Literal

[ GitHub ]

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

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

Instance Attribute Details

#base_type (readonly)

[ GitHub ]

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

attr_reader :lit, :base_type

#lit (readonly)

[ GitHub ]

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

attr_reader :lit, :base_type

Instance Method Details

#consistent?(_other) ⇒ Boolean

[ GitHub ]

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

def consistent?(_other)
  raise "should not called"
end

#globalize(_env, _visited, _depth)

[ GitHub ]

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

def globalize(_env, _visited, _depth)
  @base_type
end

#inspect

[ GitHub ]

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

def inspect
  "Type::Literal[#{ @lit.inspect }, #{ @base_type.inspect }]"
end

#method_dispatch_info

[ GitHub ]

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

def method_dispatch_info
  @base_type.method_dispatch_info
end

#screen_name(scratch)

[ GitHub ]

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

def screen_name(scratch)
  @base_type.screen_name(scratch) + "<#{ @lit.inspect }>"
end