Skip to content
← Back

src/ir/values/load/static_anonymous_function.ghul

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