-
-
Notifications
You must be signed in to change notification settings - Fork 286
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
Value classes for primitive single-element message? #4
Comments
Currently this is not the case. I believe we can do that and it would be relatively easy to add. Any reason this shouldn't be applied to non-primitive single-element messages? |
Hmm. Good question. In the particular use case I envision, I have a set of It could also be useful for non-primitive single-element messages. Either On Fri Dec 19 2014 at 6:41:21 PM Nadav S. Samet [email protected]
|
I looked into this and the change isn't as straightforward as I hoped. Given that required fields are going to be dropped in the upcoming proto3 syntax, there is a little value in implementing this. I'm interested to know if the AnyVal optimisation makes a measurable performance difference in your use case and then we can figure out if it's worth the investment. In the mean time, I suggest that you use your own case classes that extend AnyVal during the life of your program, and map them to/from protobufs when you need to serialize/deserialize. |
Would it be possible for messages with one required field of value type to extend AnyVal? I am presuming not, but it's not completely clear from a cursory scan of the code.
The text was updated successfully, but these errors were encountered: