Uh oh!
There was an error while loading. Please reload this page.
Nullable annotations for System.Runtime.Serialization.Xml and System.Runtime.Serialization.Json - #41476
Conversation
Fix nullable errors in SchemaExporter.
Dotnet-GitSync-Bot
commented
Aug 27, 2020
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
eerhardt
commented
Aug 27, 2020
fyi - @HongGit@StephenMolloy - as the owners of this area. |
jozkee
commented
Aug 28, 2020
Unrelated to this PR: There is a file that doesn't even compile in System.Private.DataContractSerialization and is a duplicate of the homonymous named file |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| } | ||
| internal virtual XmlDictionaryString TopLevelElementName | ||
| internal virtual XmlDictionaryString? TopLevelElementName |
There was a problem hiding this comment.
How does [DisallowNull] work with overrides? This one is a bit tricky because the base class has:
classDataContract{XmlDictionaryString_name;// can't be nullpublicXmlDictionaryStringName{get{}set{_name=value;}}publicvirtualXmlDictionaryString?TopLevelElementName{get{return_name;}set{_name=value;}}}but then a derived class does:
classDerivedDataContract:DataContract{XmlDictionaryString?_topLevelName;// can be nullpublicoverrideXmlDictionaryString?TopLevelElementName{get{return_topLevelName;}set{_topLevelName=value;}}}And when trying to clone the objects, now we have a problem:
The getter can be null, but the setter doesn't allow for it.
Uh oh!
There was an error while loading. Please reload this page.
| } | ||
| public override void WriteXmlnsAttribute(string prefix, string ns) | ||
| public override void WriteXmlnsAttribute(string? prefix, string ns) |
There was a problem hiding this comment.
public override void WriteStartAttribute(string prefix, string localName) and overload might be worth filing a bug on NRE or at least TODO-NULLABLE
There was a problem hiding this comment.
The WriteStartAttribute methods are internal and are never called with null for prefix, so I left them as non-nullable and didn't change the code. But WriteXmlnsAttribute could be called with null, so that's why I fixed it here.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
krwq
left a comment
There was a problem hiding this comment.
LGTM after fixing/resolving comments
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
eerhardt
commented
Aug 28, 2020
I believe all current feedback has been addressed. I left a few conversations open with pending questions. Please let me know if you have any more feedback. I'd like to merge this by the EOD. |
Contributes to #2339
cc @jeffhandley@terrajobst