-
Notifications
You must be signed in to change notification settings - Fork 5.1k
DCS work nicely with collectible AssemblyLoadContext #90437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
...es/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ContextAware.cs
Show resolved
Hide resolved
} | ||
|
||
public DataContract? GetItem(int index) => _contracts[index].strong ?? (_contracts[index].weak?.TryGetTarget(out DataContract? ret) == true ? ret : null); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's only a style thing, but did you consider having providing an indexer property instead of switching to Get and Set methods?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sort of an evolution of the context-aware side of the design that got away from the original usage pattern. An indexer would fit the original code. But the nullable notation of the original code was incorrect, even if our code was dilligent about null-checking. Maybe I've still got Monday brain, but I don't know of a way to make the getter nullable and the setter non-nullable... notation-wise anyway.
...es/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ContextAware.cs
Show resolved
Hide resolved
The only change that needs to happen is move the second check inside of the locks then this is good to merge. |
…unning the 'create' delegate. Docs suggest this is intentional and will remain the case.
This replaces the draft PR (#88791) that I was using earlier. The pre-requisite changes that were staged in the first few commits of that draft got checked in under their own PR with proper contributor attribution (#73893), so this PR cherry-picks the rest of that draft and then addresses the feedback.
Fixes #77877