Inspectopedia
 
2024.3

Pattern variable hides field

Warning
New
Last modified: 03 December 2024

Reports pattern variables named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the pattern variable when using the identically named field is intended.

A quick-fix is suggested to rename the variable.

Example:

New in 2022.2