Skip to content
This repository was archived by the owner on Jun 4, 2019. It is now read-only.

Data conversion from a tuple to a named tuple. #38

Open
bicycle1885 opened this issue Jun 24, 2017 · 0 comments
Open

Data conversion from a tuple to a named tuple. #38

bicycle1885 opened this issue Jun 24, 2017 · 0 comments

Comments

@bicycle1885
Copy link

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant