-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Fix show() error while calling UDPSocket() in REPL. #14325
Conversation
@tkelman What tests should be implemented here? |
@abhijithanilkumar tests for |
@kshyatt Is the displayed message fine? Or should it be changed to something else? |
This is good, though there's an underlying issue that the show method that was previously being called for the LibuvStream abstract type assumes the presence of a buffer field. That's apparently a bad assumption, question is whether there are counterexamples other than UDPSocket? |
@tkelman TCPSocket and UDPSocket uses LibuvStream. TCPSocket works fine. |
I think the message is fine. @tkelman I grepped for |
I'm not sure whether that type is meant to be subtyped by packages. If not, maybe the existing show method should be made more specific to only apply to TCPSocket. |
The existing show method also works for |
Are there other methods on the abstract LibuvStream that make similar type member assumptions? show might not be the only thing broken. |
@tkelman @abhijithanilkumar Seems like there are a few methods which are broken due to this assumption. Few examples. (This is on 0.4.1) julia> nb_available(s)
ERROR: type UDPSocket has no field buffer
in nb_available at stream.jl:254
julia> isreadable(s);
ERROR: type UDPSocket has no field buffer
in isreadable at stream.jl:243
julia> isopen(s);
ERROR: type UDPSocket has no field buffer
in print at strings/io.jl:8
in print_to_string at strings/io.jl:36
in isopen at stream.jl:317 |
@tkelman What has to be done here? |
needs to add tests of this method |
|
@tkelman Is this okay? |
I think that looks right. |
Once this is merged we should open a new issue for the other methods that don't work on UDPSocket for the same underlying reason that @rohitvarkey described above. |
@tkelman So is the work here done? Anything else to be covered? |
Fix show() error while calling UDPSocket() in REPL.
Calling UDPSocket() displays this now.
Fixes #13711