@@ -1236,7 +1236,7 @@ pub const Type = extern union {
12361236 // we can't hash these based on tags because they wouldn't match the expanded version.
12371237 .type_info = > unreachable , // needed to resolve the type before now
12381238
1239- .bound_fn = > unreachable , // TODO delete from the language
1239+ .bound_fn = > unreachable ,
12401240 .var_args_param = > unreachable , // can be any type
12411241 }
12421242 }
@@ -3272,7 +3272,7 @@ pub const Type = extern union {
32723272 .fn_ccc_void_no_args = > unreachable , // represents machine code; not a pointer
32733273 .function = > unreachable , // represents machine code; not a pointer
32743274 .@"opaque" = > unreachable , // no size available
3275- .bound_fn = > unreachable , // TODO remove from the language
3275+ .bound_fn = > unreachable ,
32763276 .noreturn = > unreachable ,
32773277 .inferred_alloc_const = > unreachable ,
32783278 .inferred_alloc_mut = > unreachable ,
@@ -4088,47 +4088,6 @@ pub const Type = extern union {
40884088 }
40894089 }
40904090
4091- /// Returns if type can be used for a runtime variable
4092- pub fn isValidVarType (self : Type , is_extern : bool ) bool {
4093- var ty = self ;
4094- while (true ) switch (ty .zigTypeTag ()) {
4095- .Bool ,
4096- .Int ,
4097- .Float ,
4098- .ErrorSet ,
4099- .Enum ,
4100- .Frame ,
4101- .AnyFrame ,
4102- = > return true ,
4103-
4104- .Opaque = > return is_extern ,
4105- .ComptimeFloat ,
4106- .ComptimeInt ,
4107- .EnumLiteral ,
4108- .NoReturn ,
4109- .Type ,
4110- .Void ,
4111- .Undefined ,
4112- .Null ,
4113- = > return false ,
4114-
4115- .Optional = > {
4116- var buf : Payload.ElemType = undefined ;
4117- return ty .optionalChild (& buf ).isValidVarType (is_extern );
4118- },
4119- .Pointer , .Array , .Vector = > ty = ty .elemType (),
4120- .ErrorUnion = > ty = ty .errorUnionPayload (),
4121-
4122- .Fn = > @panic ("TODO fn isValidVarType" ),
4123- .Struct = > {
4124- // TODO this is not always correct; introduce lazy value mechanism
4125- // and here we need to force a resolve of "type requires comptime".
4126- return true ;
4127- },
4128- .Union = > @panic ("TODO union isValidVarType" ),
4129- };
4130- }
4131-
41324091 /// For *[N]T, returns [N]T.
41334092 /// For *T, returns T.
41344093 /// For [*]T, returns T.
@@ -5434,7 +5393,6 @@ pub const Type = extern union {
54345393 }
54355394
54365395 /// Asserts the type is an enum or a union.
5437- /// TODO support unions
54385396 pub fn intTagType (ty : Type , buffer : * Payload.Bits ) Type {
54395397 switch (ty .tag ()) {
54405398 .enum_full , .enum_nonexhaustive = > return ty .cast (Payload .EnumFull ).? .data .tag_ty ,
0 commit comments