Skip to content

Commit aeca6f1

Browse files
vtjnashKristofferC
authored andcommitted
show: fix duplicate typealias printing bug
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. (cherry picked from commit 48ad01d)
1 parent fa66cb3 commit aeca6f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/show.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ function show(io::IO, ::MIME"text/plain", @nospecialize(x::Type))
751751
show(io, x)
752752
if !print_without_params(x) && get(io, :compact, true)
753753
properx = makeproper(io, x)
754-
if make_typealias(properx) !== nothing || x <: make_typealiases(properx)[2]
754+
if make_typealias(properx) !== nothing || (unwrap_unionall(x) isa Union && x <: make_typealiases(properx)[2])
755755
print(io, " (alias for ")
756756
show(IOContext(io, :compact => false), x)
757757
print(io, ")")

0 commit comments

Comments
 (0)