Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-137558: "Convert lambda to anonymouse method" works incorrectly with out parameters

$
0
0
Reporter Valentin Kipiatkov (valentin) Valentin Kipiatkov (valentin)
Created Dec 1, 2009 9:24:39 PM
Updated Apr 6, 2018 6:14:05 PM
Resolved Apr 6, 2018 6:14:05 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Critical
State Obsolete
Type Bug
Fix version Backlog
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
Exmple 1.

    delegate object Handler(out int a);
void Foo(Handler h){}
void Bar()
{
Foo((out int i) => "");
}

(code is not compilable - out parameter is not assigned but that's exactly the reason why I want to convert to the anonymous method)

convert to anonymouse method:

    delegate object Handler(out int a);
void Foo(Handler h){}
void Bar()
{
Foo(delegate { return ""; });
}

Code is not compilable because delegate signature is not inserted.

Example 2.

    delegate object Handler(out int a);
void Foo(Handler h){}
void Bar()
{
Foo((out int i) =>
{
i = 0;
return "";
});
}

result:

    delegate object Handler(out int a);
void Foo(Handler h){}
void Bar()
{
Foo(delegate(int i)
{
i = 0;
return "";
});
}

  • still not compilable.

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>