Skip to content
← Back

src/ir/values/load/static_field.ghul

1
namespace IR.Values.Load is
2
use TypeTyped = Semantic.Types.Typed
3
use SymbolBase = Semantic.Symbols.Symbol
4
5
// The cast to the symbol's expected kind is a checked construction
6
// invariant: the caller only ever builds this value with a symbol of
7
// that kind, so a throw here means the invariant broke elsewhere.
8
@suppress("cast-may-throw")
9
class STATIC_FIELD: SYMBOL, TypeTyped is
10
is_consumable: bool => true
11
is_lightweight_pure: bool => true
12
13
init(symbol: SymbolBase) is
14
super.init(null, symbol)
15
si
16
17
accept(visitor: Visitor) is
18
visitor.visit(self)
19
si
20
21
accept_address(visitor: Visitor) is
22
visitor.visit_address(self)
23
si
24
25
to_string() -> string =>
26
"load:[{type}](\"{symbol.name}\")"
27
si
28
si