ReSharper 2025.1 Help

Code inspection: Prefer using concrete value over 'default' or 'new()'

This inspection identifies usages of the default literal or expression where you can explicitly provide a more meaningful or specific value. Using concrete values improves clarity and allows the intent of the code to be better understood.

public void InitValues(int count = default) { }
public void InitValues(int count = 0) { }

Specify values directly whenever possible to improve the readability of your code, especially when describing initialization, method parameters, or variable assignments.

Last modified: 20 March 2025