Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing arg in TOML printvalue #57584

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stdlib/TOML/src/print.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ end
# Fallback
function printvalue(f::MbyFunc, io::IO, value, sorted::Bool)
toml_value = to_toml_value(f, value)
@invokelatest printvalue(f, io, toml_value)
@invokelatest printvalue(f, io, toml_value, sorted)
end

function printvalue(f::MbyFunc, io::IO, value::AbstractVector, sorted::Bool)
Expand Down Expand Up @@ -156,7 +156,7 @@ function print_table(f::MbyFunc, io::IO, a::AbstractDict,
)

if a in inline_tables
@invokelatest print_inline_table(f, io, a)
@invokelatest print_inline_table(f, io, a, sorted)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested locally and this fix isn't covered by tests.

return
end

Expand Down
8 changes: 8 additions & 0 deletions stdlib/TOML/test/print.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ loaders = ["gzip", { driver = "csv", args = {delim = "\t"}}]
a = 222
d = 333
"""

# https://github.com/JuliaLang/julia/pull/57584
d = Dict("b" => [MyStruct(1), MyStruct(2)])
@test toml_str(d) do x
x isa MyStruct && return Dict("a" => x.a)
end == """
b = [{a = 1}, {a = 2}]
"""
end

@testset "unsigned integers" for (x, s) in [
Expand Down