Class: TypeProf::Type::Var
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
::TypeProf::Type
|
|
Instance Chain:
|
|
Inherits: |
TypeProf::Type
|
Defined in: | lib/typeprof/type.rb |
Constant Summary
::TypeProf::Type
- Inherited
Class Method Summary
- .new(name) ⇒ Var constructor
::TypeProf::Type
- Inherited
Instance Method Summary
- #add_subst!(ty, subst)
- #consistent?(_other) ⇒ Boolean
- #each_free_type_variable {|_self| ... }
- #screen_name(scratch)
- #substitute(subst, depth)
::TypeProf::Type
- Inherited
Constructor Details
.new(name) ⇒ Var
# File 'lib/typeprof/type.rb', line 448
def initialize(name) @name = name end
Instance Method Details
#add_subst!(ty, subst)
[ GitHub ]# File 'lib/typeprof/type.rb', line 472
def add_subst!(ty, subst) if subst[self] subst[self] = subst[self].union(ty) else subst[self] = ty end true end
#consistent?(_other) ⇒ Boolean
# File 'lib/typeprof/type.rb', line 468
def consistent?(_other) raise "should not be called: #{ self }" end
#each_free_type_variable {|_self| ... }
# File 'lib/typeprof/type.rb', line 456
def each_free_type_variable yield self end
#screen_name(scratch)
[ GitHub ]# File 'lib/typeprof/type.rb', line 452
def screen_name(scratch) "Var[#{ @name }]" end
#substitute(subst, depth)
[ GitHub ]# File 'lib/typeprof/type.rb', line 460
def substitute(subst, depth) if subst[self] subst[self].limit_size(depth) else self end end