Skip to content
← Back

src/ir/values/call/static.ghul

1
namespace IR.Values.Call is
2
use TypeTyped = Semantic.Types.Typed
3
use Semantic.Types.Type
4
5
class STATIC: Value, TypeTyped is
6
is_state_changing_call: bool => !function.is_store_free
7
function: Semantic.Symbols.Function
8
arguments: Collections.List[Value]
9
type: Type
10
11
// The type a static interface member is dispatched through,
12
// when it needs the CLR's `constrained.` prefix; null
13
// otherwise. A bound type parameter where the call is generic,
14
// and the concrete type where the interface is instantiated at
15
// one.
16
constrained_receiver: Type?
17
18
init(function: Semantic.Symbols.Function, arguments: Collections.List[Value], type: Type?, constrained_receiver: Type?) is
19
super.init()
20
21
self.function = function
22
self.arguments = arguments
23
self.constrained_receiver = constrained_receiver
24
25
if type? then
26
self.type = type
27
else
28
self.type = function.return_type!
29
fi
30
si
31
32
accept(visitor: Visitor) is
33
visitor.visit(self)
34
si
35
36
to_string() -> string =>
37
"static-call:[{type}](\"{function.name}\",{arguments})"
38
si
39
si