Skip to content

Conversation

@mateuszbaran
Copy link
Collaborator

Maybe not the prettiest solution but still fixes #557 and #782.

@mateuszbaran
Copy link
Collaborator Author

That failure looks like a Julia 1.0 bug and I don't see an obvious way to work around it 😕 .

@c42f c42f added the bugfix label Sep 28, 2020
@mateuszbaran
Copy link
Collaborator Author

Apart from not solving the problem of converting empty StaticArrays to SizedArray or SizedMatrix on Julia 1.0, this seems to work now 🙂 . Anyway, I think these two cases can be fixed in another PR if someone considers it worth fixing.

Copy link
Member

@c42f c42f left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack, sorry for the delay in replying to this. I'm a little unsure about this solution in the sense that it requires a new constructor for each StaticArray subtype. I feel like that shouldn't be necessary...

However, I also know that the generic dispatch for StaticArray constructors is quite hairy and hard to modify and that this does fix the bugs. So I think on balance we should just go with it.

(Regarding 1.0 - at this point it's basically EOL and I'm looking forward to removing support for it once 1.6 (or 1.7?) is declared the new LTS. So I'm not too worried about that.)

Co-authored-by: Chris Foster <chris42f@gmail.com>
@mateuszbaran
Copy link
Collaborator Author

I'm a little unsure about this solution in the sense that it requires a new constructor for each StaticArray subtype. I feel like that shouldn't be necessary...

After working with this a bit I feel that a part of hairiness of static array constructors is trying to define things for all subtypes of StaticArray. But I may be wrong. At the very least not all subtypes of StaticArray are constructible just from elements.

@mateuszbaran mateuszbaran merged commit b95d07e into JuliaArrays:master Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zero-length MVector to SVector conversion fails (type info is lost) error creating empty MVector

2 participants