authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-12-08 19:52:05+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-12-09 20:37:18-07:00
log9d93b2ccf11f584320a2c5209dd2d94705167695
treebc746509f92c029be2b6cd3338aace01a5baa91e
parent5831b68341827b544ea3f268c921e9044bd11047

Eliminate `BoundFn` type from the language

Closes #9484

23 files changed, 3 insertions(+), 52 deletions(-)

doc/langref.html.in+1-6
...@@ -9366,12 +9366,7 @@ test "integer truncation" {...@@ -9366,12 +9366,7 @@ test "integer truncation" {
9366 <li>{#link|union#}</li>9366 <li>{#link|union#}</li>
9367 </ul>9367 </ul>
9368 <p>9368 <p>
9369 For these types, {#syntax#}@Type{#endsyntax#} is not available:9369 {#syntax#}@Type{#endsyntax#} is not available for {#link|Functions#}.
9370 </p>
9371 <ul>
9372 <li>{#link|Functions#}</li>
9373 <li>BoundFn</li>
9374 </ul>
9375 {#header_close#}9370 {#header_close#}
9376 {#header_open|@typeInfo#}9371 {#header_open|@typeInfo#}
9377 <pre>{#syntax#}@typeInfo(comptime T: type) std.builtin.Type{#endsyntax#}</pre>9372 <pre>{#syntax#}@typeInfo(comptime T: type) std.builtin.Type{#endsyntax#}</pre>
lib/std/builtin.zig-1
...@@ -210,7 +210,6 @@ pub const Type = union(enum) {...@@ -210,7 +210,6 @@ pub const Type = union(enum) {
210 Enum: Enum,210 Enum: Enum,
211 Union: Union,211 Union: Union,
212 Fn: Fn,212 Fn: Fn,
213 BoundFn: Fn,
214 Opaque: Opaque,213 Opaque: Opaque,
215 Frame: Frame,214 Frame: Frame,
216 AnyFrame: AnyFrame,215 AnyFrame: AnyFrame,
lib/std/hash/auto_hash.zig+1-1
...@@ -101,7 +101,7 @@ pub fn hash(hasher: anytype, key: anytype, comptime strat: HashStrategy) void {...@@ -101,7 +101,7 @@ pub fn hash(hasher: anytype, key: anytype, comptime strat: HashStrategy) void {
101 .Bool => hash(hasher, @boolToInt(key), strat),101 .Bool => hash(hasher, @boolToInt(key), strat),
102 .Enum => hash(hasher, @enumToInt(key), strat),102 .Enum => hash(hasher, @enumToInt(key), strat),
103 .ErrorSet => hash(hasher, @errorToInt(key), strat),103 .ErrorSet => hash(hasher, @errorToInt(key), strat),
104 .AnyFrame, .BoundFn, .Fn => hash(hasher, @ptrToInt(key), strat),104 .AnyFrame, .Fn => hash(hasher, @ptrToInt(key), strat),
105105
106 .Pointer => @call(.{ .modifier = .always_inline }, hashPointer, .{ hasher, key, strat }),106 .Pointer => @call(.{ .modifier = .always_inline }, hashPointer, .{ hasher, key, strat }),
107107
lib/std/mem.zig-1
...@@ -308,7 +308,6 @@ pub fn zeroes(comptime T: type) T {...@@ -308,7 +308,6 @@ pub fn zeroes(comptime T: type) T {
308 .ErrorUnion,308 .ErrorUnion,
309 .ErrorSet,309 .ErrorSet,
310 .Fn,310 .Fn,
311 .BoundFn,
312 .Type,311 .Type,
313 .NoReturn,312 .NoReturn,
314 .Undefined,313 .Undefined,
lib/std/meta/trait.zig-1
...@@ -549,7 +549,6 @@ pub fn hasUniqueRepresentation(comptime T: type) bool {...@@ -549,7 +549,6 @@ pub fn hasUniqueRepresentation(comptime T: type) bool {
549 else => return false, // TODO can we know if it's true for some of these types ?549 else => return false, // TODO can we know if it's true for some of these types ?
550550
551 .AnyFrame,551 .AnyFrame,
552 .BoundFn,
553 .Enum,552 .Enum,
554 .ErrorSet,553 .ErrorSet,
555 .Fn,554 .Fn,
lib/std/testing.zig-1
...@@ -46,7 +46,6 @@ pub fn expectError(expected_error: anyerror, actual_error_union: anytype) !void...@@ -46,7 +46,6 @@ pub fn expectError(expected_error: anyerror, actual_error_union: anytype) !void
46pub fn expectEqual(expected: anytype, actual: @TypeOf(expected)) !void {46pub fn expectEqual(expected: anytype, actual: @TypeOf(expected)) !void {
47 switch (@typeInfo(@TypeOf(actual))) {47 switch (@typeInfo(@TypeOf(actual))) {
48 .NoReturn,48 .NoReturn,
49 .BoundFn,
50 .Opaque,49 .Opaque,
51 .Frame,50 .Frame,
52 .AnyFrame,51 .AnyFrame,
src/Autodoc.zig-1
...@@ -607,7 +607,6 @@ const DocData = struct {...@@ -607,7 +607,6 @@ const DocData = struct {
607 is_test: bool = false,607 is_test: bool = false,
608 is_extern: bool = false,608 is_extern: bool = false,
609 },609 },
610 BoundFn: struct { name: []const u8 },
611 Opaque: struct {610 Opaque: struct {
612 name: []const u8,611 name: []const u8,
613 src: usize, // index into astNodes612 src: usize, // index into astNodes
src/Sema.zig-14
...@@ -9275,7 +9275,6 @@ fn zirBitcast(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air...@@ -9275,7 +9275,6 @@ fn zirBitcast(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air
9275 dest_ty.fmt(sema.mod), container,9275 dest_ty.fmt(sema.mod), container,
9276 });9276 });
9277 },9277 },
9278 .BoundFn => @panic("TODO remove this type from the language and compiler"),
92799278
9280 .Array,9279 .Array,
9281 .Bool,9280 .Bool,
...@@ -9339,7 +9338,6 @@ fn zirBitcast(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air...@@ -9339,7 +9338,6 @@ fn zirBitcast(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air
9339 operand_ty.fmt(sema.mod), container,9338 operand_ty.fmt(sema.mod), container,
9340 });9339 });
9341 },9340 },
9342 .BoundFn => @panic("TODO remove this type from the language and compiler"),
93439341
9344 .Array,9342 .Array,
9345 .Bool,9343 .Bool,
...@@ -9777,7 +9775,6 @@ fn zirSwitchCond(...@@ -9777,7 +9775,6 @@ fn zirSwitchCond(
9777 .Undefined,9775 .Undefined,
9778 .Null,9776 .Null,
9779 .Optional,9777 .Optional,
9780 .BoundFn,
9781 .Opaque,9778 .Opaque,
9782 .Vector,9779 .Vector,
9783 .Frame,9780 .Frame,
...@@ -10361,7 +10358,6 @@ fn zirSwitchBlock(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError...@@ -10361,7 +10358,6 @@ fn zirSwitchBlock(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError
10361 .Undefined,10358 .Undefined,
10362 .Null,10359 .Null,
10363 .Optional,10360 .Optional,
10364 .BoundFn,
10365 .Opaque,10361 .Opaque,
10366 .Vector,10362 .Vector,
10367 .Frame,10363 .Frame,
...@@ -14833,7 +14829,6 @@ fn zirSizeOf(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air....@@ -14833,7 +14829,6 @@ fn zirSizeOf(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.
14833 .NoReturn,14829 .NoReturn,
14834 .Undefined,14830 .Undefined,
14835 .Null,14831 .Null,
14836 .BoundFn,
14837 .Opaque,14832 .Opaque,
14838 => return sema.fail(block, operand_src, "no size available for type '{}'", .{ty.fmt(sema.mod)}),14833 => return sema.fail(block, operand_src, "no size available for type '{}'", .{ty.fmt(sema.mod)}),
1483914834
...@@ -14877,7 +14872,6 @@ fn zirBitSizeOf(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A...@@ -14877,7 +14872,6 @@ fn zirBitSizeOf(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
14877 .NoReturn,14872 .NoReturn,
14878 .Undefined,14873 .Undefined,
14879 .Null,14874 .Null,
14880 .BoundFn,
14881 .Opaque,14875 .Opaque,
14882 => return sema.fail(block, operand_src, "no size available for type '{}'", .{operand_ty.fmt(sema.mod)}),14876 => return sema.fail(block, operand_src, "no size available for type '{}'", .{operand_ty.fmt(sema.mod)}),
1488314877
...@@ -15908,7 +15902,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai...@@ -15908,7 +15902,6 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
15908 }),15902 }),
15909 );15903 );
15910 },15904 },
15911 .BoundFn => @panic("TODO remove this type from the language and compiler"),
15912 .Frame => return sema.failWithUseOfAsync(block, src),15905 .Frame => return sema.failWithUseOfAsync(block, src),
15913 .AnyFrame => return sema.failWithUseOfAsync(block, src),15906 .AnyFrame => return sema.failWithUseOfAsync(block, src),
15914 }15907 }
...@@ -18609,7 +18602,6 @@ fn zirReify(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData, in...@@ -18609,7 +18602,6 @@ fn zirReify(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData, in
18609 const ty = try Type.Tag.function.create(sema.arena, fn_info);18602 const ty = try Type.Tag.function.create(sema.arena, fn_info);
18610 return sema.addType(ty);18603 return sema.addType(ty);
18611 },18604 },
18612 .BoundFn => @panic("TODO delete BoundFn from the language"),
18613 .Frame => return sema.failWithUseOfAsync(block, src),18605 .Frame => return sema.failWithUseOfAsync(block, src),
18614 }18606 }
18615}18607}
...@@ -21790,7 +21782,6 @@ fn validateRunTimeType(...@@ -21790,7 +21782,6 @@ fn validateRunTimeType(
2179021782
21791 .Enum => return !(try sema.typeRequiresComptime(ty)),21783 .Enum => return !(try sema.typeRequiresComptime(ty)),
2179221784
21793 .BoundFn,
21794 .ComptimeFloat,21785 .ComptimeFloat,
21795 .ComptimeInt,21786 .ComptimeInt,
21796 .EnumLiteral,21787 .EnumLiteral,
...@@ -21876,7 +21867,6 @@ fn explainWhyTypeIsComptimeInner(...@@ -21876,7 +21867,6 @@ fn explainWhyTypeIsComptimeInner(
21876 try mod.errNoteNonLazy(src_loc, msg, "types are not available at runtime", .{});21867 try mod.errNoteNonLazy(src_loc, msg, "types are not available at runtime", .{});
21877 },21868 },
2187821869
21879 .BoundFn,
21880 .ComptimeFloat,21870 .ComptimeFloat,
21881 .ComptimeInt,21871 .ComptimeInt,
21882 .EnumLiteral,21872 .EnumLiteral,
...@@ -21986,7 +21976,6 @@ fn validateExternType(...@@ -21986,7 +21976,6 @@ fn validateExternType(
21986 .Null,21976 .Null,
21987 .ErrorUnion,21977 .ErrorUnion,
21988 .ErrorSet,21978 .ErrorSet,
21989 .BoundFn,
21990 .Frame,21979 .Frame,
21991 => return false,21980 => return false,
21992 .Void => return position == .union_field or position == .ret_ty,21981 .Void => return position == .union_field or position == .ret_ty,
...@@ -22058,7 +22047,6 @@ fn explainWhyTypeIsNotExtern(...@@ -22058,7 +22047,6 @@ fn explainWhyTypeIsNotExtern(
22058 .Null,22047 .Null,
22059 .ErrorUnion,22048 .ErrorUnion,
22060 .ErrorSet,22049 .ErrorSet,
22061 .BoundFn,
22062 .Frame,22050 .Frame,
22063 => return,22051 => return,
2206422052
...@@ -22116,7 +22104,6 @@ fn validatePackedType(ty: Type) bool {...@@ -22116,7 +22104,6 @@ fn validatePackedType(ty: Type) bool {
22116 .Null,22104 .Null,
22117 .ErrorUnion,22105 .ErrorUnion,
22118 .ErrorSet,22106 .ErrorSet,
22119 .BoundFn,
22120 .Frame,22107 .Frame,
22121 .NoReturn,22108 .NoReturn,
22122 .Opaque,22109 .Opaque,
...@@ -22158,7 +22145,6 @@ fn explainWhyTypeIsNotPacked(...@@ -22158,7 +22145,6 @@ fn explainWhyTypeIsNotPacked(
22158 .EnumLiteral,22145 .EnumLiteral,
22159 .Undefined,22146 .Undefined,
22160 .Null,22147 .Null,
22161 .BoundFn,
22162 .Frame,22148 .Frame,
22163 .NoReturn,22149 .NoReturn,
22164 .Opaque,22150 .Opaque,
src/arch/aarch64/CodeGen.zig-1
...@@ -6200,7 +6200,6 @@ fn genTypedValue(self: *Self, arg_tv: TypedValue) InnerError!MCValue {...@@ -6200,7 +6200,6 @@ fn genTypedValue(self: *Self, arg_tv: TypedValue) InnerError!MCValue {
6200 .NoReturn => unreachable,6200 .NoReturn => unreachable,
6201 .Undefined => unreachable,6201 .Undefined => unreachable,
6202 .Null => unreachable,6202 .Null => unreachable,
6203 .BoundFn => unreachable,
6204 .Opaque => unreachable,6203 .Opaque => unreachable,
62056204
6206 else => {},6205 else => {},
src/arch/aarch64/abi.zig-1
...@@ -64,7 +64,6 @@ pub fn classifyType(ty: Type, target: std.Target) Class {...@@ -64,7 +64,6 @@ pub fn classifyType(ty: Type, target: std.Target) Class {
64 .ComptimeInt,64 .ComptimeInt,
65 .Undefined,65 .Undefined,
66 .Null,66 .Null,
67 .BoundFn,
68 .Fn,67 .Fn,
69 .Opaque,68 .Opaque,
70 .EnumLiteral,69 .EnumLiteral,
src/arch/arm/CodeGen.zig-1
...@@ -6156,7 +6156,6 @@ fn genTypedValue(self: *Self, arg_tv: TypedValue) InnerError!MCValue {...@@ -6156,7 +6156,6 @@ fn genTypedValue(self: *Self, arg_tv: TypedValue) InnerError!MCValue {
6156 .NoReturn => unreachable,6156 .NoReturn => unreachable,
6157 .Undefined => unreachable,6157 .Undefined => unreachable,
6158 .Null => unreachable,6158 .Null => unreachable,
6159 .BoundFn => unreachable,
6160 .Opaque => unreachable,6159 .Opaque => unreachable,
61616160
6162 else => {},6161 else => {},
src/arch/arm/abi.zig-1
...@@ -105,7 +105,6 @@ pub fn classifyType(ty: Type, target: std.Target, ctx: Context) Class {...@@ -105,7 +105,6 @@ pub fn classifyType(ty: Type, target: std.Target, ctx: Context) Class {
105 .ComptimeInt,105 .ComptimeInt,
106 .Undefined,106 .Undefined,
107 .Null,107 .Null,
108 .BoundFn,
109 .Fn,108 .Fn,
110 .Opaque,109 .Opaque,
111 .EnumLiteral,110 .EnumLiteral,
src/arch/riscv64/abi.zig-1
...@@ -63,7 +63,6 @@ pub fn classifyType(ty: Type, target: std.Target) Class {...@@ -63,7 +63,6 @@ pub fn classifyType(ty: Type, target: std.Target) Class {
63 .ComptimeInt,63 .ComptimeInt,
64 .Undefined,64 .Undefined,
65 .Null,65 .Null,
66 .BoundFn,
67 .Fn,66 .Fn,
68 .Opaque,67 .Opaque,
69 .EnumLiteral,68 .EnumLiteral,
src/arch/wasm/CodeGen.zig-1
...@@ -1599,7 +1599,6 @@ fn isByRef(ty: Type, target: std.Target) bool {...@@ -1599,7 +1599,6 @@ fn isByRef(ty: Type, target: std.Target) bool {
1599 .EnumLiteral,1599 .EnumLiteral,
1600 .Undefined,1600 .Undefined,
1601 .Null,1601 .Null,
1602 .BoundFn,
1603 .Opaque,1602 .Opaque,
1604 => unreachable,1603 => unreachable,
16051604
src/arch/wasm/abi.zig-1
...@@ -80,7 +80,6 @@ pub fn classifyType(ty: Type, target: Target) [2]Class {...@@ -80,7 +80,6 @@ pub fn classifyType(ty: Type, target: Target) [2]Class {
80 .ComptimeInt,80 .ComptimeInt,
81 .Undefined,81 .Undefined,
82 .Null,82 .Null,
83 .BoundFn,
84 .Fn,83 .Fn,
85 .Opaque,84 .Opaque,
86 .EnumLiteral,85 .EnumLiteral,
src/arch/x86_64/CodeGen.zig-1
...@@ -6942,7 +6942,6 @@ fn genTypedValue(self: *Self, arg_tv: TypedValue) InnerError!MCValue {...@@ -6942,7 +6942,6 @@ fn genTypedValue(self: *Self, arg_tv: TypedValue) InnerError!MCValue {
6942 .NoReturn => unreachable,6942 .NoReturn => unreachable,
6943 .Undefined => unreachable,6943 .Undefined => unreachable,
6944 .Null => unreachable,6944 .Null => unreachable,
6945 .BoundFn => unreachable,
6946 .Opaque => unreachable,6945 .Opaque => unreachable,
69476946
6948 else => {},6947 else => {},
src/arch/x86_64/abi.zig-1
...@@ -52,7 +52,6 @@ pub fn classifyWindows(ty: Type, target: Target) Class {...@@ -52,7 +52,6 @@ pub fn classifyWindows(ty: Type, target: Target) Class {
52 .ComptimeInt,52 .ComptimeInt,
53 .Undefined,53 .Undefined,
54 .Null,54 .Null,
55 .BoundFn,
56 .Fn,55 .Fn,
57 .Opaque,56 .Opaque,
58 .EnumLiteral,57 .EnumLiteral,
src/codegen/c.zig-4
...@@ -866,7 +866,6 @@ pub const DeclGen = struct {...@@ -866,7 +866,6 @@ pub const DeclGen = struct {
866 .NoReturn,866 .NoReturn,
867 .Undefined,867 .Undefined,
868 .Null,868 .Null,
869 .BoundFn,
870 .Opaque,869 .Opaque,
871 => unreachable,870 => unreachable,
872871
...@@ -1320,7 +1319,6 @@ pub const DeclGen = struct {...@@ -1320,7 +1319,6 @@ pub const DeclGen = struct {
1320 .NoReturn => unreachable,1319 .NoReturn => unreachable,
1321 .Undefined => unreachable,1320 .Undefined => unreachable,
1322 .Null => unreachable,1321 .Null => unreachable,
1323 .BoundFn => unreachable,
1324 .Opaque => unreachable,1322 .Opaque => unreachable,
13251323
1326 .Frame,1324 .Frame,
...@@ -2050,8 +2048,6 @@ pub const DeclGen = struct {...@@ -2050,8 +2048,6 @@ pub const DeclGen = struct {
2050 .ComptimeInt,2048 .ComptimeInt,
2051 .Type,2049 .Type,
2052 => unreachable, // must be const or comptime2050 => unreachable, // must be const or comptime
2053
2054 .BoundFn => unreachable, // this type will be deleted from the language
2055 }2051 }
2056 }2052 }
20572053
src/codegen/llvm.zig-6
...@@ -2341,8 +2341,6 @@ pub const Object = struct {...@@ -2341,8 +2341,6 @@ pub const Object = struct {
2341 .Null => unreachable,2341 .Null => unreachable,
2342 .EnumLiteral => unreachable,2342 .EnumLiteral => unreachable,
23432343
2344 .BoundFn => @panic("TODO remove BoundFn from the language"),
2345
2346 .Frame => @panic("TODO implement lowerDebugType for Frame types"),2344 .Frame => @panic("TODO implement lowerDebugType for Frame types"),
2347 .AnyFrame => @panic("TODO implement lowerDebugType for AnyFrame types"),2345 .AnyFrame => @panic("TODO implement lowerDebugType for AnyFrame types"),
2348 }2346 }
...@@ -3095,8 +3093,6 @@ pub const DeclGen = struct {...@@ -3095,8 +3093,6 @@ pub const DeclGen = struct {
3095 .Null => unreachable,3093 .Null => unreachable,
3096 .EnumLiteral => unreachable,3094 .EnumLiteral => unreachable,
30973095
3098 .BoundFn => @panic("TODO remove BoundFn from the language"),
3099
3100 .Frame => @panic("TODO implement llvmType for Frame types"),3096 .Frame => @panic("TODO implement llvmType for Frame types"),
3101 .AnyFrame => @panic("TODO implement llvmType for AnyFrame types"),3097 .AnyFrame => @panic("TODO implement llvmType for AnyFrame types"),
3102 }3098 }
...@@ -3896,7 +3892,6 @@ pub const DeclGen = struct {...@@ -3896,7 +3892,6 @@ pub const DeclGen = struct {
3896 .NoReturn => unreachable,3892 .NoReturn => unreachable,
3897 .Undefined => unreachable,3893 .Undefined => unreachable,
3898 .Null => unreachable,3894 .Null => unreachable,
3899 .BoundFn => unreachable,
3900 .Opaque => unreachable,3895 .Opaque => unreachable,
39013896
3902 .Frame,3897 .Frame,
...@@ -10792,7 +10787,6 @@ fn isByRef(ty: Type) bool {...@@ -10792,7 +10787,6 @@ fn isByRef(ty: Type) bool {
10792 .EnumLiteral,10787 .EnumLiteral,
10793 .Undefined,10788 .Undefined,
10794 .Null,10789 .Null,
10795 .BoundFn,
10796 .Opaque,10790 .Opaque,
10797 => unreachable,10791 => unreachable,
1079810792
src/codegen/spirv.zig-2
...@@ -538,8 +538,6 @@ pub const DeclGen = struct {...@@ -538,8 +538,6 @@ pub const DeclGen = struct {
538 .Type,538 .Type,
539 => unreachable, // Must be comptime.539 => unreachable, // Must be comptime.
540540
541 .BoundFn => unreachable, // this type will be deleted from the language.
542
543 else => |tag| return self.todo("Implement zig type '{}'", .{tag}),541 else => |tag| return self.todo("Implement zig type '{}'", .{tag}),
544 };542 };
545 }543 }
src/type.zig-2
...@@ -185,7 +185,6 @@ pub const Type = extern union {...@@ -185,7 +185,6 @@ pub const Type = extern union {
185 .Void,185 .Void,
186 .ErrorSet,186 .ErrorSet,
187 .Fn,187 .Fn,
188 .BoundFn,
189 .Opaque,188 .Opaque,
190 .AnyFrame,189 .AnyFrame,
191 .Enum,190 .Enum,
...@@ -4074,7 +4073,6 @@ pub const Type = extern union {...@@ -4074,7 +4073,6 @@ pub const Type = extern union {
4074 => return true,4073 => return true,
40754074
4076 .Opaque => return is_extern,4075 .Opaque => return is_extern,
4077 .BoundFn,
4078 .ComptimeFloat,4076 .ComptimeFloat,
4079 .ComptimeInt,4077 .ComptimeInt,
4080 .EnumLiteral,4078 .EnumLiteral,
src/value.zig-2
...@@ -2419,7 +2419,6 @@ pub const Value = extern union {...@@ -2419,7 +2419,6 @@ pub const Value = extern union {
2419 if (val.tag() == .runtime_value) return;2419 if (val.tag() == .runtime_value) return;
24202420
2421 switch (zig_ty_tag) {2421 switch (zig_ty_tag) {
2422 .BoundFn => unreachable, // TODO remove this from the language
2423 .Opaque => unreachable, // Cannot hash opaque types2422 .Opaque => unreachable, // Cannot hash opaque types
24242423
2425 .Void,2424 .Void,
...@@ -2566,7 +2565,6 @@ pub const Value = extern union {...@@ -2566,7 +2565,6 @@ pub const Value = extern union {
2566 if (val.tag() == .runtime_value) return;2565 if (val.tag() == .runtime_value) return;
25672566
2568 switch (ty.zigTypeTag()) {2567 switch (ty.zigTypeTag()) {
2569 .BoundFn => unreachable, // TODO remove this from the language
2570 .Opaque => unreachable, // Cannot hash opaque types2568 .Opaque => unreachable, // Cannot hash opaque types
2571 .Void,2569 .Void,
2572 .NoReturn,2570 .NoReturn,
test/behavior/type_info.zig+1-1
...@@ -252,7 +252,7 @@ fn testUnion() !void {...@@ -252,7 +252,7 @@ fn testUnion() !void {
252 try expect(typeinfo_info == .Union);252 try expect(typeinfo_info == .Union);
253 try expect(typeinfo_info.Union.layout == .Auto);253 try expect(typeinfo_info.Union.layout == .Auto);
254 try expect(typeinfo_info.Union.tag_type.? == TypeId);254 try expect(typeinfo_info.Union.tag_type.? == TypeId);
255 try expect(typeinfo_info.Union.fields.len == 25);255 try expect(typeinfo_info.Union.fields.len == 24);
256 try expect(typeinfo_info.Union.fields[4].field_type == @TypeOf(@typeInfo(u8).Int));256 try expect(typeinfo_info.Union.fields[4].field_type == @TypeOf(@typeInfo(u8).Int));
257 try expect(typeinfo_info.Union.decls.len == 22);257 try expect(typeinfo_info.Union.decls.len == 22);
258258