Closed GoogleCodeExporter closed 8 years ago
Here is a test case
[ProtoContract]
public class RootClass
{
[ProtoMember(1)]
public int Prop1 { get; set; }
[ProtoMember(2)]
public string Prop2 { get; set; }
[ProtoMember(3)]
public IEnumerableClass Prop3 { get; set; }
}
[ProtoContract(IgnoreListHandling=true)]
public class IEnumerableClass :IEnumerable<char>
{
[ProtoMember(1)]
public int Prop1 { get; set; }
[ProtoMember(2)]
public string Prop2 { get; set; }
public IEnumerator<char> GetEnumerator()
{
throw new NotImplementedException();
}
// Comment out this indexed property to prevent the crash
public char this[int i] { get { return Prop2[i]; } }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
throw new NotImplementedException();
}
}
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
var rt = TypeModel.Create();
rt.Add(typeof(IEnumerableClass), true);
rt.Add(typeof(RootClass), true);
rt.Compile();
var c1 = new IEnumerableClass() { Prop1 = 1, Prop2 = "a"};
var i1 = new RootClass() { Prop1 = 1, Prop2 = "blabla", Prop3 =c1};
var cloned = rt.DeepClone(i1) as RootClass;
Assert.AreEqual(1, cloned.Prop3.Prop1);
}
}
Original comment by e...@apption.com
on 9 Aug 2012 at 4:31
Attachments:
This test passes when executed against the trunk (no new changes required).
Please retry on the current trunk, or r565 available at
http://code.google.com/p/protobuf-net/downloads/list
Marc
Original comment by marc.gravell
on 9 Aug 2012 at 7:28
Any chances you could publish r565 on nuget?
Original comment by e...@apption.com
on 9 Aug 2012 at 7:36
Well, I'd rather not - but I guess I could publish it but leave r480 the
default while I tie up something relating to `DynamicType`... would that
suffice?
Original comment by marc.gravell
on 9 Aug 2012 at 7:37
that would be great! What about publishing r565 as prerelease? It seems as
simple as adding a -rc at the end of the version number.
http://docs.nuget.org/docs/Reference/Versioning
Original comment by e...@apption.com
on 9 Aug 2012 at 7:58
Er, yeah... see:
http://stackoverflow.com/questions/11891401/is-pre-release-versioning-possible-i
n-nuget
Original comment by marc.gravell
on 9 Aug 2012 at 8:28
It is there now; it isn't default, so you'll need to use:
PM> Install-Package protobuf-net -Version 2.0.0.569
Original comment by marc.gravell
on 9 Aug 2012 at 8:45
Original issue reported on code.google.com by
e...@apption.com
on 8 Aug 2012 at 8:59