-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
don't warn about redefining methods in Main #19888
Conversation
Yes, with #265 fixed I'd say this is ok. Not sure about this, but maybe we should limit this to interactive functions, i.e. functions not in any file? |
@JeffBezanson, people regularly |
Previous implementation and discussion at #18746 (also includes test) |
the version with a test was better |
We don't normally test warnings. If we want to do that, we need a better test framework than setting up redirect_stdout manually every time |
The work had been done manually for this case. There are some convenience macros in the Pkg tests that Carlo wrote that would be worth moving to a more general place and making more use of. |
Even better, we already have #18165. It's now very easy to do this correctly. |
#19903 shows what I had in mind for a nicer test framework for warnings than manual |
This PR closes #18725 by silencing the "Method definition overwritten" warnings when both the new and old methods are in
Main
.The warnings are useful for modules, where overwritten methods are usually an error, but are incredibly annoying and confusing during interactive work in the REPL (or IJulia etc.). (Now that #265 is fixed, redefining functions is much less dangerous, so most of the concerns raised in #18725 should now be moot.)
With this PR: