Skip to content
← Back

src/ir/values/tuple.ghul

1
namespace IR.Values is
2
use TypeTyped = Semantic.Types.Typed
3
use Semantic.Types.Type
4
5
class TUPLE: Value, TypeTyped is
6
type: Type
7
8
values: Collections.List[Value]
9
10
init(type: Type, values: Collections.List[Value]) is
11
super.init()
12
13
self.type = type
14
self.values = values
15
si
16
17
gen(context: IR.CONTEXT) is
18
let body = context.current_srm_body_emitter!
19
for v in values do
20
gen(v, context)
21
od
22
23
body.new_object(context.resolve_generic_constructor(type, values.count))
24
si
25
26
to_string() -> string =>
27
"tuple:[{type}]({values})"
28
si
29
si