class TypeProf::Type::Var

Public Class Methods

new(name) click to toggle source
# File typeprof-0.21.9/lib/typeprof/type.rb, line 451
def initialize(name)
  @name = name
end

Public Instance Methods

add_subst!(ty, subst) click to toggle source
# File typeprof-0.21.9/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) click to toggle source
# File typeprof-0.21.9/lib/typeprof/type.rb, line 471
def consistent?(_other)
  raise "should not be called: #{ self }"
end
each_free_type_variable() { |self| ... } click to toggle source
# File typeprof-0.21.9/lib/typeprof/type.rb, line 459
def each_free_type_variable
  yield self
end
screen_name(scratch) click to toggle source
# File typeprof-0.21.9/lib/typeprof/type.rb, line 455
def screen_name(scratch)
  "Var[#{ @name }]"
end
substitute(subst, depth) click to toggle source
# File typeprof-0.21.9/lib/typeprof/type.rb, line 463
def substitute(subst, depth)
  if subst[self]
    subst[self].limit_size(depth)
  else
    self
  end
end