Reporter |
|
---|---|
Created | Feb 17, 2010 4:43:15 PM |
Updated | Apr 7, 2018 9:31:52 AM |
Resolved | Apr 7, 2018 9:31:52 AM |
Subsystem | Refactorings |
Assignee | Alisa Afonina (alisa.afonina) |
Priority | Normal |
State | Obsolete |
Type | Feature |
Fix version | Backlog |
Affected versions | No Affected versions |
Fixed In Version ReSharper | Undefined |
VsVersion | All Versions |
From User on Twitter.
/*
If I go to [2] and call "extract parameter" on arg, call in [3] will break, instead of changing to new Bar().Baz(() = >MyAction(arg));
"extract parameter": the method no longer fits signature of the delegate. R# should wrap it in a lambda to compensate for that change IMO
public class Foo
{
private int arg = 1;
public void MyAction()
{
Console.WriterLine(arg); // [2]
}
public void UseBar()
{
new Bar().Baz(MyAction); // [3]
}
}
public class Bar
{
public void Baz(Action a)
{
}
}
/*
If I go to [2] and call "extract parameter" on arg, call in [3] will break, instead of changing to new Bar().Baz(() = >MyAction(arg));
"extract parameter": the method no longer fits signature of the delegate. R# should wrap it in a lambda to compensate for that change IMO
- /
public class Foo
{
private int arg = 1;
public void MyAction()
{
Console.WriterLine(arg); // [2]
}
public void UseBar()
{
new Bar().Baz(MyAction); // [3]
}
}
public class Bar
{
public void Baz(Action a)
{
}
}