You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia> t = (a=1, b=2, c=3)
(a =1, b =2, c =3)
julia>map(println, pairs(t))
ERROR: MethodError: Cannot `convert` an object of type Base.Generator{Base.Iterators.IndexValue{Symbol,Int64,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:a, :b, :c),Tuple{Int64,Int64,Int64}}},typeof(println)} to an object of type Base.Iterators.IndexValue{Symbol,Int64,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:a, :b, :c),Tuple{Int64,Int64,Int64}}}
This may have arisen from a call to the constructor Base.Iterators.IndexValue{Symbol,Int64,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:a, :b, :c),Tuple{Int64,Int64,Int64}}}(...),
since type constructors fall back to convert methods.
Stacktrace:
[1] Base.Iterators.IndexValue{Symbol,Int64,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:a, :b, :c),Tuple{Int64,Int64,Int64}}}(::Base.Generator{Base.Iterators.IndexValue{Symbol,Int64,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:a, :b, :c),Tuple{Int64,Int64,Int64}}},typeof(println)}) at ./sysimg.jl:124
[2] map(::Function, ::Base.Iterators.IndexValue{Symbol,Int64,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:a, :b, :c),Tuple{Int64,Int64,Int64}}}) at ./deprecated.jl:57
[3] top-level scope
The text was updated successfully, but these errors were encountered:
Maybe we should un-deprecate that method? But this wouldn't work anyways, since the OP should be using foreach (which already works for both):
julia>map(println, pairs(Dict(1=>2, 2=>3)))
W-`map(f, d::T) where T <: AbstractDict` is deprecated, use `T((f(p) for p = pairs(d)))` instead. -Warn:Core:julia_internal.h:380| caller = jl_call_fptr_internal at julia_internal.h:380 [inlined]
2=>3
ERROR: MethodError: no method matching start(::Nothing)
Closest candidates are:start(::SimpleVector) at essentials.jl:550start(::Base.MethodList) at reflection.jl:672start(::ExponentialBackOff) at error.jl:171...
Stacktrace:
[1] Dict{Int64,Int64}(::Base.Generator{Dict{Int64,Int64},typeof(println)}) at ./dict.jl:116
[2] map(::Function, ::Dict{Int64,Int64}) at ./deprecated.jl:57
[3] top-level scope
The text was updated successfully, but these errors were encountered: