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
Compiler does no longer report local variable scope conflict #38377
Comments
afaik this is a new feature in C# 8.0, local function and lambda parameters can shadow outer names. |
If this is not documented in https://github.com/dotnet/csharplang/tree/master/proposals/csharp-8.0 then this is a (documentation) bug. |
I could reproduce this error only in the project collected on .NET Core 3.0 |
@Sliptory I think that's because it's a C# 8.0 feature and .Net Framework projects default to C# 7.3. |
@BillWagner You're right, there is no proposal document for this. The compiler/languages team has not made it a priority to maintain formal specs for the features we develop. As best I understand the current plan, we're depending on you to provide user docs for features. |
There is a placeholder for a specification for this at: https://github.com/dotnet/csharplang/blob/master/proposals/csharp-8.0/shadowing-in-nested-functions.md In short, this is by design. |
Version Used: 16.3 Preview 2
Steps to Reproduce:
I don't know if this is an expected new feature or not, i've noticed because it broke on the build server (having only 16.2.3 installed) and my .NET Framework project is set to Language version
Automatically selected based on framework version
(7.3).Sharplab
Expected Behavior:
Actual Behavior:
Compiles fine
The text was updated successfully, but these errors were encountered: