Skip to content

Commit eada2dc

Browse files
authored
Merge 582872b into c06662a
2 parents c06662a + 582872b commit eada2dc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

base/show.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3007,7 +3007,9 @@ function dump(io::IOContext, x::DataType, n::Int, indent)
30073007
fieldtypes = datatype_fieldtypes(x)
30083008
for idx in 1:length(fields)
30093009
println(io)
3010-
print(io, indent, " ", fields[idx])
3010+
print(io, indent, " ")
3011+
isconst(x, idx) && print(io, "const ")
3012+
print(io, fields[idx])
30113013
if isassigned(fieldtypes, idx)
30123014
print(io, "::")
30133015
print(tvar_io, fieldtypes[idx])

test/show.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,7 @@ let repr = sprint(dump, :(x = 1))
12631263
@test repr == "Expr\n head: Symbol =\n args: Array{Any}((2,))\n 1: Symbol x\n 2: $Int 1\n"
12641264
end
12651265
let repr = sprint(dump, Pair{String,Int64})
1266-
@test repr == "Pair{String, Int64} <: Any\n first::String\n second::Int64\n"
1266+
@test repr == "Pair{String, Int64} <: Any\n const first::String\n const second::Int64\n"
12671267
end
12681268
let repr = sprint(dump, Tuple)
12691269
@test repr == "Tuple <: Any\n"

0 commit comments

Comments
 (0)