nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.58k stars 1.47k forks source link

[meta] failed asserts in int128.nim #14989

Open narimiran opened 4 years ago

narimiran commented 4 years ago

This is a meta-issue, which tries to collect all the issues that are open because some assert in int128.nim has failed. The idea is to have all of them in once place, because one fix might potentially close multiple issues.

  1. int128.nim(68, 11) `arg.sdata(3) == -1` out of range [AssertionDefect]

  2. int128.nim(71, 11) `arg.sdata(3) == 0` out of range [AssertionDefect]

  3. int128.nim(72, 11) `arg.sdata(2) == 0` out of range [AssertionDefect]

  4. int128.nim(330, 11) `false` overflow [AssertionDefect]

First three points (lines 68, 71, 72) are part of proc toInt64*(arg: Int128): int64. The last point (line 330) is part of proc `*`(a: Int128, b: uint32): Int128.

krux02 commented 4 years ago

I looked into this because I thought there would be a bug in int128. But these are all overflow and out of range error messages. The error messages could be improved for sure, but here is no bug in int128.