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

Improve error message for redefinitions #447

Closed
gradha opened this issue May 25, 2013 · 5 comments
Closed

Improve error message for redefinitions #447

gradha opened this issue May 25, 2013 · 5 comments

Comments

@gradha
Copy link
Contributor

gradha commented May 25, 2013

Given the file variable_leaks.nim:

include evil_leak

when isMainModule:
  let
    some_var = 2

And the file evil_leak.nim:

const
  SOME_VAR = "some var"

The compiler produces the following output:

$ nimrod c variable_leaks.nim 
variable_leaks.nim(5, 12) Error: redefinition of 'some_var'

It would help if the redefinition error could also point to the file/line where the original definition is, since a naive case sensitive grep would not find the source of the problem.

@Araq
Copy link
Member

Araq commented Oct 30, 2017

Still an issue.

@data-man
Copy link
Contributor

data-man commented Apr 1, 2018

Still an issue.

Not reproduced on devel.

include evil_leak

echo SOME_VAR

when isMainModule:
  let
    some_var = 2

  echo some_var

@timotheecour
Copy link
Member

@data-man what do you mean "Not reproduced on devel." ? see #8581

@data-man
Copy link
Contributor

data-man commented Aug 9, 2018

@timotheecour

I mean that variable_leaks.nim(5, 12) Error: redefinition of 'some_var don't appears for me.
Now outputs:

some var
2

@Araq
Copy link
Member

Araq commented Aug 9, 2018

@data-man Yeah, the example is outdated but the issue is real.

@Araq Araq closed this as completed in 539fc5d Sep 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants