ReSharper
 
Get ReSharper
You are viewing the documentation for an earlier version of ReSharper.

Code Inspection: Access specifier does not change accessibility level

Last modified: 21 July 2022

This inspection notifies you about access specifiers that have no effect on the semantic of the program.

In the example below, the second and third public: would be grayed out because they follow the first public: without any other specifiers in between. So in effect you can remove them to improve readability without changing the meaning of your program.

Note that even the first access specifier could be redundant if there is the same access specifier in a macro expansion that precedes it.