diff options
| author | John Schmidt <john.schmidt.h@gmail.com> | 2024-02-11 22:55:13 +0100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-02-26 17:03:20 -0800 |
| commit | f803761e13a65ccbc6a5508f2dc2d7723b010dab (patch) | |
| tree | a913a11999ae074ffb5e59bfb13c973f13f659b2 /src/type.zig | |
| parent | 7a045ede7ca26338dc553e1a0113d1de4daf1b95 (diff) | |
| download | zig-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.zig | 2 |
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); |
