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

support ConstructionBase: constructorof and setproperties #319

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

aplavin
Copy link
Member

@aplavin aplavin commented Nov 18, 2024

StructArrays are quite involved types, it's infeasible for some generic machinery to know how to reconstruct them from their fields/properties. Thus this PR adds explicit support for both constructorof() and setproperties() from ConstructionBase. With these, all the packages that need to reconstruct arbitrary objects / rely on ConstructionBase already, can work with StructArrays as well.

The implementation is short, but needs some care to get right. That's the benefit of having it in one place, with tests for handling of all simple and complex cases.
ConstructionBase has already been a dependency of StructArrays, no new deps added in this PR.

@aplavin
Copy link
Member Author

aplavin commented Nov 20, 2024

Should be non-controversial – implements a well-established interface with clear guarantees.

@aplavin aplavin merged commit 6567009 into master Nov 20, 2024
9 checks passed
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.

1 participant