diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-08-10 11:50:01 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-10 11:50:01 -0700 |
| commit | 275e926cf851144ef6a4c64963e47f3b955870cc (patch) | |
| tree | ed1717db1a7f6c8c931d5c08e244a11a2334ff93 /test/behavior/array.zig | |
| parent | 0461a64a93f0596e98b62d596bb547e5455577d2 (diff) | |
| parent | f32b9bc776bfffe0a1adadc013ff3fa3e5d6d34b (diff) | |
| download | zig-275e926cf851144ef6a4c64963e47f3b955870cc.tar.gz zig-275e926cf851144ef6a4c64963e47f3b955870cc.zip | |
Merge pull request #16604 from mlugg/result-type-shenanigans
Fix RLS issues, fix crash on invalid result type for `@splat`, refactor some bits of generic instantiations
Diffstat (limited to 'test/behavior/array.zig')
| -rw-r--r-- | test/behavior/array.zig | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/behavior/array.zig b/test/behavior/array.zig index 5d475c9b25..a4cac26569 100644 --- a/test/behavior/array.zig +++ b/test/behavior/array.zig @@ -761,3 +761,17 @@ test "slicing array of zero-sized values" { for (arr[0..]) |zero| try expect(zero == 0); } + +test "array init with no result pointer sets field result types" { + const S = struct { + // A function parameter has a result type, but no result pointer. + fn f(arr: [1]u32) u32 { + return arr[0]; + } + }; + + const x: u64 = 123; + const y = S.f(.{@intCast(x)}); + + try expect(y == x); +} |
