File tree Expand file tree Collapse file tree 4 files changed +13
-25
lines changed Expand file tree Collapse file tree 4 files changed +13
-25
lines changed Original file line number Diff line number Diff line change @@ -549,7 +549,7 @@ test "call function pointer in comptime field" {
549549 auto : [max_len ]u8 = undefined ,
550550 offset : u64 = 0 ,
551551
552- comptime capacity : * const fn () u64 = capacity ,
552+ comptime capacityFn : * const fn () u64 = capacity ,
553553
554554 const max_len : u64 = 32 ;
555555
@@ -558,9 +558,9 @@ test "call function pointer in comptime field" {
558558 }
559559 };
560560
561- const a : Auto = .{ .offset = 16 , .capacity = Auto .capacity };
562- try std .testing .expect (a .capacity () == 32 );
563- try std .testing .expect ((a .capacity )() == 32 );
561+ const a : Auto = .{ .offset = 16 , .capacityFn = Auto .capacity };
562+ try std .testing .expect (a .capacityFn () == 32 );
563+ try std .testing .expect ((a .capacityFn )() == 32 );
564564}
565565
566566test "generic function pointer can be called" {
Original file line number Diff line number Diff line change @@ -149,12 +149,12 @@ test "packed union initialized with a runtime value" {
149149 value : u63 ,
150150 fields : Fields ,
151151
152- fn value () i64 {
152+ fn getValue () i64 {
153153 return 1341 ;
154154 }
155155 };
156156
157- const timestamp : i64 = ID .value ();
157+ const timestamp : i64 = ID .getValue ();
158158 const id = ID { .fields = Fields {
159159 .timestamp = @as (u50 , @intCast (timestamp )),
160160 .random_bits = 420 ,
Original file line number Diff line number Diff line change @@ -1529,15 +1529,15 @@ test "function pointer in struct returns the struct" {
15291529
15301530 const A = struct {
15311531 const A = @This ();
1532- f : * const fn () A ,
1532+ ptr : * const fn () A ,
15331533
15341534 fn f () A {
1535- return .{ .f = f };
1535+ return .{ .ptr = f };
15361536 }
15371537 };
15381538 var a = A .f ();
15391539 _ = & a ;
1540- try expect (a .f == A .f );
1540+ try expect (a .ptr == A .f );
15411541}
15421542
15431543test "no dependency loop on optional field wrapped in generic function" {
Original file line number Diff line number Diff line change @@ -155,18 +155,6 @@ test "unions embedded in aggregate types" {
155155 }
156156}
157157
158- test "access a member of tagged union with conflicting enum tag name" {
159- const Bar = union (enum ) {
160- A : A ,
161- B : B ,
162-
163- const A = u8 ;
164- const B = void ;
165- };
166-
167- comptime assert (Bar .A == u8 );
168- }
169-
170158test "constant tagged union with payload" {
171159 if (builtin .zig_backend == .stage2_arm ) return error .SkipZigTest ;
172160 if (builtin .zig_backend == .stage2_aarch64 ) return error .SkipZigTest ;
@@ -1417,10 +1405,10 @@ test "union field ptr - zero sized payload" {
14171405 const U = union {
14181406 foo : void ,
14191407 bar : void ,
1420- fn bar (_ : * void ) void {}
1408+ fn qux (_ : * void ) void {}
14211409 };
14221410 var u : U = .{ .foo = {} };
1423- U .bar (& u .foo );
1411+ U .qux (& u .foo );
14241412}
14251413
14261414test "union field ptr - zero sized field" {
@@ -1431,10 +1419,10 @@ test "union field ptr - zero sized field" {
14311419 const U = union {
14321420 foo : void ,
14331421 bar : u32 ,
1434- fn bar (_ : * void ) void {}
1422+ fn qux (_ : * void ) void {}
14351423 };
14361424 var u : U = .{ .foo = {} };
1437- U .bar (& u .foo );
1425+ U .qux (& u .foo );
14381426}
14391427
14401428test "packed union in packed struct" {
You can’t perform that action at this time.
0 commit comments