-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Clean up rd.xml now that DCS has been annotated #57013
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
|
Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @sbomer, @joperezr Issue DetailsFixes #52083 I tried running these tests locally now that DCS has been annotated to ensure that this annotation is fixing the issue: Lines 1401 to 1403 in 57bfe47
But I wasn't able to run the tests locally. Will use CI to validate that the test still passes.
|
|
@joperezr - the tests appear to be failing now. |
|
Yup, I noticed that, seems like we missed that specific annotation, my latest commit is adding it. |
...stem.Private.DataContractSerialization/src/System/Runtime/Serialization/ClassDataContract.cs
Outdated
Show resolved
Hide resolved
eerhardt
left a comment
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.
As long as its green. This looks great.
Thanks @joperezr.
|
For some reason CI status is not updating in the PR, but the jobs did get queued: https://dev.azure.com/dnceng/public/_build/results?buildId=1284257&view=results. I'll follow up with the results there and won't merge until it's green. |
...stem.Private.DataContractSerialization/src/System/Runtime/Serialization/ClassDataContract.cs
Outdated
Show resolved
Hide resolved
|
Hello @joperezr! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
| { | ||
| private static Type[]? s_serInfoCtorArgs; | ||
| private static readonly MethodInfo s_getKeyValuePairMethod = typeof(KeyValuePairAdapter<,>).GetMethod("GetKeyValuePair", Globals.ScanAllMembers)!; | ||
| private static readonly ConstructorInfo s_ctorGenericMethod = typeof(KeyValuePairAdapter<,>).GetConstructor(Globals.ScanAllMembers, new Type[] { typeof(KeyValuePair<,>).MakeGenericType(typeof(KeyValuePairAdapter<,>).GetGenericArguments()) })!; |
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.
@steveharter @GrabYourPitchforks @MichalStrehovsky - do any of you know an easier way to express this in reflection?
We are trying to find this constructor:
Lines 26 to 35 in 57bfe47
| internal sealed class KeyValuePairAdapter<K, T> : IKeyValuePairAdapter | |
| { | |
| private K _kvpKey; | |
| private T _kvpValue; | |
| public KeyValuePairAdapter(KeyValuePair<K, T> kvPair) | |
| { | |
| _kvpKey = kvPair.Key; | |
| _kvpValue = kvPair.Value; | |
| } |
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.
I'm not immediately aware of any other way to write this that might play well with trimming. There are some tricks you can pull to save intermediate allocations, but since this is being placed into a readonly static, I don't know how much it would save in practice.
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.
There's no better thing that I know of. There was a proposal somewhere to complement Type.MakeGenericMethodParameter(Int32) with another API that would work for type generic parameters, but that didn't materialize.
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.
Thanks for the verification.
Fixes #52083
I tried running these tests locally now that DCS has been annotated to ensure that this annotation is fixing the issue:
runtime/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ClassDataContract.cs
Lines 1401 to 1403 in 57bfe47
But I wasn't able to run the tests locally. Will use CI to validate that the test still passes.