diff options
| author | Veikka Tuominen <git@vexu.eu> | 2023-01-05 13:25:36 +0200 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2023-01-05 14:26:53 +0200 |
| commit | 0ecec5fcca3ae8f33bf307c2ca66b8d11baf3d1d (patch) | |
| tree | c3b09089496106831a25e7597a0b59607e95c458 /src/value.zig | |
| parent | 352c71873b1c018fed8821d275b490be8c881792 (diff) | |
| download | zig-0ecec5fcca3ae8f33bf307c2ca66b8d11baf3d1d.tar.gz zig-0ecec5fcca3ae8f33bf307c2ca66b8d11baf3d1d.zip | |
resolve some TODOs
Diffstat (limited to 'src/value.zig')
| -rw-r--r-- | src/value.zig | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/value.zig b/src/value.zig index eeb1228ebc..45b2bfd341 100644 --- a/src/value.zig +++ b/src/value.zig @@ -814,7 +814,6 @@ pub const Value = extern union { .float_80 => return out_stream.print("{}", .{val.castTag(.float_80).?.data}), .float_128 => return out_stream.print("{}", .{val.castTag(.float_128).?.data}), .@"error" => return out_stream.print("error.{s}", .{val.castTag(.@"error").?.data.name}), - // TODO to print this it should be error{ Set, Items }!T(val), but we need the type for that .eu_payload => { try out_stream.writeAll("(eu_payload) "); val = val.castTag(.eu_payload).?.data; @@ -989,8 +988,7 @@ pub const Value = extern union { switch (val.tag()) { .enum_field_index => { const field_index = val.castTag(.enum_field_index).?.data; - // TODO should `@intToEnum` do this `@intCast` for you? - return @intToEnum(E, @intCast(@typeInfo(E).Enum.tag_type, field_index)); + return @intToEnum(E, field_index); }, .the_only_possible_value => { const fields = std.meta.fields(E); |
