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

Code Inspection: Explicit delegate creation expression is redundant

Last modified: 21 March 2024

Redundant delegate constructor calls may occur, for example, as a result of adding event handlers:

Below, the type of a delegate variable ValueChanged can be inferred from its declaration. To make code shorter, JetBrains Rider suggests removing a redundant explicit delegate’s constructor call: