Skip to content

More updates for recent compiler changes for ref fields - #73883

Merged
AaronRobinsonMSFT merged 2 commits into
dotnet:mainfrom
cston:more-scoped
Aug 13, 2022
Merged

AaronRobinsonMSFT merged 2 commits into
dotnet:mainfrom
cston:more-scoped

Conversation

@cston

@cston cston commented Aug 13, 2022 •

Copy link
Copy Markdown
Contributor

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

ghost commented Aug 13, 2022

Copy link
Copy Markdown

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

cston commented Aug 13, 2022

Copy link
Copy Markdown
Contributor Author

cc @AaronRobinsonMSFT, @jaredpar

@hoyosjs

hoyosjs commented Aug 13, 2022

Copy link
Copy Markdown
Member

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
Copy Markdown
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

cston commented Aug 15, 2022 •

Copy link
Copy Markdown
Contributor Author

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