Skip to content
← Back

src/ir/values/has_value.ghul

1
namespace IR.Values is
2
use TypeTyped = Semantic.Types.Typed;
3
use Semantic.Types.Type;
4
5
class HAS_VALUE: Value, TypeTyped is
6
type: Type;
7
8
value: Value;
9
10
init(
11
value: Value,
12
type: Type
13
) is
14
super.init();
15
16
self.value = value;
17
self.type = type;
18
si
19
20
gen(context: IR.CONTEXT) is
21
gen(value, context);
22
23
context.write_line("ldnull");
24
context.write_line("cgt.un");
25
si
26
27
to_string() -> string =>
28
"has-value:[{type}]({value})";
29
si
30
si