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

allow serializing distinct arrays #97

Merged
merged 1 commit into from
Sep 26, 2024
Merged

allow serializing distinct arrays #97

merged 1 commit into from
Sep 26, 2024

Conversation

arnetheduck
Copy link
Member

A complement to
#93

@arnetheduck arnetheduck merged commit b83739b into master Sep 26, 2024
18 checks passed
@arnetheduck arnetheduck deleted the distinct-array branch September 26, 2024 14:19
elif value is (seq or array or openArray) or
(value is distinct and distinctBase(value) is (seq or array or openArray)):
when value is distinct:
w.writeArray(distinctBase value)
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't that ignore an override of writeValue if we have:

  • A = seq[int] (base)
  • B = distinct A
  • C = distinct B

if we write C and have a custom writeValue on B?

distinctBase by default applies recursively, so distinctBase(C) is A not B.

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.

2 participants