You've already forked linux-packaging-mono
Imported Upstream version 4.4.0.142
Former-commit-id: 08ca4d6ded648b2ac2eb817c12d5723b52edbb16
This commit is contained in:
@@ -507,11 +507,15 @@ namespace System.Runtime.Serialization
|
||||
} else {
|
||||
var typeHandleValue = Type.GetTypeHandle (memberValue);
|
||||
var isDeclaredType = typeHandleValue.Equals (CodeInterpreter.ConvertValue (memberValue, memberType, Globals.TypeOfObject));
|
||||
if (isNullableOfT)
|
||||
if (isNullableOfT) {
|
||||
ctx.InternalSerialize (writer, memberValue, isDeclaredType, writeXsiType, DataContract.GetId (memberType.TypeHandle), memberType.TypeHandle);
|
||||
else
|
||||
ctx.InternalSerializeReference (writer, memberValue, isDeclaredType, writeXsiType, DataContract.GetId (memberType.TypeHandle), memberType.TypeHandle);
|
||||
//InternalSerialize((isNullableOfT ? XmlFormatGeneratorStatics.InternalSerializeMethod : XmlFormatGeneratorStatics.InternalSerializeReferenceMethod), () => memberValue, memberType, writeXsiType);
|
||||
} else if (memberType == Globals.TypeOfObject) {
|
||||
var dataContract = DataContract.GetDataContract (memberValue.GetType());
|
||||
writer.WriteAttributeQualifiedName (Globals.XsiPrefix, DictionaryGlobals.XsiTypeLocalName, DictionaryGlobals.SchemaInstanceNamespace, dataContract.Name, dataContract.Namespace);
|
||||
ctx.InternalSerializeReference (writer, memberValue, false, false, -1, typeHandleValue);
|
||||
} else {
|
||||
ctx.InternalSerializeReference (writer, memberValue, isDeclaredType, writeXsiType, DataContract.GetId (memberType.TypeHandle), memberType.TypeHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -122,5 +122,17 @@ namespace MonoTests.System.Runtime.Serialization
|
||||
Assert.IsTrue (s.Contains ("<Flags>All</Flags>"));
|
||||
}
|
||||
}
|
||||
|
||||
// Bug #37116
|
||||
[Test]
|
||||
public void KeyPairOfAny ()
|
||||
{
|
||||
var dict = new Dictionary<string, object> ();
|
||||
dict.Add ("test", new List<string> () { "test entry" });
|
||||
|
||||
var dcs = new DataContractSerializer (typeof(Dictionary<string, object>));
|
||||
dcs.WriteObject (new MemoryStream (), dict);
|
||||
// Should not throw exception.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user