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

order of imports can cause errors #11187

noonien opened this issue May 6, 2019 · 0 comments


None yet
3 participants
Copy link

commented May 6, 2019

Resolution of identifiers, in some cases, seems to erroneously depend on import order
This might cause errors depending on import order



# if the imports are reversed, it works
import c
import b

echo Foo(3)


import c

proc Foo*(x: int): Foo = discard


type Foo* = array[2, byte]

Current Output

a.nim(5, 9) Error: type mismatch: got <int literal(3)> but expected 'Foo = array[0..1, byte]'

Expected Output

[0, 0]

Possible Solution

Additional Information

nightly devel version: 2019-05-02-devel-c94ab46

Nim Compiler Version 0.19.9 [Linux: amd64]
Compiled at 2019-05-02
Copyright (c) 2006-2019 by Andreas Rumpf

active boot switches: -d:release -d:nativeStackTrace

IRC discussion about this issue starts here:

@Araq Araq added the High Priority label May 22, 2019

Araq added a commit that referenced this issue May 23, 2019

@Araq Araq closed this in 39a3dbb May 24, 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.