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

Don't show const value in error message #11789

Open
Wh1teDuke opened this issue Jul 19, 2019 · 3 comments
Open

Don't show const value in error message #11789

Wh1teDuke opened this issue Jul 19, 2019 · 3 comments
Labels
const `const x=expr` or `static: stmt` Error Messages Medium Priority

Comments

@Wh1teDuke
Copy link
Contributor

Test

const FOO = 1
let   BAR = 2
add(FOO, BAR)

Expected
expression: add(FOO, BAR)

Got
expression: add(1, BAR)

Related: #6293


>nim -v
Nim Compiler Version 0.20.99 [Linux: i386]
Compiled at 2019-07-18
Copyright (c) 2006-2019 by Andreas Rumpf

git hash: 4becd5a2a8d67c7481af457d5007e1a313d454c8
active boot switches: -d:release
@mratsim mratsim added the VM see also `const` label label Jul 20, 2019
@mratsim
Copy link
Collaborator

mratsim commented Jul 20, 2019

That seems complex, I suppose the VM is applying constant folding to replace const by their value ASAP instead of storing an ident.

@Araq Araq added Error Messages Low Priority and removed VM see also `const` label labels Jul 21, 2019
@Araq
Copy link
Member

Araq commented Feb 7, 2020

Also affects Nim's tools like the docgen.

@timotheecour
Copy link
Member

Also affects Nim's tools like the docgen.

indeed => #7039

@timotheecour timotheecour added the const `const x=expr` or `static: stmt` label Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
const `const x=expr` or `static: stmt` Error Messages Medium Priority
Projects
None yet
Development

No branches or pull requests

4 participants