Project
ReSharper
Priority
Show-stopper
Type
Bug
Fix versions
2.5.2, 3.0
State
Fixed
Assignee
Evgeny Pasynkov
Subsystem
No subsystem
Affected versions
No Affected versions
Fixed in build
No Fixed in build
  • Created by   Ilya Ryzhenkov
    4 years ago (03 Apr 2007 02:44)
  • Updated by   Ilya Ryzhenkov
    4 years ago (03 Apr 2007 16:41)
  • Jira: RSRP-38316
    (history, comments)
 
RSRP-38316 Unused parameter analysis should take delegates into account
0
Issue is visible to: All Users
  The issue is visible to the selected user group only
The following code incorrectly shows 'sender' and 'e' as unused. If you remove any of these parameters, code won't compile.
    private void DoSomething(object sender, EventArgs e)
    {
      if (InvokeRequired)
      {
        Invoke(new EventHandler(DoSomething), new object[] {this, new object()});
      }
      else
      {
        
      }
    }



Issue was closed
Comments (1)
 
History
 
Linked Issues (?)
 
TeamCity Changes (0)
 
Ilya Ryzhenkov
  Ilya Ryzhenkov
03 Apr 2007 02:57
4 years ago
Note, that removing unused parameter, which makes "new EventHandler()" valid, shouldn't suppress unused parameter warning.
E.g. if DoSomething were declared as
private void DoSomething(object sender, EventArgs e, int unusedParam)
and referenced as new EventHandler(DoSomething), then unusedParam should be marked as unused, so it is easy to remove it.

This is required for RTL programming style.