NamedTuples.jl
NamedTuples.jl copied to clipboard
Data conversion from a tuple to a named tuple.
I expected the following works but it doesn't:
julia> using NamedTuples
julia> convert(@NT(foo::Int,bar::String), (42, "bar"))
ERROR: MethodError: Cannot `convert` an object of type Tuple{Int64,String} to an object of type NamedTuples._NT_foo_bar{Int64,String}
This may have arisen from a call to the constructor NamedTuples._NT_foo_bar{Int64,String}(...),
since type constructors fall back to convert methods.
Is there any reason not to support conversion from tuples?