class SFRP::Poly::VConstCallExp

Public Class Methods

new(vconst_str, arg_exps, id = nil) click to toggle source
# File lib/sfrp/poly/expression.rb, line 76
def initialize(vconst_str, arg_exps, id = nil)
  @vconst_str = vconst_str
  @arg_exps = arg_exps
  @id = id
end

Public Instance Methods

called_func_strs() click to toggle source
# File lib/sfrp/poly/expression.rb, line 94
def called_func_strs
  @arg_exps.flat_map(&:called_func_strs)
end
clone() click to toggle source
# File lib/sfrp/poly/expression.rb, line 90
def clone
  VConstCallExp.new(@vconst_str, @arg_exps.map(&:clone), @id)
end
to_mono(monofier) click to toggle source
# File lib/sfrp/poly/expression.rb, line 98
def to_mono(monofier)
  raise UndeterminableTypeError.new(@id, @typing) unless @typing.mono?
  mono_vconst_str = monofier.use_vconst(@vconst_str, @typing)
  args = @arg_exps.map { |e| e.to_mono(monofier) }
  M.vc_call_e(monofier.use_type(@typing), mono_vconst_str, *args)
end
typing(set, var_env) click to toggle source
# File lib/sfrp/poly/expression.rb, line 82
def typing(set, var_env)
  raise if @typing
  @ftyping = set.vconst(@vconst_str).ftyping.instance do |ft|
    ft.params.zip(@arg_exps) { |t, e| e.typing(set, var_env).unify(t) }
  end
  @typing = @ftyping.body
end