msoucy / dproto

D Protocol Buffer mixins to create structures at compile time
Boost Software License 1.0
37 stars 16 forks source link

Regression: No way to find out if optional field has been set or not #80

Open Marenz opened 8 years ago

Marenz commented 8 years ago

2.0.0 breaks this functionality which was available in 1.3.x.

msoucy commented 8 years ago

Just for the sake of tying things together, you opened #68 at one point to get this fixed.

Marenz commented 8 years ago

Yeah, but it's not working and I don't have the time. And so it won't get forgotten I opened this issue.

Marenz commented 8 years ago

Any suggestions how this would be implemented? I am still stuck on version 1 because of this regression

msoucy commented 8 years ago

The functionality of std.typecons.Nullable should be accessible on optional fields currently. Is this not the case?

Marenz commented 8 years ago

Sure, the isNull() stuff and all is available, but it doesn't help because it doesn't contain the information wether an optional field was set or not. As already mentioned in the original issue that introduced the new "feature" https://github.com/msoucy/dproto/issues/63#issuecomment-192536785, optional fields get a default value (if they don't happen to be type message) and thus are no longer null, thus you have no idea if they actually have been set or not. Basically the nullable wrap is worthless. Sadly noone seemed to care when I addressed that in the issue.