aboutsummaryrefslogtreecommitdiff
path: root/src/type.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/type.zig')
-rw-r--r--src/type.zig5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/type.zig b/src/type.zig
index 0c4dfb7e7e..bbc2a2ce60 100644
--- a/src/type.zig
+++ b/src/type.zig
@@ -2479,8 +2479,9 @@ pub const Type = struct {
.inferred_error_set_type,
=> return null,
- inline .array_type, .vector_type => |seq_type| {
- if (seq_type.len == 0) return (try mod.intern(.{ .aggregate = .{
+ inline .array_type, .vector_type => |seq_type, seq_tag| {
+ const has_sentinel = seq_tag == .array_type and seq_type.sentinel != .none;
+ if (seq_type.len + @boolToInt(has_sentinel) == 0) return (try mod.intern(.{ .aggregate = .{
.ty = ty.toIntern(),
.storage = .{ .elems = &.{} },
} })).toValue();