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

static: doAssert false gives importc error with --panics:on #16499

Closed
timotheecour opened this issue Dec 29, 2020 · 1 comment
Closed

static: doAssert false gives importc error with --panics:on #16499

timotheecour opened this issue Dec 29, 2020 · 1 comment

Comments

@timotheecour
Copy link
Member

Example

static: doAssert false

Current Output

nim r --panics:on main
system/fatal.nim(41, 5) Error: cannot 'importc' variable at compile time; cstderr

Expected Output

a different CT error

Additional Information

devel 1.5.1 6d442a4

@ringabout
Copy link
Member

Should we just keep the same behaviour as panics:off?

D:\QQPCmgr\Desktop\Nim>nim c -r --lib:lib --panics:on play.nim 
Hint: used config file 'C:\Users\blue\.choosenim\toolchains\nim-#devel\config\nim.cfg' [Conf]
Hint: used config file 'C:\Users\blue\.choosenim\toolchains\nim-#devel\config\config.nims' [Conf]
....
stack trace: (most recent call last)
D:\QQPCmgr\Desktop\Nim\play.nim(1, 11) play
D:\QQPCmgr\Desktop\Nim\lib\system\assertions.nim(30, 26) failedAssertImpl
D:\QQPCmgr\Desktop\Nim\lib\system\assertions.nim(23, 11) raiseAssert
D:\QQPCmgr\Desktop\Nim\lib\system\fatal.nim(48, 13) sysFatal
D:\QQPCmgr\Desktop\Nim\lib\system\fatal.nim(34, 7) sysFatal
D:\QQPCmgr\Desktop\Nim\lib\system\fatal.nim(34, 7) Error: unhandled exception: D:\QQPCmgr\Desktop\Nim\play.nim(1, 18) `false`  [AssertionDefect]

ringabout added a commit to ringabout/Nim that referenced this issue Dec 30, 2020
@Araq Araq closed this as completed in 9531afa Jan 4, 2021
mildred pushed a commit to mildred/Nim that referenced this issue Jan 11, 2021
ardek66 pushed a commit to ardek66/Nim that referenced this issue Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants