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

Nim doc mangles signed octal literals #11131

avitkauskas opened this issue Apr 27, 2019 · 1 comment


None yet
3 participants
Copy link

commented Apr 27, 2019

Generating examples with nim doc mangles octal signed integer literals that have highest bit set. It changes 0o377'i8 to 0o777'i8, or 0o277'i8 to 0o677'i8, or 0o177777'i16 to 0o777777'i16 when generating example files from runnableExamples: block and then fails test with Error: number out of range: '0o777'i8' or similar.


in file sample.nim:

proc someProc* =
      let a = 0o377'i8
      doAssert a == 0o377'i8

Current Output

in runnableExamples/sample_examples1.nim

  let a = 0o777'i8
  doAssert a == 0o777'i8

Expected Output

  let a = 0o377'i8
  doAssert a == 0o377'i8

Additional Information

This does not happen with unsigned integers. 0o377'u8 is transfered correctly as is.

$ nim -v
Nim Compiler Version 0.19.4 [MacOSX: amd64]
Compiled at 2019-02-01
Copyright (c) 2006-2018 by Andreas Rumpf

git hash: b6d96cafc8bcad1f3d32f2910b25cd11a93f7751
active boot switches: -d:release

This comment has been minimized.

Copy link

commented Apr 28, 2019

Blocks #11107 documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.