fix #16264 low(Time) OverflowDefect (#20552)

fix #16264 regression(0.18.0 => devel): import times; echo low(Time) gives OverflowDefect

(cherry picked from commit 534c97edc5)
This commit is contained in:
Bung
2022-10-29 14:59:51 +08:00
committed by narimiran
parent 592321c7f5
commit b2b226bb28
2 changed files with 3 additions and 1 deletions

View File

@@ -959,7 +959,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

2
tests/misc/t16264.nim Normal file
View File

@@ -0,0 +1,2 @@
import times
doAssert low(Time) == fromUnix(0)