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

Use ReshapedArray for isbitsunion arrays (fixes #28611) #30149

Merged
merged 2 commits into from
Nov 28, 2018
Merged

Conversation

timholy
Copy link
Sponsor Member

@timholy timholy commented Nov 25, 2018

The only non-obvious part of this is getting correct dispatch for Array{Any}, ensuring that we return an Array without messing up inference of other cases. (It fails

julia/test/core.jl

Lines 4172 to 4174 in f4c7779

arrayset_unknown_dim(Any, 1)
arrayset_unknown_dim(Any, 2)
arrayset_unknown_dim(Any, 3)
if we don't do this properly.)

Fixes #28611.

CC @GlenHertz, @nalimilan.

@timholy
Copy link
Sponsor Member Author

timholy commented Nov 25, 2018

The failure on apple seems spurious.

@nalimilan
Copy link
Member

Thanks! But don't we need a more general fix handling all unions of isbits types?

@timholy
Copy link
Sponsor Member Author

timholy commented Nov 26, 2018

Hmm, good point. I had forgotten this was no longer special-cased for Missing.

@timholy
Copy link
Sponsor Member Author

timholy commented Nov 26, 2018

Technically this is breaking, although the cases it breaks are already silently buggy. If the breaking nature is a problem, perhaps the backport label should be removed.

@timholy timholy changed the title Use ReshapedArray for reshape(::Array{Union{T,Missing}}, ...) (fixes #28611) Use ReshapedArray for isbitsunion arrays (fixes #28611) Nov 26, 2018
base/array.jl Show resolved Hide resolved
base/reshapedarray.jl Outdated Show resolved Hide resolved
@timholy
Copy link
Sponsor Member Author

timholy commented Nov 27, 2018

I'll merge soon, barring further concerns.

@KristofferC
Copy link
Sponsor Member

This doesn't seem backportable.

@KristofferC KristofferC added the kind:minor change Marginal behavior change acceptable for a minor release label Nov 27, 2018
@andreasnoack
Copy link
Member

What about the bug in #28611

@KristofferC
Copy link
Sponsor Member

It's in the same spot as those reffed by this PR: #29406.

@timholy
Copy link
Sponsor Member Author

timholy commented Nov 27, 2018

What about the bug in #28611

That's what this fixes (see the test). I'm not sure I understand the relevance of #29406.

@KristofferC
Copy link
Sponsor Member

I think Andreas point is that this should be backported because it fixes a bug. My response is that even though it fixes a bug it might break working code (which is the same as the bugs getting fixed by #29406). AFAIU, we are quite conservative when it comes to behavior changes for patch releases.

@timholy timholy merged commit 065d0f5 into master Nov 28, 2018
@timholy timholy deleted the teh/fix_28611 branch November 28, 2018 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:minor change Marginal behavior change acceptable for a minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants