History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RSRP-38316
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Eugene Pasynkov
Reporter: Ilya Ryzhenkov
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ReSharper

Unused parameter analysis should take delegates into account

Created: 03 Apr 07 01:44   Updated: 03 Apr 07 15:41
Component/s: None
Fix Version/s: 3.0, 2.5.2
Security Level: Everybody (All jira users)

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Fixed in build: 412


 Description  « Hide
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
      {
        
      }
    }


 All   Comments   Work Log   Change History      Sort Order:
Ilya Ryzhenkov - 03 Apr 07 01:57
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.