Class: TypedRb::Model::TmVar
Overview
variable
Instance Attribute Summary collapse
-
#val ⇒ Object
Returns the value of attribute val.
Attributes inherited from Expr
Instance Method Summary collapse
- #check_type(context) ⇒ Object
-
#initialize(val, node) ⇒ TmVar
constructor
A new instance of TmVar.
- #to_s ⇒ Object
Constructor Details
#initialize(val, node) ⇒ TmVar
Returns a new instance of TmVar.
10 11 12 13 |
# File 'lib/typed/model/tm_var.rb', line 10 def initialize(val, node) super(node) @val = val.to_s end |
Instance Attribute Details
#val ⇒ Object
Returns the value of attribute val.
8 9 10 |
# File 'lib/typed/model/tm_var.rb', line 8 def val @val end |
Instance Method Details
#check_type(context) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/typed/model/tm_var.rb', line 19 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 |