Appearance
| 1 | namespace IR.Values is | |
| 2 | use Semantic.Types.Type; | |
| 3 | ||
| 4 | class UNBOX: Value is | |
| 5 | value: Value; | |
| 6 | type: Type? => 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 | context.write_line("unbox.any {type!.get_il_type()}"); | |
| 21 | si | |
| 22 | ||
| 23 | to_string() -> string => | |
| 24 | "unbox:[{type}]({value})"; | |
| 25 | si | |
| 26 | ||
| 27 | si |