Skip to content

Commit

Permalink
value: fix from(@typeof(null))
Browse files Browse the repository at this point in the history
  • Loading branch information
cztomsik committed Aug 13, 2024
1 parent be5ad97 commit 68fa91f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/value.zig
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub const Value = union(enum) {
}

return switch (@typeInfo(T)) {
.Null => .null,
.Optional => if (val) |v| from(v, arena) else .null,
.Bool => .{ .int = if (val) 1 else 0 },
.Int, .ComptimeInt => .{ .int = @intCast(val) },
Expand Down

0 comments on commit 68fa91f

Please sign in to comment.