anerjan / protobuf-net

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

Inheritance and implementation together not supported #226

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
    [ProtoContract]
    [ProtoInclude(1, typeof(Simple))]
    interface ISimple
    { }

    [ProtoContract]
    [ProtoInclude(1, typeof(Simple))]
    class SimpleAbstract
    { }

    [ProtoContract]
    class Simple : SimpleAbstract, ISimple
    { }

    [ProtoContract]
    class UsesSimple
    {
        [ProtoMember(1)]
        ISimple somethingElse = new Simple();
    }

   UsesSimple usesSimple = new UsesSimple();
   MemoryStream memoryStream = new MemoryStream();
   ProtoBuf.Serializer.Serialize<UsesSimple>(memoryStream, usesSimple);
   memoryStream.Position = 0;
   object deserialized2 = ProtoBuf.Serializer.Deserialize<UsesSimple>(memoryStream);

What is the expected output? What do you see instead?
Deserialization should work.
Instead I get "A type can only participate in one inheritance hierarchy" 
exception. Interface is seen as baseClass.

What version of the product are you using? On what operating system?
rev 444

Please provide any additional information below.

Original issue reported on code.google.com by alexandr...@gmail.com on 2 Sep 2011 at 12:28