NamedTuples.jl icon indicating copy to clipboard operation
NamedTuples.jl copied to clipboard

Data conversion from a tuple to a named tuple.

Open bicycle1885 opened this issue 7 years ago • 0 comments

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?

bicycle1885 avatar Jun 24 '17 13:06 bicycle1885