| ... | @@ -1117,7 +1117,18 @@ fn addDbgInfoType( | ... | @@ -1117,7 +1117,18 @@ fn addDbgInfoType( |
| 1117 | // DW.AT.const_value, DW.FORM.data8 | 1117 | // DW.AT.const_value, DW.FORM.data8 |
| 1118 | mem.writeInt(u64, dbg_info_buffer.addManyAsArrayAssumeCapacity(8), 0, target_endian); | 1118 | mem.writeInt(u64, dbg_info_buffer.addManyAsArrayAssumeCapacity(8), 0, target_endian); |
| 1119 | | 1119 | |
| 1120 | const error_names = if (ty.isAnyError()) module.error_name_list.items else ty.errorSetNames(); | 1120 | const error_names = blk: { |
| | 1121 | if (ty.isAnyError()) |
| | 1122 | break :blk module.error_name_list.items; |
| | 1123 | // TODO not quite sure about the next one, but if I don't do this, I risk |
| | 1124 | // tripping an assert in `Type.errorSetNames` in case the inferred error set |
| | 1125 | // was not yet fully resolved. This so far only surfaced when this code would |
| | 1126 | // schedule analysis of an error set part of some error union. |
| | 1127 | if (ty.tag() == .error_set_inferred) |
| | 1128 | break :blk ty.castTag(.error_set_inferred).?.data.errors.keys(); |
| | 1129 | break :blk ty.errorSetNames(); |
| | 1130 | }; |
| | 1131 | |
| 1121 | for (error_names) |error_name| { | 1132 | for (error_names) |error_name| { |
| 1122 | const kv = module.getErrorValue(error_name) catch unreachable; | 1133 | const kv = module.getErrorValue(error_name) catch unreachable; |
| 1123 | // DW.AT.enumerator | 1134 | // DW.AT.enumerator |