-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
don't warn on using Foo: _
#58681
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 on using Foo: _
#58681
Conversation
Hello! I am a bot. Thank you for your pull request! I have assigned
Note: If you are a Julia committer, please make sure that your organization membership is public. |
I don't know how I feel about this. I do think |
test/syntax.jl
Outdated
# `using Foo: _` is special cased to not warn | ||
# https://github.com/JuliaLang/julia/issues/58667 | ||
exename = Base.julia_cmd() | ||
base = """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have @test_warn
and @test_nowarn
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, fixed. I copied https://github.com/JuliaLang/julia/blob/master/test/misc.jl#L81-L101 after searching for WARNING
in the tests, maybe that one needs an update
Yeah, to me that seems correct, matching julia> var"_"
ERROR: syntax: all-underscore identifiers are write-only and their values cannot be used in expressions
Stacktrace:
[1] top-level scope
@ REPL[14]:1 which is what I wanted, but if I re-run the julia> @test_nowarn using .Mod58667: _
WARNING: ignoring conflicting import of Mod58667._ into Main
Test Failed at /Users/eph/julia-native/usr/share/julia/stdlib/v1.13/Test/src/Test.jl:984
Expression: contains_warn(read(fname, String), $(Expr(:escape, Test.var"#@test_nowarn##0#@test_nowarn##1"())))
Evaluated: contains_warn("WARNING: ignoring conflicting import of Mod58667._ into Main\n", Test.var"#@test_nowarn##0#@test_nowarn##1"())
ERROR: There was an error during testing so I guess it does think it imported a binding edit: fixed in 858c9ca |
blue style and yas style say "never use import" (well, "prefer |
ok, I think I fixed the implementation issue just by returning early like in the next branch, and I strengthened the test to verify we can do |
The dropping of |
Yeah, it does seem like a weird special case, I agree. I think the syntax would be handy but agree that like all new syntax it deserves scrutiny and a high bar. |
closes #58667
re- #58666, embarrassingly enough I did use cursor to help with this 1-line change because I don't know C.