Status: New
Owner: [email protected]
Labels: Type-Defect Priority-Medium
New issue 204 by paul.hounshell: Message Field Inheritance
http://code.google.com/p/protobuf/issues/detail?id=204
Enhancement Request
- What steps will reproduce the problem?
message A {
optional int32 field_a = 1;
}
message B {
optional int32 field_b = 2;
}
message C : A, B {
optional int32 field_c = 3;
}
message D : C {
optional int32 field_d = 4;
}
- What is the expected output? What do you see instead?
Output identical to...
message A {
optional int32 field_a = 1;
}
message B {
optional int32 field_b = 2;
}
message C {
optional int32 field_a = 1;
optional int32 field_b = 2;
optional int32 field_c = 3;
}
message D {
optional int32 field_a = 1;
optional int32 field_b = 2;
optional int32 field_c = 3;
optional int32 field_d = 4;
}
- What version of the product are you using? On what operating system?
2.3.0 / Windows
- Please provide any additional information below.
I would not expect the generated objects to actually be inherited. This is
purely a copy of fields from one message to the next. This could be
written today, but would require significant amounts of copy/paste
duplication, resulting in a high likelihood of bugs.
If there is any overlap in the names of positions of inherited fields then
the compiler should throw an error.
--
You received this message because you are subscribed to the Google Groups "Protocol
Buffers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/protobuf?hl=en.