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

Incorrect error message #10251

Closed
donaldcallen opened this issue Jan 9, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@donaldcallen
Copy link

commented Jan 9, 2019

If you define two enums having the same elements, the compiler complains about the redefinition, but says the previous definition is in the same place.

Example

type
    Enum1 = enum
        foo, bar, baz
    Enum2 = enum
        foo, bar, baz

Current Output

dca@franz:/tmp$ nim compile testit.nim
Hint: used config file '/home/dca/.choosenim/toolchains/nim-0.19.2/config/nim.cfg' [Conf]
Hint: system [Processing]
Hint: testit [Processing]
testit.nim(5, 9) Error: redefinition of 'foo'; previous declaration here: testit.nim(5, 8)
dca@franz:/tmp$

Expected Output

testit.nim(5, 9) Error: redefinition of 'foo'; previous declaration here: testit.nim(3, 9)

Possible Solution

Additional Information

$ nim -v
Nim Compiler Version 0.19.2 [Linux: amd64]

krux02 added a commit to krux02/Nim that referenced this issue Jan 10, 2019

@Araq Araq closed this in f55c8d4 Jan 10, 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.