Skip to content
← Back

src/semantic/symbols/function_wrapper.ghul

1
namespace Semantic is
2
use IO.Std;
3
4
use Symbols.Function;
5
6
class FUNCTION_WRAPPER(function: Function) is
7
_hash: int;
8
_root_function: Symbols.Symbol;
9
10
equals(other: object?) -> bool is
11
if !other? then
12
return false;
13
elif !isa FUNCTION_WRAPPER(other) then
14
return false;
15
fi
16
17
return self =~ other;
18
si
19
20
=~(other: FUNCTION_WRAPPER) -> bool =>
21
_root_function == other._root_function;
22
23
init(..) is
24
_root_function = function.root_specialized_from;
25
_hash = _root_function.get_hash_code();
26
si
27
28
get_hash_code() -> int => _hash;
29
30
to_string() -> string => "{function}";
31
si
32
si