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

Define constructorof for Tuple and NamedTuple? #16

Merged
merged 1 commit into from
Oct 2, 2019

Conversation

tkf
Copy link
Member

@tkf tkf commented Oct 2, 2019

I started implementing this because I remember doing something similer in Kaleido.jl but then realized that what I did in Kaleido.jl is a bit differnt from actual constructorof spec. So, this PR is not driven by a real need at this point. However, since Tuple and NamedTuple are so basic that I think it makes sense to support this. What do you think?

(One potential benefit was that we can remove setproperties(::NamedTuple, ::NamedTuple) with this PR. But the inference test failed with the generic fallback so that's no go.)

@codecov-io
Copy link

codecov-io commented Oct 2, 2019

Codecov Report

Merging #16 into master will increase coverage by 0.89%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #16      +/-   ##
==========================================
+ Coverage   92.85%   93.75%   +0.89%     
==========================================
  Files           1        1              
  Lines          14       16       +2     
==========================================
+ Hits           13       15       +2     
  Misses          1        1
Impacted Files Coverage Δ
src/ConstructionBase.jl 93.75% <100%> (+0.89%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ee593e5...169e7e4. Read the comment docs.

@tkf
Copy link
Member Author

tkf commented Oct 2, 2019

But the inference test failed with the generic fallback so that's no go.

For fun, #17 implements a type-stable constructorof(::Type{<:NamedTuple})(args...).

@tkf tkf merged commit 169e7e4 into JuliaObjects:master Oct 2, 2019
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.75%. Comparing base (ee593e5) to head (169e7e4).
Report is 180 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #16      +/-   ##
==========================================
+ Coverage   92.85%   93.75%   +0.89%     
==========================================
  Files           1        1              
  Lines          14       16       +2     
==========================================
+ Hits           13       15       +2     
  Misses          1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Successfully merging this pull request may close these issues.

3 participants