docs icon indicating copy to clipboard operation
docs copied to clipboard

File modifier is not an accessibility modifier

Open RikkiGibson opened this issue 3 months ago • 1 comments

Describe the issue or suggestion

Follow up to #40446.

It looks like the docs have incorrectly included file in the list of accessibility modifiers.

https://github.com/dotnet/csharplang/blob/main/proposals/csharp-11.0/file-local-types.md#accessibility

The file modifier is not classified as an accessibility modifier. No accessibility modifiers can be used in combination with file on a type. file is treated as an independent concept from accessibility. Since file-local types can't be nested, only the default accessibility internal is usable with file types.

This was a case where we specifically blocked accessibility modifiers, because we wanted to leave space to potentially combine file declarations with accessibility modifiers in the future, especially when permitting the file modifier on more kinds of declarations.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.


Associated WorkItem - 510151

RikkiGibson avatar Sep 02 '25 23:09 RikkiGibson