ReSharper
 
Get ReSharper
Get your hands on the new features ahead of the release by joining the Early Access Program for ReSharper 2025.1! Learn more

Code inspection: Parameter hides member

Last modified: 11 February 2024

There is not much wrong with the code example below, at least in its current state where you can observe everything at once. However, as the class would grow, someone who reads the code could mistakenly think that DoSomething() uses the property bar and not the parameter. Furthermore, if someone removes the parameter bar later, they may not notice that the remaining usages of bar will be returning the value of the property.

Therefore, ReSharper issues a warning to draw your attention to potential problems with this code and provides quick-fixes that help you quickly rename either the parameter or the property.