From 680d79ebf9591be74790999088c882de50a2863b Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 19 Feb 2023 17:55:25 -0700 Subject: [PATCH] add test coverage for fixed bug. closes #5508 --- test/behavior/type_info.zig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/behavior/type_info.zig b/test/behavior/type_info.zig index 419a2f231c..6f64c92006 100644 --- a/test/behavior/type_info.zig +++ b/test/behavior/type_info.zig @@ -603,3 +603,9 @@ test "@typeInfo decls ignore dependency loops" { }; _ = S.foo; } + +test "type info of tuple of string literal default value" { + const struct_field = @typeInfo(@TypeOf(.{"hi"})).Struct.fields[0]; + const value = @ptrCast(*align(1) const *const [2:0]u8, struct_field.default_value.?).*; + comptime std.debug.assert(value[0] == 'h'); +}