Skip to content

Commit

Permalink
fix warning on julia 1.7
Browse files Browse the repository at this point in the history
    Warning: use values(kwargs) and keys(kwargs) instead of kwargs.data and kwargs.itr

Comes from JuliaLang/julia#39448
  • Loading branch information
visr committed Jul 26, 2021
1 parent d57b37e commit 4e8e528
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/names.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ end
@inline @propagate_inbounds function getkey(A; kw...)
list = dimnames(A)
issubset(keys(kw), list) || error("some keywords not in list of names!")
args = map(s -> Base.sym_in(s, kw.itr) ? getfield(values(kw), s) : Colon(), list)
args = map(s -> Base.sym_in(s, keys(kw)) ? getfield(values(kw), s) : Colon(), list)
A(args...)
end

Expand Down
2 changes: 1 addition & 1 deletion src/push.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ append!!(r::AbstractVector, s::AbstractVector) = (extend_by!!(r, length(s)); vca
This pushes `val` into `A.data`, and pushes `key` to `axiskeys(A,1)`.
Both of these must be legal operations, e.g. `A = wrapdims([1], ["a"]); push!(A, b=2)`.
"""
Base.push!(A::KeyedArray; kw...) = push!(A, map(Pair, keys(kw), values(kw.data))...)
Base.push!(A::KeyedArray; kw...) = push!(A, map(Pair, keys(kw), values(values(kw)))...)

function Base.push!(A::KeyedArray, pairs::Pair...)
axiskeys(A,1) isa AbstractRange && error("can't use push!(A, key => val) when axiskeys(A,1) isa AbstractRange")
Expand Down
2 changes: 1 addition & 1 deletion src/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ struct ShowWith{T,NT} <: AbstractString
hide::Bool
nt::NT
ShowWith(val; hide::Bool=false, kw...) =
new{typeof(val),typeof(kw.data)}(val, hide, kw.data)
new{typeof(val),typeof(values(kw))}(val, hide, values(kw))
end
function Base.show(io::IO, x::ShowWith; kw...)
# ioc = IOContext(io, :compact => true) # using this really breaks spacing!
Expand Down

0 comments on commit 4e8e528

Please sign in to comment.