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?
Please sign in to leave a comment.
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!"
Thanks for taking a look at it.