Skip to content

Conversation

@cston
Copy link
Contributor

@cston cston commented Aug 13, 2022

Updates to compile with the latest C# compiler.

Compiles cleanly from the root with build -rc Release - with the exception of tools/dotnet-pgo which fails to compile since it still references .NET preview 5 SDK.

@ghost
Copy link

ghost commented Aug 13, 2022

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@cston
Copy link
Contributor Author

cston commented Aug 13, 2022

cc @AaronRobinsonMSFT, @jaredpar

@hoyosjs
Copy link
Member

hoyosjs commented Aug 13, 2022

Failure is #69125/#73621

@AaronRobinsonMSFT AaronRobinsonMSFT merged commit f6d2d09 into dotnet:main Aug 13, 2022
@cston cston deleted the more-scoped branch August 13, 2022 14:40
@MichalStrehovsky
Copy link
Member

Just to double-check: is scoped a known breaking change to the language? Looking at the history, we haven't made meaningful changes to DispatchEx that is being modified here for years.

@cston
Copy link
Contributor Author

cston commented Aug 15, 2022

The breaking change with the C#11 compiler is: when compiling with .NET 7.0 or -langversion:11, a ref struct instance or ref or out parameter is assumed to capture unscoped references (either unscoped parameters passed by reference or ref fields from ref struct parameters).

To work around the breaking change, the frameIter parameter in DispatchEx() was marked as scoped to indicate that it is not captured.

@ghost ghost locked as resolved and limited conversation to collaborators Sep 14, 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.

5 participants