Skip to content

Ensure static array constructors create copies #336

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

Merged
merged 3 commits into from
Nov 12, 2017

Conversation

c42f
Copy link
Member

@c42f c42f commented Nov 12, 2017

I'm not sure whether I've missed anything here, but calling Tuple seems like the simplest way to achieve a copying constructor.

Fixes #335

The second commit here is a quick fix for some broken constructors I found when creating a test case for this.

@codecov-io
Copy link

codecov-io commented Nov 12, 2017

Codecov Report

Merging #336 into master will increase coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #336      +/-   ##
==========================================
+ Coverage   93.28%   93.36%   +0.07%     
==========================================
  Files          37       37              
  Lines        2710     2711       +1     
==========================================
+ Hits         2528     2531       +3     
+ Misses        182      180       -2
Impacted Files Coverage Δ
src/traits.jl 91.42% <100%> (+0.25%) ⬆️
src/MArray.jl 96.89% <100%> (+0.62%) ⬆️
src/convert.jl 100% <100%> (ø) ⬆️
src/SArray.jl 97.24% <100%> (+0.68%) ⬆️
src/SDiagonal.jl 100% <0%> (ø) ⬆️

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 0e9ce69...489b9c7. Read the comment docs.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.08%) to 93.36% when pulling fb67ea4 on cjf/fix-copying-constructor into 0e9ce69 on master.

@mschauer
Copy link
Collaborator

Maybe a test that the convert(T, x::T)s are not affected (not copying)?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.08%) to 93.36% when pulling 489b9c7 on cjf/fix-copying-constructor into 0e9ce69 on master.

@c42f
Copy link
Member Author

c42f commented Nov 12, 2017

Sounds like a good idea. I added that test as well.

@c42f c42f merged commit 11ec063 into master Nov 12, 2017
@c42f c42f deleted the cjf/fix-copying-constructor branch November 12, 2017 23:31
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.

MArray Constructor should make copy
7 participants