-
-
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
Compiler thinks an unused proc is used when an auto parameter is used #21724
Comments
When using |
Could not help but minimize it further, the issue is that closed symbol causes semantic analysis to be done, which means it compiles the proc hey() {.deprecated: "Shouldn't use this".} = echo "hey"
proc gen(o: auto) =
bind hey |
This comment was marked as off-topic.
This comment was marked as off-topic.
I assume it's just to do exactly as this issue does but in a sensible way proc doThing(x: auto) = discard
proc myGen(x: auto) = doThing(x) # We use `doThing` so it's used Arguably the issue here is really that |
fixes nim-lang#21724 but might break code
fixes nim-lang#21724 but might break code
* always force open generic dot field symbols? fixes #21724 but might break code * alternative, should fix CI * other alternative, add test for previous CI failure * not needed * make sure call doesn't compile too * ok actual second test * ok final actual correct test * apply performance idea * don't make fromDotExpr static
…#21738) * always force open generic dot field symbols? fixes nim-lang#21724 but might break code * alternative, should fix CI * other alternative, add test for previous CI failure * not needed * make sure call doesn't compile too * ok actual second test * ok final actual correct test * apply performance idea * don't make fromDotExpr static
…#21738) * always force open generic dot field symbols? fixes nim-lang#21724 but might break code * alternative, should fix CI * other alternative, add test for previous CI failure * not needed * make sure call doesn't compile too * ok actual second test * ok final actual correct test * apply performance idea * don't make fromDotExpr static
* always force open generic dot field symbols? fixes #21724 but might break code * alternative, should fix CI * other alternative, add test for previous CI failure * not needed * make sure call doesn't compile too * ok actual second test * ok final actual correct test * apply performance idea * don't make fromDotExpr static (cherry picked from commit e92d768)
* always force open generic dot field symbols? fixes #21724 but might break code * alternative, should fix CI * other alternative, add test for previous CI failure * not needed * make sure call doesn't compile too * ok actual second test * ok final actual correct test * apply performance idea * don't make fromDotExpr static (cherry picked from commit e92d768)
…#21738) * always force open generic dot field symbols? fixes nim-lang#21724 but might break code * alternative, should fix CI * other alternative, add test for previous CI failure * not needed * make sure call doesn't compile too * ok actual second test * ok final actual correct test * apply performance idea * don't make fromDotExpr static
Description
When executing
The compiler thinks the
hey
proc is being called and outputs the warning, but it is not actually being called.Nim Version
Nim Compiler Version 1.6.12 [MacOSX: amd64]
Compiled at 2023-03-16
Copyright (c) 2006-2023 by Andreas Rumpf
active boot switches: -d:release
Current Output
Expected Output
Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: