Skip to content
← Back

src/ir/values/load/global_anonymous_function.ghul

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