Project
ReSharper
Priority
Critical
Type
Bug
Fix versions
6.1
State
Fixed
Assignee
Sergey Shkredov
Subsystem
Refactorings
Affected versions
No Affected versions
Fixed in build
6.1.0.8191  
  • Created by   Yuri Astrakhan
    3 years ago (18 Feb 2009 03:25)
  • Updated by   Sergey Shkredov
    7 months ago (11 Oct 2011 19:26)
  • Jira: RSRP-95969
    (history, comments)
 
RSRP-95969 Code lost on method inlining
1
Issue is visible to: All Users
  The issue is visible to the selected user group only
public class Counter
{
    public int Count;
}

public static class ExtBug
{
    public static void Empty(this Counter val)
    {}

    public static Counter Action(this Counter val)
    {
        val.Count++;
        return val;
    }

    public static void Test(Counter val)
    {
        val.Action().Empty();
    }
}


Inlining and removing of the Empty() method deletes the content of the Test() method, even though there is clearly an action being performed on the object.
Comments (3)
 
History
 
Linked Issues (?)
 
TeamCity Changes (0)
 
Yuri Astrakhan
  Yuri Astrakhan
08 Jul 2011 18:51
10 months ago
Shouldn't this have a higher priority than normal? The user might not even notice that code diapered, creating very hard to find bugs.
Alex Martsynkevich
  Alex Martsynkevich
08 Jul 2011 18:57
10 months ago
Yap, encountered the same thing.
Sergey Shkredov
  Sergey Shkredov
08 Jul 2011 19:42
10 months ago
Ok. Will try to fix it for 6.1.
Related Changes
Priority
NormalCritical
Fix versions
6.1