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

fix #16264 regression(0.18.0 => devel): import times; echo low(Time) gives OverflowDefect
This commit is contained in:
Bung
2022-10-29 14:59:51 +08:00
committed by GitHub
parent 66f958b313
commit 534c97edc5
2 changed files with 3 additions and 1 deletions

View File

@@ -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

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

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