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
publicconstint0FieldNumber=1;privateboolhas0;privatestring0_="";publicboolHas0{
get {returnhas0;}}publicstring0{get{return0_;}}
The 0FieldNumber, 0 and 0_ field/property names are invalid.
It looks like the Java code generator creates invalid code for this too, so although this is a regression in the C# codegen compared with the protobuf-csharp-port generator, we might deem it a reasonable restriction - but it would probably make sense to prohibit it explicitly.
The text was updated successfully, but these errors were encountered:
This commit includes changes to the C#-specific protos, and rebuilt versions of the "stock" protos.
The stock protos have been locally updated to have a specific C# namespace, but this is expected to change soon, so hasn't been committed.
Four areas are currently not tested:
1) Serialization - we may restore this at some point, possibly optionally.
2) Services - currently nothing is generated for this; will need to see how it interacts with GRPC
3) Fields beginning with _{digit} - see protocolbuffers#308
4) Fields with names which conflict with the declaring type in nasty ways - see protocolbuffers#309
This commit includes changes to the C#-specific protos, and rebuilt versions of the "stock" protos.
The stock protos have been locally updated to have a specific C# namespace, but this is expected to change soon, so hasn't been committed.
Four areas are currently not tested:
1) Serialization - we may restore this at some point, possibly optionally.
2) Services - currently nothing is generated for this; will need to see how it interacts with GRPC
3) Fields beginning with _{digit} - see protocolbuffers/protobuf#308
4) Fields with names which conflict with the declaring type in nasty ways - see protocolbuffers/protobuf#309
A proto like this:
Generates C# code like this:
The
0FieldNumber
,0
and0_
field/property names are invalid.It looks like the Java code generator creates invalid code for this too, so although this is a regression in the C# codegen compared with the protobuf-csharp-port generator, we might deem it a reasonable restriction - but it would probably make sense to prohibit it explicitly.
The text was updated successfully, but these errors were encountered: