aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/basic.zig
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2023-05-13 12:52:16 +0300
committerGitHub <noreply@github.com>2023-05-13 12:52:16 +0300
commit68bacad8047df050c8ab6bf52c2921f482647d57 (patch)
tree9b428c397ee0173b670dfbe34f4c9330dc257bb7 /test/behavior/basic.zig
parent6f418c11e1ad1150fbdb002cfe1be92bda4e93cb (diff)
parent5aa9628de3c6637f45b9d8cf8cbd19c422a74f6f (diff)
downloadzig-68bacad8047df050c8ab6bf52c2921f482647d57.tar.gz
zig-68bacad8047df050c8ab6bf52c2921f482647d57.zip
Merge pull request #15643 from Vexu/fixes
make `@call` compile errors match regular calls
Diffstat (limited to 'test/behavior/basic.zig')
-rw-r--r--test/behavior/basic.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/behavior/basic.zig b/test/behavior/basic.zig
index db08442510..0de278fc57 100644
--- a/test/behavior/basic.zig
+++ b/test/behavior/basic.zig
@@ -1200,3 +1200,10 @@ test "arrays and vectors with big integers" {
try expect(b[0] == comptime std.math.maxInt(Int));
}
}
+
+test "pointer to struct literal with runtime field is constant" {
+ const S = struct { data: usize };
+ var runtime_zero: usize = 0;
+ const ptr = &S{ .data = runtime_zero };
+ try expect(@typeInfo(@TypeOf(ptr)).Pointer.is_const);
+}