Skip to content

Commit

Permalink
enable synergy with #45396
Browse files Browse the repository at this point in the history
  • Loading branch information
Lilith Hafner authored and Lilith Hafner committed May 27, 2023
1 parent df304cc commit a48defd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/rational.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ end
function show(io::IO, x::Rational)
show(io, numerator(x))

if isone(denominator(x)) && get(io, :typeinfo, Any) <: Rational
if isone(denominator(x)) && nonnothing_nonmissing_typeinfo(io) <: Rational
return
end

Expand Down
3 changes: 3 additions & 0 deletions test/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2156,6 +2156,9 @@ end
# issue #26847
@test_repr "Union{Missing, Float32}[1.0]"

# intersection of #45396 and #48822
@test_repr "Union{Missing, Rational{Int64}}[missing, 1//2, 2]"

# issue #30505
@test repr(Union{Tuple{Char}, Tuple{Char, Char}}[('a','b')]) == "Union{Tuple{Char}, Tuple{Char, Char}}[('a', 'b')]"

Expand Down

0 comments on commit a48defd

Please sign in to comment.