Skip to content

Commit 912ae46

Browse files
authored
Clarify top-level access modifiers (#41871)
Fixes #41870. One statement on `file` access stated correctly that `file` access is only allowed on top-level types. Another statement didn't include that note.
1 parent 2dce098 commit 912ae46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/csharp/programming-guide/classes-and-structs/access-modifiers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ When one declaration of a [partial class or partial method](./partial-classes-an
4141

4242
## Class and struct accessibility
4343

44-
Classes and structs declared directly within a namespace (aren't nested within other classes or structs) can be either `public` or `internal`. `internal` is the default if no access modifier is specified.
44+
Classes and structs declared directly within a namespace (aren't nested within other classes or structs) can have `public`, `internal` or `file` access. `internal` is the default if no access modifier is specified.
4545

4646
Struct members, including nested classes and structs, can be declared `public`, `internal`, or `private`. Class members, including nested classes and structs, can be `public`, `protected internal`, `protected`, `internal`, `private protected`, or `private`. Class and struct members, including nested classes and structs, have `private` access by default.
4747

0 commit comments

Comments
 (0)