History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RSRP-50166
Type: Bug Bug
Status: Open Open
Priority: Normal Normal
Assignee: Sergey Shkredov
Reporter: Vladimir Reshetnikov
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
ReSharper

'Introduce variable' results in a bad code

Created: 29 Sep 07 12:11   Updated: 05 Feb 08 20:01
Component/s: Refactorings - Introduce Variable
Fix Version/s: Mirabilie Futurum
Security Level: Everybody (All jira users)

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 529


 Description  « Hide
class Stuff
{
    public Action Action
    {
        get { throw new NotImplementedException(); }
    }

    public static void Main()
    {
        (new Stuff().Action)();
    }
}

Select 'new Stuff()' and introduce variable 'stuff'. Result:

using System;

class Stuff
{
    public Action Action
    {
        get { throw new NotImplementedException(); }
    }

    public static void Main()
    {
        Stuff stuff = new Stuff();
        (stuff.Action)(); // error CS1525: Invalid expression term ')'
    }
}

Expected:

using System;

class Stuff
{
    public Action Action
    {
        get { throw new NotImplementedException(); }
    }

    public static void Main()
    {
        Stuff stuff = new Stuff();
        ((stuff).Action)(); // OK
    }
}


 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.