class TypeProf::StaticEnv

Attributes

blk_ty[R]
mod_func[R]
pub_meth[R]
recv_ty[R]

Public Class Methods

new(recv_ty, blk_ty, mod_func, pub_meth) click to toggle source
# File typeprof-0.21.3/lib/typeprof/analyzer.rb, line 133
def initialize(recv_ty, blk_ty, mod_func, pub_meth)
  @recv_ty = recv_ty
  @blk_ty = blk_ty
  @mod_func = mod_func
  @pub_meth = pub_meth

  return if recv_ty == :top #OK
  recv_ty.each_child_global do |ty|
    raise ty.inspect if !ty.is_a?(Type::Instance) && !ty.is_a?(Type::Class) && !ty.is_a?(Type::Symbol) && ty != Type.any
  end
end

Public Instance Methods

merge(other) click to toggle source
# File typeprof-0.21.3/lib/typeprof/analyzer.rb, line 147
def merge(other)
  recv_ty = @recv_ty.union(other.recv_ty)
  blk_ty = @blk_ty.union(other.blk_ty)
  mod_func = @mod_func & other.mod_func # ??
  pub_meth = @pub_meth & other.pub_meth # ??
  StaticEnv.new(recv_ty, blk_ty, mod_func, pub_meth)
end