aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/basic.zig
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-11-17 23:00:01 +0200
committerVeikka Tuominen <git@vexu.eu>2022-11-20 20:25:12 +0200
commit98b3734b67739ad0e7d53500308495d53250cab0 (patch)
treeebc912c09bec23cf429c52ecb7c170d21f0e76e8 /test/behavior/basic.zig
parent9877a7d36c466a25fe722aa3ff301ee90b206d9c (diff)
downloadzig-98b3734b67739ad0e7d53500308495d53250cab0.tar.gz
zig-98b3734b67739ad0e7d53500308495d53250cab0.zip
Sema: prioritize Value.variable over OPV when resolving const value
Closes #12275
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);
+}