[S.R.Serialization] fix nullable serialization to match referencesource codegen.
commit99a7c698f0742470ed76158a57a812c58fcfa877
authorAtsushi Eno <atsushieno@gmail.com>
Mon, 13 Apr 2015 18:20:37 +0000 (14 03:20 +0900)
committerAtsushi Eno <atsushieno@gmail.com>
Fri, 24 Apr 2015 05:36:53 +0000 (24 14:36 +0900)
tree73c3f02960159feeaf232f3146137f3d18a42200
parentf6d778c1486ae3e36dcca510e60ac4df3b3de13c
[S.R.Serialization] fix nullable serialization to match referencesource codegen.

The original code is complicated enough that I misinterpreted the logic...

The reulting code should look like this:

DateTime? expr_94 = timeSubmitted;
DateTime dateTime;
bool arg_B5_0;
if (XmlObjectSerializerWriteContext.GetHasValue<DateTime> (expr_94)) {
dateTime = XmlObjectSerializerWriteContext.GetNullableValue<DateTime> (expr_94);
arg_B5_0 = false;
}
else {
dateTime = XmlObjectSerializerWriteContext.GetDefaultValue<DateTime> ();
arg_B5_0 = true;
}

The fixed code should be like this now.
mcs/class/System.Runtime.Serialization/ReferenceSources/XmlFormatReaderGenerator_static.cs
mcs/class/System.Runtime.Serialization/ReferenceSources/XmlFormatWriterGenerator_static.cs