dotnet / csharpstandard

Working space for ECMA-TC49-TG2, the C# standard committee.
Creative Commons Attribution 4.0 International
713 stars 84 forks source link

Prohibiting Duplicate Modifiers #594

Open RexJaeschke opened 2 years ago

RexJaeschke commented 2 years ago

While discussing PR #215, “private protected access modifier,” on the June 2022 TG2 call, @gafter mentioned that prose that disallows duplicate modifiers was missing in some contexts. And rather than adding it to those “missing” places, perhaps we could make a single, general statement re that instead.

The prohibition on having duplicate modifiers is handled in the following ways:

All grammar rules containing modifiers use one of the above approaches.

Three rules (property/event/indexer declarations) use the “implicitly in prose” approach, so if that approach is deemed insufficient, we can add words to them. Otherwise, I don’t see any changes are needed.

Nigel-Ecma commented 2 years ago

I think this is now covered in #215 by the changes to writing “permitted kinds of declared accessibility” and the wording of §7.5.2 Declared accessibility

jskeet commented 2 years ago

We're not sure whether we want to do this or not, but we'll leave it open as a reminder to try it some time and see if the result feels cleaner.

jskeet commented 1 year ago

Pre-meeting evaluation: just remove the "meeting-discuss" label for now, and revisit after we've finished the C# 7 features?

jskeet commented 1 year ago

Yup: low priority, but shouldn't just be closed.