silentorbit / protobuf

C# code generator for reading and writing the protocol buffers format
https://silentorbit.com/protobuf/
MIT License
307 stars 105 forks source link

Unused variable in DeserializeLengthDelimited method #18

Closed ido-ran closed 10 years ago

ido-ran commented 10 years ago

I notice the compiler complain that there is unused variable name br in every DeserializeLengthDelimited method of every message class. The first line of every such method has this line: BinaryReader br = new BinaryReader(stream);

but this variable is really not every used. There is BinaryReader br1 = new BinaryReader(ms1); line deep inside the method - I'm not sure if it is related.

hultqvist commented 10 years ago

That line should only be generated if needed, I have not seen this before.

Can you give a .proto sample that cause this bug?