Incorrect C# Error Reports
I'm using ReSharper 7.1.1000.900 on Visual Studio 2012 11.0.51106.1.
The following code fragment relates:
public delegate void ExcelAction();
.........public static void QueueAsMacro(ExcelAction action) { QueueAsMacro(delegate { action(); }, null); /// <<<<<< Problem Line } public static void QueueAsMacro(SendOrPostCallback callback, object state) { if (!SynchronizationManager.IsInstalled) throw new InvalidOperationException("SynchronizationManager is not registered."); SynchronizationManager.RunMacroSynchronization.RunAsMacroAsync(callback, state); }
ReSharper incorrectly identifies an error in the 'Problem Line': Method 'QueueAsMacro' has 1 parameter(s) but is invoked with 2 argument(s).
As a consequence, that method (the first instance) is also marked with a warning: Method 'QueueAsMacro' is never used. Function is recursive on all paths.
The code compiles and runs correctly.
Please sign in to leave a comment.