Uh oh!
There was an error while loading. Please reload this page.
Get the normal event accessors generated - #89441
Conversation
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.
ghost
commented
Jul 25, 2023
Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @sbomer, @joperezr, @marek-safar Issue DetailsBecause 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 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
|
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.CompareExchangeand 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.CompareExchangeapproach 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.