Skip to content
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

overloading show for text/plain requires 3-argument version if custom type is an AbstractArray #17491

Closed
ssfrr opened this issue Jul 18, 2016 · 1 comment

Comments

@ssfrr
Copy link
Contributor

ssfrr commented Jul 18, 2016

The latest docs for show and friends say:

The default MIME type is MIME"text/plain". There is a fallback definition for text/plain output that calls show with 2 arguments. Therefore, this case should be handled by defining a 2-argument show(stream::IO, x::MyType) method.

However, if MyType subtypes AbstractArray and you define the 2-argument version of show, julia ends up calling this 3-arg definition for AbstractArray instead of your version.

Would it cause problems if the AbstractArray definition used the 2-argument version?

@vtjnash
Copy link
Member

vtjnash commented Jul 18, 2016

the doc update issue is #16763

@vtjnash vtjnash closed this as completed Jul 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants