aboutsummaryrefslogtreecommitdiff
path: root/src/type.zig
diff options
context:
space:
mode:
authorJohn Schmidt <john.schmidt.h@gmail.com>2024-02-11 22:55:13 +0100
committerAndrew Kelley <andrew@ziglang.org>2024-02-26 17:03:20 -0800
commitf803761e13a65ccbc6a5508f2dc2d7723b010dab (patch)
treea913a11999ae074ffb5e59bfb13c973f13f659b2 /src/type.zig
parent7a045ede7ca26338dc553e1a0113d1de4daf1b95 (diff)
downloadzig-f803761e13a65ccbc6a5508f2dc2d7723b010dab.tar.gz
zig-f803761e13a65ccbc6a5508f2dc2d7723b010dab.zip
Fix tuple default values
- Add default values to the list of comptime-known elements in `zirValidatePtrArrayInit` - In `structFieldValueComptime`, only assert `haveFieldInits` if we enter the`fieldIsComptime` branch (otherwise they are not needed).
Diffstat (limited to 'src/type.zig')
-rw-r--r--src/type.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/type.zig b/src/type.zig
index a9d1654ba7..b038d7a021 100644
--- a/src/type.zig
+++ b/src/type.zig
@@ -3073,8 +3073,8 @@ pub const Type = struct {
const ip = &mod.intern_pool;
switch (ip.indexToKey(ty.toIntern())) {
.struct_type => |struct_type| {
- assert(struct_type.haveFieldInits(ip));
if (struct_type.fieldIsComptime(ip, index)) {
+ assert(struct_type.haveFieldInits(ip));
return Value.fromInterned(struct_type.field_inits.get(ip)[index]);
} else {
return Type.fromInterned(struct_type.field_types.get(ip)[index]).onePossibleValue(mod);