-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Imports don't resolve correctly when generics are involved. #22984
Comments
Implicit items is broken inside generics do |
ok thanks |
Another case of generic sandwiches: |
This is actually not a generic sandwich issue, it's just implicit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
It appears that nim doesn't resolve the imports correctly when generics are involved.
For example I have two files
main.nim
grouptest.nim
Adding the
import sets
within the main.nim makes the error go away. So it seems that it is creating theget()
proc within main.nim, rather than in grouptest.nim. If this is true, this might create some unforeseen for things such as libraries or 3rd party code.I have the files zipped up here to make it easier to test
importbug.zip
Nim Version
Nim Compiler Version 2.0.0 [Windows: amd64]
Compiled at 2023-08-01
Copyright (c) 2006-2023 by Andreas Rumpf
active boot switches: -d:release
Current Output
Expected Output
Possible Solution
Not exactly sure what is causing the issue, but as mentioned earlier it seems that it's creating the
get()
proc within main.nim, rather than in grouptest.nim. It would be best to create the proc at its original location rather than when it was first called (in this case it was called in main.nim).
Additional Information
No response
The text was updated successfully, but these errors were encountered: