|
Project
|
ReSharper
|
|
Priority
|
Normal |
|
Type
|
Bug |
|
Fix versions
|
4.1 |
|
State
|
Fixed |
|
Assignee
|
Sergey Shkredov |
|
Subsystem
|
No subsystem |
|
Affected versions
|
No Affected versions |
|
Fixed in build
|
class ConvertToAutomaticPropertyTest
{
public ConvertToAutomaticPropertyTest(bool testInitialValue)
{
mTest = testInitialValue; // <- note the explicit initialization of the backing field
}
public ConvertToAutomaticPropertyTest()
{
}
private bool mTest = true;
public bool TestProperty
{
get { return mTest; }
set { mTest = value; }
}
}
class ConvertToAutomaticPropertyTest
{
public ConvertToAutomaticPropertyTest(bool testInitialValue)
{
TestProperty = testInitialValue; // Resharper correctly changed mTest to TestProperty here
TestProperty = true; // <- BUT: the initialization is overwritten!
}
public ConvertToAutomaticPropertyTest()
{
TestProperty = true; //<- correct!
}
public bool TestProperty { get; set; }
}