dotnet/roslyn

need a better error message for invalid lambda capturing of ref-like types

Open

#22,058 opened on Sep 11, 2017

View on GitHub
 (0 comments) (0 reactions) (0 assignees)C# (20,414 stars) (4,257 forks)batch import
Area-CompilersBugConcept-Diagnostic ClarityFeature - Readonly ReferencesLanguage-C#help wanted

Description

See the use of ERR_AnonDelegateCantUseLocal

We are reusing the same errors for ref variables and for ref-like values. In the second case it could be confusing, although coming up with a better error is not easy. It should not at least say "ref" - that is not a problem here, probably "ref-like types"

Contributor guide

need a better error message for invalid lambda capturing of ref-like types · dotnet/roslyn#22058 | Good First Issue