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

Show Tuple{:A,:B} displays as Tuple{A,B} on 1.7 #42931

Closed
rafaqz opened this issue Nov 4, 2021 · 2 comments · Fixed by #42999
Closed

Show Tuple{:A,:B} displays as Tuple{A,B} on 1.7 #42931

rafaqz opened this issue Nov 4, 2021 · 2 comments · Fixed by #42999
Labels
bug Indicates an unexpected problem or unintended behavior display and printing Aesthetics and correctness of printed representations of objects. good first issue Indicates a good issue for first-time contributors to Julia regression Regression in behavior compared to a previous version

Comments

@rafaqz
Copy link
Contributor

rafaqz commented Nov 4, 2021

A Tuple with symbol contents no longer displays the contents as symbols with show, but as variable names - without the colon. Val still prints symbols with colons.

Julia 1.6:

julia> Tuple{:A,:B}
Tuple{:A, :B}

julia> Val{:A}
Val{:A}

Julia 1.7

julia> Tuple{:A,:B}
Tuple{A, B} # << This has no colons

julia> Val{:A}
Val{:A}

Probably we want the 1.6 behavior?

This is happening on both rc1 and rc2. It likely occurred with the new show_typeparams method.

@inkydragon
Copy link
Member

master

julia/base/show.jl

Lines 998 to 1000 in 236523f

print(io, "Tuple{")
join(io, parameters, ", ")
print(io, "}")

v1.6.3

julia/base/show.jl

Lines 925 to 931 in ae8452a

print(io, '{')
for i = 1:n
p = parameters[i]
show(io, p)
i < n && print(io, ", ")
end
print(io, '}')

julia> show(stdout, Tuple{:A,:B})
Tuple{A, B}
julia> join(stdout, Tuple{:A,:B}.parameters, ", ")
A, B
julia> join(stdout, [:A, :B], ", ")
A, B

julia> print(:a)
a
julia> show(stdout, :a)
:a

@simeonschaub simeonschaub added bug Indicates an unexpected problem or unintended behavior display and printing Aesthetics and correctness of printed representations of objects. good first issue Indicates a good issue for first-time contributors to Julia labels Nov 4, 2021
@simeonschaub
Copy link
Member

Yes, that should be using repr instead of string for printing parameters. @inkydragon Want to make a PR?

@JeffBezanson JeffBezanson added the regression Regression in behavior compared to a previous version label Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior display and printing Aesthetics and correctness of printed representations of objects. good first issue Indicates a good issue for first-time contributors to Julia regression Regression in behavior compared to a previous version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants