Skip to content
← Back

src/ir/values/unbox.ghul

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