-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 some cases of typeinfo
printing
#33290
Conversation
EDIT: fixed it.
|
This looks like an improvement in general, and the julia> show(Dict((1=>2) => (3=>4)))
Dict{Pair{Int64,Int64},Pair{Int64,Int64}}((1 => 2) => (3 => 4)) (Before: |
base/arrayshow.jl
Outdated
@@ -457,6 +457,11 @@ typeinfo_eltype(typeinfo::Type{<:AbstractArray{T}}) where {T} = eltype(typeinfo) | |||
typeinfo_eltype(typeinfo::Type{<:AbstractDict{K,V}}) where {K,V} = eltype(typeinfo) | |||
typeinfo_eltype(typeinfo::Type{<:AbstractSet{T}}) where {T} = eltype(typeinfo) | |||
|
|||
# types that can be parsed back accurately from their un-decorated representations | |||
function typeinfo_implicit(@nospecialize(T)) | |||
return T === Float64 || T === Int || T === Char || T === String || T === Symbol || |
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.
Is it for compiler friendlyness that you don't write something like T in (Float64, Int, Char, String, Symbol)
?
I think we could make |
64422b6
to
95fbad6
Compare
Ok, now everything looks real nice. We can remove a bunch more redundant type info too. |
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.
That's great!
This fixes a test failure on nightly, ref JuliaLang/julia#33290.
This fixes a test failure on nightly, ref JuliaLang/julia#33290.
Fixes #30683
Before:
after:
Also fixes other similar cases with Dict, e.g.
As a bonus, there are also some reductions in verbosity. Certain types never need type info, e.g.
[1]
can always be shown instead ofInt[1]
. This addsSymbol
and singleton types to that set.