-
-
Notifications
You must be signed in to change notification settings - Fork 749
Revert "Fix Issue 21731 - SumType should provide convenient access to the typ…" #7922
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
Conversation
|
Thanks for your pull request and interest in making D better, @atilaneves! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + phobos#7922" |
n8sh
left a comment
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.
Approving and marking for immediate merging since the submitter is the one who has to approve all new public symbols and he does not appear to have approved the PR being reverted.
It would have been nice to have an explanation as to why this is being reverted though. Any kind of context you might have right now will not be known to other people 6 months from now. |
The rationale is that APIs should prevent misuse, and not going through |
I agree with this, but do not understand how it justifies excluding |
Good point. I still don't see why this would be useful though, and after asking in the forum I didn't see any compelling answers. |
The main answer given on the forums was serialization. For example, having access to SumType!(int, string)("hello")to { "type": 1, "value": "hello" }Of course, you could equally well choose a different schema for your serialized data; for example
...but these have their own disadvantages. (1) requires you to define a mapping between types and strings, which is non-trivial in the general case, and (2) makes it impossible to distinguish a plain |
Reverts #7886