Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Get the normal event accessors generated #89441

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

Merged

Conversation

mrvoorhe
Copy link
Contributor

Because System.Threading.dll was not referenced, this led to Roslyn generating the Delegate.Combine based accessor which does not have any locals. https://github.com/dotnet/roslyn/blob/520e2f10078ab0e5f85c78fdd95d786d78b9676a/src/Compilers/CSharp/Portable/Compiler/MethodBodySynthesizer.cs#L323-L520

In our UnityLinker test framework we have 2 cases currently. Mono, which will reference mscorlib.dll, and Roslyn will find System.Threading.Interlocked.CompareExchange and use the normal approach.

And currently I have our coreclr tests referencing System.Threading.dll for no great reason. This is how I stumbled on this.

While this change isn't strictly necessary, I think it's better to have coverage on the System.Threading.Interlocked.CompareExchange approach because that's what would normally be generated. It's also the more complex case for the linker to handle since it has to clear the locals.

Because System.Threading.dll was not referenced, this led to Roslyn generating the Delegate.Combine based accessor which does not have any locals.  https://github.com/dotnet/roslyn/blob/520e2f10078ab0e5f85c78fdd95d786d78b9676a/src/Compilers/CSharp/Portable/Compiler/MethodBodySynthesizer.cs#L323-L520

In our UnityLinker test framework we have 2 cases currently.  Mono, which will reference mscorlib.dll, and Roslyn will find `System.Threading.Interlocked.CompareExchange` and use the normal approach.

And currently I have our coreclr tests referencing System.Threading.dll for no great reason.  This is how I stumbled on this.

While this change isn't strictly necessary, I think it's better to have coverage on the `System.Threading.Interlocked.CompareExchange` approach because that's what would normally be generated.  It's also the more complex case for the linker to handle since it has to clear the locals.
@mrvoorhe mrvoorhe requested a review from marek-safar as a code owner July 25, 2023 14:31
@ghost ghost added needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners linkable-framework Issues associated with delivering a linker friendly framework community-contribution Indicates that the PR has been added by a community member labels Jul 25, 2023
@ghost
Copy link

ghost commented Jul 25, 2023

Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @sbomer, @joperezr, @marek-safar
See info in area-owners.md if you want to be subscribed.

Issue Details

Because System.Threading.dll was not referenced, this led to Roslyn generating the Delegate.Combine based accessor which does not have any locals. https://github.com/dotnet/roslyn/blob/520e2f10078ab0e5f85c78fdd95d786d78b9676a/src/Compilers/CSharp/Portable/Compiler/MethodBodySynthesizer.cs#L323-L520

In our UnityLinker test framework we have 2 cases currently. Mono, which will reference mscorlib.dll, and Roslyn will find System.Threading.Interlocked.CompareExchange and use the normal approach.

And currently I have our coreclr tests referencing System.Threading.dll for no great reason. This is how I stumbled on this.

While this change isn't strictly necessary, I think it's better to have coverage on the System.Threading.Interlocked.CompareExchange approach because that's what would normally be generated. It's also the more complex case for the linker to handle since it has to clear the locals.

Author: mrvoorhe
Assignees: -
Labels:

linkable-framework, needs-area-label

Milestone: -

@teo-tsirpanis teo-tsirpanis removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jul 25, 2023
@vitek-karas vitek-karas merged commit e7984e4 into dotnet:main Jul 25, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community-contribution Indicates that the PR has been added by a community member linkable-framework Issues associated with delivering a linker friendly framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants