Skip to content

Fold System.Private.Reflection.Core into CoreLib#70545

Merged
jkotas merged 4 commits into
dotnet:mainfrom
jkotas:System.Private.Reflection.Core
Jun 12, 2022
Merged

Fold System.Private.Reflection.Core into CoreLib#70545
jkotas merged 4 commits into
dotnet:mainfrom
jkotas:System.Private.Reflection.Core

Conversation

@jkotas

@jkotas jkotas commented Jun 10, 2022

Copy link
Copy Markdown
Member

No description provided.

@jkotas
jkotas requested a review from MichalStrehovsky as a code owner June 10, 2022 05:45
@ghost ghost assigned jkotas Jun 10, 2022
@ghost

ghost commented Jun 10, 2022

Copy link
Copy Markdown

Tagging subscribers to this area: @dotnet/area-system-reflection
See info in area-owners.md if you want to be subscribed.

Issue Details

null

Author: jkotas
Assignees: jkotas
Labels:

area-System.Reflection

Milestone: -

@MichalStrehovsky MichalStrehovsky left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread src/libraries/System.Private.CoreLib/src/Resources/Strings.resx Outdated
Comment thread src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets Outdated
@MichalStrehovsky

Copy link
Copy Markdown
Member

The warning that is failing the build is dotnet/linker#2790.

It complains that we're creating a delegate to a method with annotations. Trimming cannot enforce the delegate will be always called from places that are analyzable.

A good fix might be to just remove the annotations on the method and add a warning suppression instead (it's going to warn that we call GetUninitializedObject). It's always safe to call GetUninitializedObject on an underlying type of a nullable. We also have a test for that being added in #70201 (TestVTableOfNullableUnderlyingTypes).

@MichalStrehovsky

Copy link
Copy Markdown
Member
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2072:UnrecognizedReflectionPattern",
            Justification = "Constructed MethodTable of a Nullable forces a constructed MethodTable of the element type")]

Is the suppression we have on GetUninitializedObject that will probably suppress the right thing here.

@jkotas

jkotas commented Jun 12, 2022

Copy link
Copy Markdown
Member Author

Failure is #70626

@jkotas
jkotas merged commit b15ffe5 into dotnet:main Jun 12, 2022
@jkotas
jkotas deleted the System.Private.Reflection.Core branch June 12, 2022 16:03
@ghost ghost locked as resolved and limited conversation to collaborators Jul 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants