aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/struct.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2024-08-28 19:37:28 +0100
committermlugg <mlugg@mlugg.co.uk>2024-08-29 23:43:52 +0100
commitc3fb30803f4fbe62abb4bfad348c585e9ab80234 (patch)
tree57905ad345e6e4e7cebdb4597b6790f073dfa0b1 /test/behavior/struct.zig
parent605f2a0978c3ae262e224ff01d163d412a64c284 (diff)
downloadzig-c3fb30803f4fbe62abb4bfad348c585e9ab80234.tar.gz
zig-c3fb30803f4fbe62abb4bfad348c585e9ab80234.zip
behavior: avoid field/decl name conflicts
Diffstat (limited to 'test/behavior/struct.zig')
-rw-r--r--test/behavior/struct.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/behavior/struct.zig b/test/behavior/struct.zig
index ff70c14505..44f035f46f 100644
--- a/test/behavior/struct.zig
+++ b/test/behavior/struct.zig
@@ -1529,15 +1529,15 @@ test "function pointer in struct returns the struct" {
const A = struct {
const A = @This();
- f: *const fn () A,
+ ptr: *const fn () A,
fn f() A {
- return .{ .f = f };
+ return .{ .ptr = f };
}
};
var a = A.f();
_ = &a;
- try expect(a.f == A.f);
+ try expect(a.ptr == A.f);
}
test "no dependency loop on optional field wrapped in generic function" {