This repository has been archived by the owner on Jun 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
nfield(x::DataType) #33
Comments
julia> using NamedTuples
julia> x = @NT(a = 0.0, b = 0.0, c = 0.0)
(a = 0.0, b = 0.0, c = 0.0)
julia> nfields(NamedTuples._NT_a_b_c)
2
# however:
julia> nfields(typeof(x))
3 Not sure if this is a bug. cc @JeffBezanson |
Yes, this is not specific to NamedTuples. Currently it's giving 2 since a UnionAll type has 2 components. I'm not sure what to do in this case, but it should be addressed in base julia. |
See discussion in JuliaLang/julia#22350 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I think that
nfield(x::DataType)
returns a wrong result on the current master version with Julia 0.6.The registered version on Metadata with Julia 0.5 returns 3, which is the answer I expected
The text was updated successfully, but these errors were encountered: