Open
Description
According to the SA1206 documentation, keywords should appear in the following order:
- Access modifiers
static
- All other keywords
However, when using the required
keyword, the analyzer incorrectly reports a warning:
public sealed class Foo
{
public required string Bar { get; set; }
}
// Warning: "The 'required' modifier should appear before 'public'"
This behavior seems inconsistent with the documented ordering rules. The required keyword should fall under "All other keywords," appearing after the access modifier.
Could you please clarify whether this is an issue in the analyzer or a documentation gap regarding the ordering of required
?
Metadata
Metadata
Assignees
Labels
No labels