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

Closed
avitkauskas opened this issue Apr 27, 2019 · 1 comment

Comments

Projects
None yet
3 participants
@avitkauskas
Copy link
Contributor

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.

Example

in file sample.nim:

proc someProc* =
  runnableExamples:
      let a = 0o377'i8
      doAssert a == 0o377'i8
  discard

Current Output

in runnableExamples/sample_examples1.nim

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

Expected Output

block:
  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
@mratsim

This comment has been minimized.

Copy link
Collaborator

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.