docs
docs copied to clipboard
File modifier is not an accessibility modifier
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
filemodifier is not classified as an accessibility modifier. No accessibility modifiers can be used in combination withfileon a type.fileis treated as an independent concept from accessibility. Since file-local types can't be nested, only the default accessibilityinternalis usable withfiletypes.
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.
- ID: 8121f526-cfe4-091d-d031-2cdc274cd8ee
- Version Independent ID: 76a389f6-b568-3568-6483-6df440f96f0c
- Platform ID: abc641cd-a47f-c2ed-bec7-4e653b0f3fb6
- Content: Access Modifiers - C#
- Content Source: docs/csharp/programming-guide/classes-and-structs/access-modifiers.md
- Service: dotnet-csharp
- Sub-service: fundamentals
- GitHub Login: @BillWagner
- Microsoft Alias: wiwagn