class SFRP::Poly::VConst

Attributes

str[R]

Public Class Methods

new(str, annot_vars, ftype_annot, native_str = nil) click to toggle source
# File lib/sfrp/poly/elements.rb, line 144
def initialize(str, annot_vars, ftype_annot, native_str = nil)
  @str = str
  @annot_vars = annot_vars
  @ftype_annot = ftype_annot
  @native_str = native_str
end

Public Instance Methods

clone() click to toggle source
# File lib/sfrp/poly/elements.rb, line 155
def clone
  VConst.new(@str, @annot_vars, @ftype_annot, @native_str)
end
ftyping() click to toggle source
# File lib/sfrp/poly/elements.rb, line 151
def ftyping
  @ftyping ||= @ftype_annot.to_ftyping(@annot_vars)
end
to_mono(monofier) click to toggle source
# File lib/sfrp/poly/elements.rb, line 159
def to_mono(monofier)
  raise UndeterminableTypeError.new(@str, @ftyping) unless @ftyping.mono?
  type_str = monofier.use_type(@ftyping.body)
  vconst_str = monofier.use_vconst(@str, @ftyping.body)
  arg_type_strs = @ftyping.params.map { |t| monofier.use_type(t) }
  M.vconst(type_str, vconst_str, arg_type_strs, @native_str)
end