Class: Yadriggy::LocalVarType
- Inherits:
-
OptionalRole
- Object
- Type
- OptionalRole
- Yadriggy::LocalVarType
- Defined in:
- lib/yadriggy/type.rb
Overview
Type of the value of a local variable.
Instance Attribute Summary collapse
-
#definition ⇒ ASTnode|Undef|nil
The AST node where the variable appears for the first time, in other words, where the variable's type is defined.
Instance Method Summary collapse
-
#initialize(type, definition) ⇒ LocalVarType
constructor
A new instance of LocalVarType.
Methods inherited from OptionalRole
Methods inherited from Type
#!=, #<=, #copy, #eql?, error_found!, #exact_type, #has_role?, #name, role, #supertype
Constructor Details
#initialize(type, definition) ⇒ LocalVarType
Returns a new instance of LocalVarType.
749 750 751 752 |
# File 'lib/yadriggy/type.rb', line 749 def initialize(type, definition) super(type) @definition = definition end |
Instance Attribute Details
#definition ⇒ ASTnode|Undef|nil
Returns the AST node where the variable appears
for the first time, in other words,
where the variable's type is defined.
Undef
if a value is assigned to the variable
more than once.
nil
if an initial value has not been assigned
to the variable yet.
744 745 746 |
# File 'lib/yadriggy/type.rb', line 744 def definition @definition end |