-
-
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
Warning and Hint Pragmas do not print to console when declared from a std lib module #12424
Comments
I would also like to mention that it became annoying for me when working for the std lib module because this behavior actively hid warnings problems from me that I was trying to find and fix. |
I would like to note that I am game for doing the work to change this behavior, but I need help finding where to start. I just did a quick search, but I was not able to find the code where this is happening. |
In graph.config.notes =
if s.owner.id == graph.config.mainPackageId or isDefined(graph.config, "booting"): graph.config.mainPackageNotes
else: graph.config.foreignPackageNotes So you can enable these already via |
Two ideas: 1.) Get rid of that 2.) Create a new pragma like I don't love the idea of adding a new pragma, but maybe that's the safest thing to do? Thoughts? |
//cc @narimiran |
Fixed by #17024, needs a test case I guess. |
closes #1969, closes #7547, closes #7737, closes #11838, closes #12283, closes #12714, closes #12720, closes #14053, closes #16118, closes #19670, closes #22645 I was going to wait on these but regression tests even for recent PRs are turning out to be important in wide reaching PRs like #24010. The other issues with the working label felt either finnicky (#7385, #9156, #12732, #15247), excessive to test (#12405, #12424, #17527), or I just don't know what fixed them/what the issue was (#16128: the PR link gives a server error by Github, #12457, #12487).
{.Warning.}
and{.Hint.}
pragmas that are declared inside std lib modules are ignored and not displayed to the user when compiling.The same pragmas in user code display correctly during compilation.
Note:
{.error.}
and{.deprecated.}
work correctly in std lib modules.According to @krux02:
Example
Here is an example of why this is not a good design:
This PR had to be reverted because it broke behavior for some users:
#12231
TLDR; the PR added a
{.error.}
pragma to thelocks.nim
module ifthreads
are not enabled.I attempted to re-implement the PR using a
{.Warning.}
pragma as a compromise.Unfortunately, converting the message to a
{.Warning.}
caused Nim to completely ignore the message.This is a completely valid case for a std lib module providing a useful warning to the user, and not just noise from the std lib internals.
The text was updated successfully, but these errors were encountered: