@@ -12,8 +12,8 @@ fn isTypeCompatible(comptime T1: type, comptime T2: type) bool {
1212 if (@intFromEnum (info1 ) != @intFromEnum (info2 )) return false ;
1313
1414 return switch (info1 ) {
15- .Struct = > | s1 | blk : {
16- const s2 = @typeInfo (T2 ).Struct ;
15+ .@"struct" = > | s1 | blk : {
16+ const s2 = @typeInfo (T2 ).@ "struct" ;
1717 if (s1 .fields .len != s2 .fields .len ) break :blk false ;
1818 if (s1 .is_tuple != s2 .is_tuple ) break :blk false ;
1919
@@ -23,8 +23,8 @@ fn isTypeCompatible(comptime T1: type, comptime T2: type) bool {
2323 }
2424 break :blk true ;
2525 },
26- .Enum = > | e1 | blk : {
27- const e2 = @typeInfo (T2 ).Enum ;
26+ .@"enum" = > | e1 | blk : {
27+ const e2 = @typeInfo (T2 ).@ "enum" ;
2828 if (e1 .fields .len != e2 .fields .len ) break :blk false ;
2929
3030 for (e1 .fields , e2 .fields ) | f1 , f2 | {
@@ -33,20 +33,20 @@ fn isTypeCompatible(comptime T1: type, comptime T2: type) bool {
3333 }
3434 break :blk true ;
3535 },
36- .Array = > | a1 | blk : {
37- const a2 = @typeInfo (T2 ).Array ;
36+ .array = > | a1 | blk : {
37+ const a2 = @typeInfo (T2 ).array ;
3838 if (a1 .len != a2 .len ) break :blk false ;
3939 break :blk isTypeCompatible (a1 .child , a2 .child );
4040 },
41- .Pointer = > | p1 | blk : {
42- const p2 = @typeInfo (T2 ).Pointer ;
41+ .pointer = > | p1 | blk : {
42+ const p2 = @typeInfo (T2 ).pointer ;
4343 if (p1 .size != p2 .size ) break :blk false ;
4444 if (p1 .is_const != p2 .is_const ) break :blk false ;
4545 if (p1 .is_volatile != p2 .is_volatile ) break :blk false ;
4646 break :blk isTypeCompatible (p1 .child , p2 .child );
4747 },
48- .Optional = > | o1 | blk : {
49- const o2 = @typeInfo (T2 ).Optional ;
48+ .optional = > | o1 | blk : {
49+ const o2 = @typeInfo (T2 ).optional ;
5050 break :blk isTypeCompatible (o1 .child , o2 .child );
5151 },
5252 else = > T1 == T2 ,
@@ -170,8 +170,8 @@ fn formatTypeMismatch(
170170///
171171pub fn Interface (comptime methods : anytype , comptime embedded : anytype ) type {
172172 const embedded_interfaces = switch (@typeInfo (@TypeOf (embedded ))) {
173- .Null = > embedded ,
174- .Struct = > | s | if (s .is_tuple ) embedded else .{embedded },
173+ .null = > embedded ,
174+ .@"struct" = > | s | if (s .is_tuple ) embedded else .{embedded },
175175 else = > .{embedded },
176176 };
177177
@@ -325,12 +325,12 @@ pub fn Interface(comptime methods: anytype, comptime embedded: anytype) type {
325325 const exp_info = @typeInfo (Expected );
326326 const act_info = @typeInfo (Actual );
327327
328- if (exp_info != .ErrorUnion or act_info != .ErrorUnion ) {
328+ if (exp_info != .error_union or act_info != .error_union ) {
329329 return Expected == Actual ;
330330 }
331331
332- if (exp_info .ErrorUnion .error_set == anyerror ) {
333- return exp_info .ErrorUnion .payload == act_info .ErrorUnion .payload ;
332+ if (exp_info .error_union .error_set == anyerror ) {
333+ return exp_info .error_union .payload == act_info .error_union .payload ;
334334 }
335335 return Expected == Actual ;
336336 }
@@ -366,8 +366,8 @@ pub fn Interface(comptime methods: anytype, comptime embedded: anytype) type {
366366 const impl_fn = @TypeOf (@field (Type , field .name ));
367367 const expected_fn = @field (methods , field .name );
368368
369- const impl_info = @typeInfo (impl_fn ).Fn ;
370- const expected_info = @typeInfo (expected_fn ).Fn ;
369+ const impl_info = @typeInfo (impl_fn ).@ "fn" ;
370+ const expected_info = @typeInfo (expected_fn ).@ "fn" ;
371371
372372 if (impl_info .params .len != expected_info .params .len ) {
373373 problems = problems ++ &[_ ]Incompatibility {.{
0 commit comments