Skip to content
← Back

src/ir/values/typeof.ghul

1
namespace IR.Values is
2
use Semantic.Types.Type
3
4
class TYPEOF: Value is
5
type: Type
6
typeof_type: Type
7
8
init(
9
type: Type,
10
typeof_type: Type
11
) is
12
super.init()
13
14
self.type = type
15
self.typeof_type = typeof_type
16
si
17
18
gen(context: IR.CONTEXT) is
19
let body = context.current_srm_body_emitter!
20
body.ldtoken(context.resolve_type_token(typeof_type))
21
body.call(context.resolve_get_type_from_handle())
22
si
23
24
to_string() -> string =>
25
"typeof:[{type}]({typeof_type})"
26
si
27
si