123456789_123456789_123456789_123456789_123456789_

Class: TypeProf::StaticEnv

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Instance Chain:
Inherits: Object
Defined in: lib/typeprof/analyzer.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(recv_ty, blk_ty, mod_func, pub_meth) ⇒ StaticEnv

[ GitHub ]

  
# File '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

Instance Attribute Details

#blk_ty (readonly)

[ GitHub ]

  
# File 'lib/typeprof/analyzer.rb', line 145

attr_reader :recv_ty, :blk_ty, :mod_func, :pub_meth

#mod_func (readonly)

[ GitHub ]

  
# File 'lib/typeprof/analyzer.rb', line 145

attr_reader :recv_ty, :blk_ty, :mod_func, :pub_meth

#pub_meth (readonly)

[ GitHub ]

  
# File 'lib/typeprof/analyzer.rb', line 145

attr_reader :recv_ty, :blk_ty, :mod_func, :pub_meth

#recv_ty (readonly)

[ GitHub ]

  
# File 'lib/typeprof/analyzer.rb', line 145

attr_reader :recv_ty, :blk_ty, :mod_func, :pub_meth

Instance Method Details

#merge(other)

[ GitHub ]

  
# File '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