aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-08-28 12:16:52 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-08-28 12:16:52 -0400
commitaf90da153178032df109aa955df0aac113de032d (patch)
treefa46539bd3738b4d429cb26a1f1abebbeab5b38c /test
parentd5b3d97c232b71923bcc834261ce49bdb827c1d9 (diff)
downloadzig-af90da153178032df109aa955df0aac113de032d.tar.gz
zig-af90da153178032df109aa955df0aac113de032d.zip
fix implicit cast from zero sized array ptr to slice
closes #1850
Diffstat (limited to 'test')
-rw-r--r--test/stage1/behavior/array.zig6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/stage1/behavior/array.zig b/test/stage1/behavior/array.zig
index 9349af573c..462977066e 100644
--- a/test/stage1/behavior/array.zig
+++ b/test/stage1/behavior/array.zig
@@ -292,3 +292,9 @@ test "read/write through global variable array of struct fields initialized via
};
S.doTheTest();
}
+
+test "implicit cast zero sized array ptr to slice" {
+ var b = "";
+ const c: []const u8 = &b;
+ expect(c.len == 0);
+}