dotnet/roslyn

Improve error message reported when attempting to declare `ref` field in a `ref struct`

Open

#37,597 opened on Jul 30, 2019

View on GitHub
 (0 comments) (0 reactions) (0 assignees)C# (4,257 forks)batch import
Area-CompilersBugConcept-Diagnostic ClarityLanguage-C#help wanted

Repository metrics

Stars
 (20,414 stars)
PR merge metrics
 (Avg merge 6d 17h) (256 merged PRs in 30d)

Description

image

Current error message:

image

Seems like the code is parsed as method declaration. It would be better to parse as field declaration and report error on ref keyword.

Contributor guide