Resharper adding this. before enum values

I'm using Resharper 6 and I've got this enum and class:

public enum MyEnum
{
    Value1,
    Value2
}

public class Test
{
    public Test()
    {
        this.MyEnum = MyEnum.Value1;
    }

    public MyEnum MyEnum { get; set; }
}


If I then copy the Test class to another namespace and click on the popup over the MyEnum type on the property to add the using statement, I find that it has changed to

this.MyEnum = this.MyEnum.Value1;


Which doesn't even compile. Is resharper doing this? How can I get this to stop?

2 comments
Comment actions Permalink

Hello,

This seems to be a bug. You can track the progress here: http://youtrack.jetbrains.net/issue/RSRP-273927.
Meanwhile, you can use the 'Import types for pasted code' quick-fix after
pasting the Test class which works fine. Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

If I've got this enum and this class in Resharper 6.0:

public enum MyEnum
{
Value1,
Value2
}
public class Test
{
public Test()
{
this.MyEnum = MyEnum.Value1;
}
public MyEnum MyEnum { get; set; }
}
If I then copy the Test class to another namespace and click on the
popup over the MyEnum type on the property to add the using statement,
I find that it has changed to

this.MyEnum = this.MyEnum.Value1;

Which doesn't even compile. Is resharper doing this? How can I get
this to stop?

---
Original message URL:
http://devnet.jetbrains.net/message/5309437#5309437



0
Comment actions Permalink

Thanks for taking a look at it.

0

Please sign in to leave a comment.