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

Line number missing in stdlib trace #6832

Closed
dom96 opened this issue Nov 28, 2017 · 6 comments

Comments

Projects
None yet
4 participants
@dom96
Copy link
Member

commented Nov 28, 2017

import strutils
echo "".split("")
a1.nim(2)                a1
strutils.nim             split
system.nim(3740)         raiseAssert
system.nim(2809)         sysFatal
Error: unhandled exception:
0 < len(sep)  [AssertionError]

@Araq Araq added the High Priority label Apr 22, 2018

data-man added a commit to data-man/Nim that referenced this issue May 11, 2018

@data-man data-man closed this in 94c4513 May 19, 2018

@dom96

This comment has been minimized.

Copy link
Member Author

commented Jun 14, 2018

That seems like more of a workaround than a fix.

New output:

a2.nim(2)                a2
strutils.nim             split
system.nim(3803)         raiseAssert
system.nim(2857)         sysFatal
Error: unhandled exception:
0 < len(sep) lib/pure/strutils.nim(718)  [AssertionError]

Still no line number beside strutils.nim.

@dom96 dom96 reopened this Jun 14, 2018

@data-man

This comment has been minimized.

Copy link
Contributor

commented Jun 14, 2018

Still no line number beside strutils.nim.

lib/pure/strutils.nim(718)

?

@Yardanico

This comment has been minimized.

Copy link
Collaborator

commented Jun 14, 2018

But the formatting is wrong anyway

@dom96

This comment has been minimized.

Copy link
Member Author

commented Jun 14, 2018

strutils.nim             split
@dom96

This comment has been minimized.

Copy link
Member Author

commented Oct 27, 2018

Here is the culprit: https://github.com/nim-lang/Nim/blob/devel/lib/pure/strutils.nim#L361. Not a bug after all, but I would still prefer if the traceback had some sort of indication that line trace was disabled

@dom96

This comment has been minimized.

Copy link
Member Author

commented Oct 27, 2018

Standalone repro:

{.push checks: off, line_trace: off .}

proc testEx(): seq[int] =
  doAssert false

echo testEx()

Output:

a7.nim                   a7
a7.nim                   testEx
system.nim(3912)         failedAssertImpl
system.nim(3905)         raiseAssert
system.nim(2952)         sysFatal
Error: unhandled exception: /private/tmp/aporia/a7.nim(13, 12) `false`  [AssertionError]

dom96 added a commit that referenced this issue Oct 27, 2018

@Araq Araq closed this in e4a76c6 Feb 19, 2019

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.