Remove TypeInfo.Error.value

This commit is contained in:
Tadeo Kondrak 2020-08-21 14:37:50 -06:00 committed by Andrew Kelley
parent e919744c7a
commit a049c31f21
3 changed files with 1 additions and 7 deletions

View File

@ -289,8 +289,6 @@ pub const TypeInfo = union(enum) {
/// therefore must be kept in sync with the compiler implementation.
pub const Error = struct {
name: []const u8,
/// This field is ignored when using @Type().
value: comptime_int,
};
/// This data structure is used by the Zig language code generation and

View File

@ -25494,9 +25494,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy
error_val->special = ConstValSpecialStatic;
error_val->type = type_info_error_type;
ZigValue **inner_fields = alloc_const_vals_ptrs(ira->codegen, 2);
inner_fields[1]->special = ConstValSpecialStatic;
inner_fields[1]->type = ira->codegen->builtin_types.entry_num_lit_int;
ZigValue **inner_fields = alloc_const_vals_ptrs(ira->codegen, 1);
ZigValue *name = nullptr;
if (error->cached_error_name_val != nullptr)
@ -25504,7 +25502,6 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy
if (name == nullptr)
name = create_const_str_lit(ira->codegen, &error->name)->data.x_ptr.data.ref.pointee;
init_const_slice(ira->codegen, inner_fields[0], name, 0, buf_len(&error->name), true);
bigint_init_unsigned(&inner_fields[1]->data.x_bigint, error->value);
error_val->data.x_struct.fields = inner_fields;
error_val->parent.id = ConstParentIdArray;

View File

@ -153,7 +153,6 @@ fn testErrorSet() void {
expect(error_set_info == .ErrorSet);
expect(error_set_info.ErrorSet.?.len == 3);
expect(mem.eql(u8, error_set_info.ErrorSet.?[0].name, "First"));
expect(error_set_info.ErrorSet.?[2].value == @errorToInt(TestErrorSet.Third));
const error_union_info = @typeInfo(TestErrorSet!usize);
expect(error_union_info == .ErrorUnion);