tags:

views:

44

answers:

0

If I have the following:

void Foo(Bar bar, Baz baz)
{
    // Do something with bar, but not with baz.
}

...then ReSharper warns me with "Parameter 'baz' is never used." and colours it grey. This is a useful hint that I might want to get rid of it.

On the other hand, if I have the following:

void Foo(Bar bar, Baz baz)
{
    Require.ArgumentNotNull(bar);
    Require.ArgumentNotNull(baz);

    // Some code that used to do something with bar and baz,
    // but has been changed to no longer use baz.
}

...then ReSharper thinks that 'baz' is used, and doesn't warn me. Is there a ReSharper annotation that I can use on ArgumentNotNull to tell ReSharper that this method doesn't really "use" the parameter, and to still issue the hint?

related questions