Skip to content

Commit

Permalink
fix #16264 low(Time) OverflowDefect (#20552)
Browse files Browse the repository at this point in the history
fix #16264 regression(0.18.0 => devel): import times; echo low(Time) gives OverflowDefect
  • Loading branch information
bung87 authored Oct 29, 2022
1 parent 66f958b commit 534c97e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pure/times.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ proc high*(typ: typedesc[Time]): Time =
initTime(high(int64), high(NanosecondRange))

proc low*(typ: typedesc[Time]): Time =
initTime(low(int64), 0)
initTime(0, 0)

#
# DateTime & Timezone
Expand Down
2 changes: 2 additions & 0 deletions tests/misc/t16264.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import times
doAssert low(Time) == fromUnix(0)

0 comments on commit 534c97e

Please sign in to comment.