c# - False positive for CA1801 in Release config only -
my method reads follows.
public static void debug(this logger logger, string message) { logger.debug(() => message); }
when run code analysis debug config, no warning.
when run code analysis release config, get:
ca1801 review unused parameters parameter 'message' of 'commonextensions.debug(this logger, string)' never used. remove parameter or use in method body. fakeiteasy commonextensions.cs 101
and
ca1801 review unused parameters parameter 'logger' of 'commonextensions.debug(this logger, string)' never used. remove parameter or use in method body. fakeiteasy commonextensions.cs 101
this wrong. using both parameters in method body. if remove either of parameters code not compile.
has else experienced similar? have discovered bug in code analysis?
(i using same ruleset under both configurations.)
update
the logger.debug()
signature follows:
[conditional("debug")] public abstract void debug(func<string> message);
as per q update, logger.debug()
has conditional
attribute set , cause.
Comments
Post a Comment