| ... | ... | @@ -1007,22 +1007,16 @@ fn walkInstruction( |
| 1007 | 1007 | // we only ask to figure out type info for the first element |
| 1008 | 1008 | // as it will be used later on to find out the array type! |
| 1009 | 1009 | const wr = try self.walkRef(file, parent_scope, op, idx == 0); |
| 1010 | | |
| 1011 | 1010 | if (idx == 0) { |
| 1012 | 1011 | array_type = wr.typeRef; |
| 1013 | 1012 | } |
| 1014 | 1013 | |
| 1015 | | // create an untion to hold more than one type |
| 1016 | | switch (@intToEnum(Ref, wr.typeRef.?.type)) { |
| 1017 | | .comptime_int_type => { |
| 1018 | | array_data[idx] = wr.expr.int.value; |
| 1019 | | }, |
| 1020 | | .comptime_float_type => { |
| 1021 | | unreachable; |
| 1022 | | // array_data[idx] = wr.expr.float; |
| 1023 | | }, |
| 1024 | | else => continue, |
| 1025 | | } |
| 1014 | // array_init_anon doesn't have the elements in @as nodes |
| 1015 | // so it's necessary append them to expr array |
| 1016 | // and remember their positions |
| 1017 | const expr_index = self.exprs.items.len; |
| 1018 | try self.exprs.append(self.arena, wr.expr); |
| 1019 | array_data[idx] = expr_index; |
| 1026 | 1020 | } |
| 1027 | 1021 | |
| 1028 | 1022 | const type_slot_index = self.types.items.len; |