pizheng / protobuf-net

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

Inheritance does not work without surrogates #207

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. A simple inheritance with properties in the base type without surrogates.
2. Try compiling it in place (or serializing). In short get the serializer 
built.

What is the expected output? What do you see instead?
Compilation succeeds. However, it fails. The root cause is that the base type 
properties are collected in the same list with the field numbers of the derived 
types.

What version of the product are you using? On what operating system?
rev 424, but as far as I can see rev 436 does not fix it.

Please provide any additional information below.
Based on 
http://stackoverflow.com/questions/6739842/how-to-define-the-protobuf-net-model-
with-a-generic-base-class

Original issue reported on code.google.com by mark.kha...@gmail.com on 19 Jul 2011 at 4:54

GoogleCodeExporter commented 9 years ago
I mean the field numbers of the base type properties are in the same list with 
the field numbers of the derived types.

Original comment by mark.kha...@gmail.com on 19 Jul 2011 at 5:39

GoogleCodeExporter commented 9 years ago
(from SO post) Message=Duplicate field-number detected; 1 on: NC.DTO.Base`1

This is the correct message; this is as-per-design.

Original comment by marc.gravell on 19 Jul 2011 at 6:19