Skip to content
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

Ensure static constructor is reflection-callable when NonPublicConstructors were kept #103946

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

MichalStrehovsky
Copy link
Member

This ensures that whenever we've seen the static constructor was reflection-accessed, we make sure it's runnable with RunClassConstructor.

This previously required some acrobatics because the static constructor itself could be reflection blocked and we might have still needed to RunClassConstructor the type with such constructor (notably the SR class preinitializes random ResourceManager related types to avoid recursion). Redoing everything to simply use the reflectable static constructor method as a marker.

Cc @dotnet/ilc-contrib

…uctors were kept

This ensures that whenever we've seen the static constructor was reflection-accessed, we make sure it's runnable with RunClassConstructor.

This previously required some acrobatics because the static constructor itself could be reflection blocked and we might have still needed to RunClassConstructor the type with such constructor (notably the SR class preinitializes random ResourceManager related types to avoid recursion). Redo everything to simply use the reflectable static constructor method as a marker.
Copy link
Contributor

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thanks

@jkotas jkotas merged commit aeb07f7 into dotnet:main Jun 26, 2024
91 of 93 checks passed
@MichalStrehovsky MichalStrehovsky deleted the keepcctor branch June 26, 2024 04:07
@github-actions github-actions bot locked and limited conversation to collaborators Jul 26, 2024
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