resharper not recognizing out type variable in method parameters

I'm calling a BeginInvoke()

method on a delegate and resharper doesn't recognize one of the argument parameters of the method as being a 'out int' type.

"out dummy" is underscored with a red squiggly line and resharper says "argument is out while parameter is declared as value"

I know this isn't correct I've looked at the method paramters in the MS documentation and my syntax looks correct I even tried to remove out and compile and the build shows errors.

Is this a resharper bug or am I missing something?

 

int dummy;

r = c.BeginInvoke(id,cache,list,range,visit, out dummy, new AsyncCallback(WithdrawFinished), null);

0
4 comments
Avatar
Andrey Serebryansky

Hello Chuck,

Could you please attach a small sample solution demonstrating this error?
Also, which version of ReSharper are you using? Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

I'm calling a BeginInvoke()
method on a delegate and resharper doesn't recognize one of the
argument parameters of the method as being a 'out int' type.
"out dummy" is underscored with a red squiggly line and resharper says
"argument is out while parameter is declared as value"
I know this isn't correct I've looked at the method paramters in the
MS documentation and my syntax looks correct I even tried to remove
out and compile and the build shows errors.

Is this a resharper bug or am I missing something?

int dummy;
r = c.BeginInvoke(id,cache,list,range,visit, out dummy, new
AsyncCallback(WithdrawFinished), null);
---
Original message URL:
http://devnet.jetbrains.net/message/5366675#5366675



0

Hi.

Here is a class that can be pasted into a new project. This class will generate the 'out' type warning.

This class generated the warning on a Win 7 x32 and a Win XP x32 using the latest version of Resharper 6.0 I think. It's not the dev/EAP release.


public class Example

{

private ExampleCaller caller;

private delegate string ExampleCaller(out int threadId);

public Example()

{

int dummy;

caller.BeginInvoke(

out dummy, new AsyncCallback(ExampleCallBack), null);

}

private void ExampleCallBack(IAsyncResult ar)

{

Console.WriteLine(@"nope");

}

}

0

Looks like this is fixed in the EAP, which only generates two warnings:

  1. Field 'caller' is never assigned;
  2. Redundant explicit delegate creation;
0
Avatar
Andrey Serebryansky

Hello Chuck,

Yes, this problem should be fixed in ReSharper 6.1 EAP. Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hi.

Here is a class that can be pasted into a new project. This class will
generate the 'out' type warning.

This class generated the warning on a Win 7 x32 and a Win XP x32.

public class Example
{
private ExampleCaller caller;

private delegate string ExampleCaller(out int threadId);

public Example(){

int dummy;caller.BeginInvoke(

out dummy, new AsyncCallback(ExampleCallBack), null);}

private void ExampleCallBack(IAsyncResult ar){

Console.WriteLine(@"nope");}
}
---
Original message URL:
http://devnet.jetbrains.net/message/5390748#5390748



0

Please sign in to leave a comment.