evgenekov / protobuf-csharp-port

Automatically exported from code.google.com/p/protobuf-csharp-port
Other
0 stars 0 forks source link

Protogen generates cs code visual studio failes to compile #66

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Build  a single .proto file with a large number of messages in ( 700+)
2. feed .proto file to protogen
3. Compile generated .cs files

What is the expected output? 
generated .NET assembly

What do you see instead?
"CSC : fatal error CS1647: An expression is too long or complex to compile"

What version of the product are you using? On what operating system?
protobuf-csharp-port-2_4_1_473

Please provide any additional information below.
See a proposed patch on current trunk attached.

The issue is how descriptorData is build in generated code: via concatenation 
of string chunks using "+" operator, this makes target compiler unhappy when 
number of "+" exceeds some amount. 
Similar issue is reported at 
http://social.msdn.microsoft.com/Forums/en-US/a1bfd8b7-6222-4ae1-b7aa-5e45dd6f9a
06/bug-in-wcf-ds-51-rc2-problem-with-large-models 

Using an explicit String.Contact is proposed instead.

Original issue reported on code.google.com by Sergey.G...@gmail.com on 18 Sep 2013 at 3:09

GoogleCodeExporter commented 9 years ago
Thanks for the report. I haven't checked the code in question, but I wouldn't 
expect it would be too hard to fix. I'll see what I can do.

Original comment by jonathan.skeet on 18 Sep 2013 at 3:23

GoogleCodeExporter commented 9 years ago

Original comment by jonathan.skeet on 18 Sep 2013 at 3:24

GoogleCodeExporter commented 9 years ago
Hi Jonathan,
for some reason a patch seems to be missing in initial report.
Making a second attempt to attach it....

Original comment by Sergey.G...@gmail.com on 19 Sep 2013 at 7:20

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed in revision e68b82d490bb, revision 4ca97afd2eb3 and revision 83bc9fb7fb05.
Note that this will be slightly less efficient at execution time, but only in a 
static initializer.

Original comment by jonathan.skeet on 24 Sep 2013 at 6:05