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
commit 534c97edc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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)