Skip to content

Commit

Permalink
show: fix duplicate typealias printing bug
Browse files Browse the repository at this point in the history
If you had 2 aliases that both matched, we might print
```S{T} where T (alias for S{T} where T)```
which is clearly unnecessary.
  • Loading branch information
vtjnash committed Jan 22, 2021
1 parent 2684eac commit 48ad01d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ function show(io::IO, ::MIME"text/plain", @nospecialize(x::Type))
show(io, x)
if !print_without_params(x) && get(io, :compact, true)
properx = makeproper(io, x)
if make_typealias(properx) !== nothing || x <: make_typealiases(properx)[2]
if make_typealias(properx) !== nothing || (unwrap_unionall(x) isa Union && x <: make_typealiases(properx)[2])
print(io, " (alias for ")
show(IOContext(io, :compact => false), x)
print(io, ")")
Expand Down

0 comments on commit 48ad01d

Please sign in to comment.