BUG: catch clause and Extract Method refactoring


Hello,

Sample code to reproduce:
Before extract method:
if (1 == 1)
{
try
{
return 1 == 0;
}
catch (Exception e)
{
return e.Message == "aaa";
}
}
After Extract method:

if (!Test(e)) return false;
...
private static bool Test(Exception e)
{
if (1 == 1)
{
try
{
return 1 == 0;
}
catch (Exception e)
{
return e.Message == "aaa";
}
}
return true;
}

Code obviously is wrong and not compiles.

Igor




Please sign in to leave a comment.