ebceu4 / protobuf-csharp-port

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

Class cannot be static and sealed error #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The generated class for the attached .proto file has errors when compiling
the project:

"Eine Klasse kann nicht gleichzeitig statisch und versiegelt sein."
which means: A class cannot be static and sealed at the same time.

When I fix this there are more errors.

Original issue reported on code.google.com by shuku...@gmail.com on 9 May 2010 at 12:34

Attachments:

GoogleCodeExporter commented 9 years ago
This happens if you name your proto object the same as the file.
I don't think they tell you thats a req anywhere but I found out the hard way.

Original comment by benmcc...@yahoo.com on 4 Oct 2010 at 6:07

GoogleCodeExporter commented 9 years ago
Thanks - that does seem like something we should either work around or avoid 
heavily.

I *suspect* you can fix it for the moment by changing the "umbrella" class name 
with an option, but I'll give it a try myself when I get the chance.

Original comment by jonathan.skeet on 4 Oct 2010 at 6:31

GoogleCodeExporter commented 9 years ago
An alternative workaround is to rename the .proto file. So rather than having a 
message Parameter declared in Parameter.proto it's not declared in 
Parameters.proto. Not ideal, especially when I'm trying to integrate against an 
external codebase.

I'll see if I can find someone clever to explain what I should be doing:-)

Original comment by goo...@pete23.com on 5 May 2011 at 4:39

GoogleCodeExporter commented 9 years ago
Fixed in 2.3.x, the file descriptor class will be placed into a namespace if it 
collides with a type name being generated.

Original comment by Grig...@gmail.com on 19 May 2011 at 10:55