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 451
def initialize(name) @name = name end
Instance Method Details
#add_subst!(ty, subst)
[ GitHub ]# File 'lib/typeprof/type.rb', line 475
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 471
def consistent?(_other) raise "should not be called: #{ self }" end
#each_free_type_variable {|_self| ... }
# File 'lib/typeprof/type.rb', line 459
def each_free_type_variable yield self end
#screen_name(scratch)
[ GitHub ]# File 'lib/typeprof/type.rb', line 455
def screen_name(scratch) "Var[#{ @name }]" end
#substitute(subst, depth)
[ GitHub ]# File 'lib/typeprof/type.rb', line 463
def substitute(subst, depth) if subst[self] subst[self].limit_size(depth) else self end end