diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-07-14 18:10:54 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-07-14 18:11:46 -0700 |
| commit | 04572f6e341e6ff19877d1ae3b79e3baa653e652 (patch) | |
| tree | 07b91717329efb36bd8c8bd266b047fff60692ff /test/behavior/array.zig | |
| parent | d7711ec9532d4c38bf1911f5c0ed2c813705ae15 (diff) | |
| download | zig-04572f6e341e6ff19877d1ae3b79e3baa653e652.tar.gz zig-04572f6e341e6ff19877d1ae3b79e3baa653e652.zip | |
Sema: fix coerceResultPtr
It did not handle properly when the dummy operand was a comptime_int; it
was crashing in coerce because comptime_int is supposed to be
comptime-known. So when calling coerceResultPtr, we pass the actual
operand, not a dummy operand, which means it will have the proper
comptime value when necessary.
Diffstat (limited to 'test/behavior/array.zig')
| -rw-r--r-- | test/behavior/array.zig | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/test/behavior/array.zig b/test/behavior/array.zig index aea4dd357b..b99ac27651 100644 --- a/test/behavior/array.zig +++ b/test/behavior/array.zig @@ -570,10 +570,7 @@ test "type coercion of pointer to anon struct literal to pointer to array" { } test "array with comptime only element type" { - const a = [_]type{ - u32, - i32, - }; + const a = [_]type{ u32, i32 }; try testing.expect(a[0] == u32); try testing.expect(a[1] == i32); } |
