Class: Carbon::Tacky::Reference
- Inherits:
-
Object
- Object
- Carbon::Tacky::Reference
- Defined in:
- lib/carbon/tacky/reference.rb
Overview
A "reference." A reference is essentially a mapping to an instruction that returned a value, and the reference takes the place of said value. The reference represents the return value of an instruction.
Instance Attribute Summary collapse
-
#id ⇒ ::Numeric
readonly
The id of the instruction that this reference points to.
Instance Method Summary collapse
- #as(type) ⇒ Object
-
#initialize(id) ⇒ Reference
constructor
Initializes the reference with the given ID.
Constructor Details
#initialize(id) ⇒ Reference
Initializes the reference with the given ID.
18 19 20 |
# File 'lib/carbon/tacky/reference.rb', line 18 def initialize(id) @id = id end |
Instance Attribute Details
#id ⇒ ::Numeric (readonly)
The id of the instruction that this reference points to.
13 14 15 |
# File 'lib/carbon/tacky/reference.rb', line 13 def id @id end |
Instance Method Details
#as(type) ⇒ Object
22 23 24 |
# File 'lib/carbon/tacky/reference.rb', line 22 def as(type) Tacky::Typed.new(self, type) end |