Skip to content

Commit

Permalink
Merge 582872b into c06662a
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobnissen authored Feb 29, 2024
2 parents c06662a + 582872b commit eada2dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion base/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3007,7 +3007,9 @@ function dump(io::IOContext, x::DataType, n::Int, indent)
fieldtypes = datatype_fieldtypes(x)
for idx in 1:length(fields)
println(io)
print(io, indent, " ", fields[idx])
print(io, indent, " ")
isconst(x, idx) && print(io, "const ")
print(io, fields[idx])
if isassigned(fieldtypes, idx)
print(io, "::")
print(tvar_io, fieldtypes[idx])
Expand Down
2 changes: 1 addition & 1 deletion test/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,7 @@ let repr = sprint(dump, :(x = 1))
@test repr == "Expr\n head: Symbol =\n args: Array{Any}((2,))\n 1: Symbol x\n 2: $Int 1\n"
end
let repr = sprint(dump, Pair{String,Int64})
@test repr == "Pair{String, Int64} <: Any\n first::String\n second::Int64\n"
@test repr == "Pair{String, Int64} <: Any\n const first::String\n const second::Int64\n"
end
let repr = sprint(dump, Tuple)
@test repr == "Tuple <: Any\n"
Expand Down

0 comments on commit eada2dc

Please sign in to comment.