Closed purkhusid closed 2 years ago
To the best of my knowledge, the optional
keyword was added to forcibly support presence on all fields. We already support presence on all fields anyway, so as you say, it shouldn't really affect the output.
I can't spot any errors when compiling a file with optional fields. This may be due the recent change in how one-of fields are handled. Can you share the error?
Anyway, optional fields are turned into single-case one-ofs by the compiler. This causes the generated F# field to be wrapped in a single-case union, which is less-than-desirable behaviour. Thanks for pointing this out.
Fixed in #8
Closed in #16.
The F# plugin fails when it encounters an proto3 file that contains the
optional
keyword. This keyword was recently to the proto3 spec. More information about it here: https://github.com/protocolbuffers/protobuf/blob/master/docs/implementing_proto3_presence.mdMy guess is that this does not really affect the output of the F# plugin since it it is not outputting nullable fields?