class TypedRb::Model::TmVar

variable

Attributes

val[RW]

Public Class Methods

new(val, node) click to toggle source
Calls superclass method TypedRb::Model::Expr::new
# File lib/typed/model/tm_var.rb, line 9
def initialize(val, node)
  super(node)
  @val = val.to_s
end

Public Instance Methods

check_type(context) click to toggle source
# File lib/typed/model/tm_var.rb, line 18
def check_type(context)
  type = context.get_type_for(@val)
  if type.nil?
    fail TypeCheckError.new("Type error checking local var #{@val}: Cannot find binding local var in the typing context", node)
  end
  type
end
to_s() click to toggle source
# File lib/typed/model/tm_var.rb, line 14
def to_s
  "#{GenSym.resolve(@val)}"
end