Using the latest protobuf-net for proto2 .proto files I tried on Marc's site's generator:
syntax = "proto2";
message my_message {
optional string val1 = 1 [default="hello!"];
required uint32 val2 = 2 [default="4"];
}
For the optional field val1 it correctly adds the code for the default value, however it's not generated for the required val2. What I was expecting it that it would generate the same code and I wouldn't have to explicitly set the val2 field since it was already set by the default value. Why is this not the case?