We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Version Used: 16.6.4, SharpLab shows it on master
There's a lot of code out there like this:
using System.Linq; class C { void M() { // ❌ CS0103 The name '_' does not exist in the current context // ↓ Enumerable.Range(0, 1).Select(_ = _.ToString()); } }
This doesn't follow the spec in https://github.com/dotnet/csharplang/blob/master/proposals/lambda-discard-parameters.md#detailed-design:
Note: if a single parameter is named _ then it is a regular parameter for backwards compatibility reasons.
_
The text was updated successfully, but these errors were encountered:
CC: @jcouv This should be covered by the test plan #38820
that a single _ is not a discard parameter (ie. is in scope and can be read from) (see DiscardParameters_NotADiscardWhenSingleUnderscore)
DiscardParameters_NotADiscardWhenSingleUnderscore
Sorry, something went wrong.
I'm confused. There is no lambda in the example. Did you mean .Select(_ => _.ToString()) with a =>?
.Select(_ => _.ToString())
=>
Oh my, I'm so sorry! Wow 😆
jcouv
No branches or pull requests
Version Used: 16.6.4, SharpLab shows it on master
There's a lot of code out there like this:
This doesn't follow the spec in https://github.com/dotnet/csharplang/blob/master/proposals/lambda-discard-parameters.md#detailed-design:
The text was updated successfully, but these errors were encountered: