Class: TypedRb::Model::TmGlobalVar

Inherits:
Expr show all
Defined in:
lib/typed/model/tm_global_var.rb

Overview

instance variable

Instance Attribute Summary collapse

Attributes inherited from Expr

#col, #line, #node, #type

Instance Method Summary collapse

Constructor Details

#initialize(val, node) ⇒ TmGlobalVar

Returns a new instance of TmGlobalVar.



10
11
12
13
# File 'lib/typed/model/tm_global_var.rb', line 10

def initialize(val, node)
  super(node)
  @val = val
end

Instance Attribute Details

#valObject

Returns the value of attribute val.



8
9
10
# File 'lib/typed/model/tm_global_var.rb', line 8

def val
  @val
end

Instance Method Details

#check_type(_context) ⇒ Object



15
16
17
18
19
# File 'lib/typed/model/tm_global_var.rb', line 15

def check_type(_context)
  type = Types::TypingContext.type_variable_for_global(val)
  type.node = node
  type
end