Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent NamedTuple constructor behaviour #44086

Closed
the-noble-argon opened this issue Feb 9, 2022 · 0 comments · Fixed by #44132
Closed

Inconsistent NamedTuple constructor behaviour #44086

the-noble-argon opened this issue Feb 9, 2022 · 0 comments · Fixed by #44132
Assignees
Labels
kind:bug Indicates an unexpected problem or unintended behavior

Comments

@the-noble-argon
Copy link

When not specifying tuple parameters, NamedTuples extract information out of other NamedTuples correctly even when out of order
NamedTuple{(:failure,:survival,:repair)}((survival=0.5, failure=0.2, repair=0.3))
>> (failure = 0.2, survival = 0.5, repair = 0.3)

However, if I specify the tuple type, it fails to correctly re-order
NamedTuple{(:failure,:survival,:repair), NTuple{3,Float64}}((survival=0.5, failure=0.2, repair=0.3))
>> (failure = 0.5, survival = 0.2, repair = 0.3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants