forked from JuliaIO/BSON.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decide type of plain BSON array based on its contents
If an array has no Julia type information, then we previously made it Vector{Any}. Even if it only contained a single concrete data type. Now we create an array from the firts element's type and expand the type if another type of object is discovered during parsing. This may be surprising behaviour to some people, but this is also generally how Julia works if you create an array from an iterator or untyped literal. Certainly it could break some peoples code so I will bump the version to 0.6.0. If you really need an array of type Any after deserialisation, then just do something like `Any[A...]`. https://discourse.julialang.org/t/tail-call-optimization-and-function-barrier-based-accumulation-in-loops/25831 This doesn't happen when the array is referenced because we would have to update the reference after type promotion and it is not clear if this is worth the effort to implement.
- Loading branch information
Showing
3 changed files
with
36 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8315b11
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register branch=qs
8315b11
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/2185
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via: