Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
timotheecour opened this issue Dec 5, 2020 · 0 comments · Fixed by #20552
Closed

Comments

@timotheecour
Copy link
Member

timotheecour commented Dec 5, 2020

regression: import times; echo low(Time) gives OverflowDefect

Example

import times
echo low(Time)

Current Output

/Users/timothee/git_clone/nim/timn/tests/nim/all/t11448.nim(6) t11448
/Users/timothee/git_clone/nim/Nim_devel/lib/pure/times.nim(2152) $
/Users/timothee/git_clone/nim/Nim_devel/lib/pure/times.nim(1318) local
/Users/timothee/git_clone/nim/Nim_devel/lib/pure/times.nim(1175) inZone
/Users/timothee/git_clone/nim/Nim_devel/lib/pure/times.nim(1081) initDateTime
/Users/timothee/git_clone/nim/Nim_devel/lib/system/fatal.nim(49) sysFatal
Error: unhandled exception: over- or underflow [OverflowDefect]

Expected Output

works

Additional Information

  • fails in 1.5.1 devel edce589
  • works in 0.18.0

found this while debugging HCR issues, which uses low(Time) as initial value

EDIT: I found this code in nimhcr:

  proc sanitize(arg: Time): string =
    when defined(testNimHcr): return "<time>"
    else: return $arg

that may be related, in which case it should probably be fixed in PR that fixes this

bung87 added a commit to bung87/Nim that referenced this issue Oct 12, 2022
Araq pushed a commit that referenced this issue Oct 29, 2022
fix #16264 regression(0.18.0 => devel): import times; echo low(Time) gives OverflowDefect
capocasa pushed a commit to capocasa/Nim that referenced this issue Mar 31, 2023
fix nim-lang#16264 regression(0.18.0 => devel): import times; echo low(Time) gives OverflowDefect
narimiran pushed a commit that referenced this issue Apr 25, 2023
fix #16264 regression(0.18.0 => devel): import times; echo low(Time) gives OverflowDefect

(cherry picked from commit 534c97e)
narimiran pushed a commit that referenced this issue Apr 25, 2023
fix #16264 regression(0.18.0 => devel): import times; echo low(Time) gives OverflowDefect

(cherry picked from commit 534c97e)
narimiran pushed a commit that referenced this issue Apr 25, 2023
fix #16264 regression(0.18.0 => devel): import times; echo low(Time) gives OverflowDefect

(cherry picked from commit 534c97e)
bung87 added a commit to bung87/Nim that referenced this issue Jul 29, 2023
fix nim-lang#16264 regression(0.18.0 => devel): import times; echo low(Time) gives OverflowDefect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant