You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This distinction between set and unset fields comes from the proto2 spec. A field may be either present or not in a message, which is modeled in ScalaPB as (Some(_) or None). Only when you call getX the default value is provided.
Exactly. We're just mapping these two fields to a single Option. You may be interested in trying proto3, where primitives are not wrapped in Options, but there are no default values either (default is 0 for numerics, empty string, etc)
I have this protobuf code
message Foo { optional int32 schema = 1 [default = 11]; }
If I run this
I suppose you set 11 in the getter instead of setting Some(11) in schema directly. Isn't this an inconsistent state?
The text was updated successfully, but these errors were encountered: