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

JsonSerializer.writeValue should accept immutable/const values #1109

Merged
merged 1 commit into from Jun 11, 2015

Conversation

Projects
None yet
2 participants
@japplegame
Contributor

japplegame commented May 15, 2015

No description provided.

@s-ludwig

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig May 15, 2015

Member

Since T is a template type, it should usually be inferred to const/immutable just fine. If you have any failing case, can you add that as a unit test?

Member

s-ludwig commented May 15, 2015

Since T is a template type, it should usually be inferred to const/immutable just fine. If you have any failing case, can you add that as a unit test?

@japplegame

This comment has been minimized.

Show comment
Hide comment
@japplegame

japplegame May 15, 2015

Contributor

serialization fails if immutable / const class has toJson / fromJson methods.
Caused by this line: https://github.com/rejectedsoftware/vibe.d/blob/master/source/vibe/data/serialization.d#L308
Perhaps it will be better to change serialization.d instead json.d:
serializer.writeValue!TU(value) -> serializer.writeValue!T(value).

Contributor

japplegame commented May 15, 2015

serialization fails if immutable / const class has toJson / fromJson methods.
Caused by this line: https://github.com/rejectedsoftware/vibe.d/blob/master/source/vibe/data/serialization.d#L308
Perhaps it will be better to change serialization.d instead json.d:
serializer.writeValue!TU(value) -> serializer.writeValue!T(value).

@s-ludwig

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig Jun 11, 2015

Member

Okay, I've taken another look and I think this is the safest fix. I'll merge and add a unit test.

Member

s-ludwig commented Jun 11, 2015

Okay, I've taken another look and I think this is the safest fix. I'll merge and add a unit test.

s-ludwig added a commit that referenced this pull request Jun 11, 2015

Merge pull request #1109 from japplegame/patch-3
JsonSerializer.writeValue should accept immutable/const values

@s-ludwig s-ludwig merged commit c840a82 into vibe-d:master Jun 11, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

s-ludwig added a commit that referenced this pull request Jun 11, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment