aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/basic.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/behavior/basic.zig')
-rw-r--r--test/behavior/basic.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/behavior/basic.zig b/test/behavior/basic.zig
index b0b25d3774..7351891959 100644
--- a/test/behavior/basic.zig
+++ b/test/behavior/basic.zig
@@ -1118,3 +1118,12 @@ test "ambiguous reference error ignores current declaration" {
};
try expect(S.b.foo == 666);
}
+
+test "pointer to zero sized global is mutable" {
+ const S = struct {
+ const Thing = struct {};
+
+ var thing: Thing = undefined;
+ };
+ try expect(@TypeOf(&S.thing) == *S.Thing);
+}