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

Code generator respects scoped usage by language version #8370

Merged
merged 1 commit into from
Apr 11, 2023

Conversation

jsteinich
Copy link
Contributor

@jsteinich jsteinich commented Apr 4, 2023

The scoped keyword was added in C# 11. Prior to this change, attempting to run the code generator on projects < C# 11 would result in errors. Now, the scoped keyword is omitted when targeting < C# 11.

Microsoft Reviewers: Open in CodeFlow

@jsteinich
Copy link
Contributor Author

jsteinich commented Apr 4, 2023

The generation will still result in warnings as the scoped usage doesn't match. dotnet/roslyn#63656 provides more details on why that is the case.

There is still an issue with the following targets:

<TargetFramework>net7.0</TargetFramework>
<LangVersion>9</LangVersion>

The scoped keyword is correctly omitted; however, a compile error is generated. It seems like that may be a bug in the compiler, but I need to confirm that (dotnet/roslyn#67638)

@ReubenBond ReubenBond merged commit e0bb170 into dotnet:main Apr 11, 2023
@ReubenBond
Copy link
Member

Thank you for looking into this, @jsteinich!

@github-actions github-actions bot locked and limited conversation to collaborators Dec 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants