A possible Resharper Bug or am I just missing something subtle?

221 Views Asked by At

Here you can see how ReSharper is suggesting a change

enter image description here

Now here you can see how Resharper is changing up the code but the result is not correct because it is newing up a class, assigning a value to a property on it and then returning a totally new instance of that class that doesn't have the value assigned to it.

enter image description here

I had cursor on the new keyword. Pressed Alt+Enter and chose the option called "use object initializer".

Is this a possible bug in ReSharper or am I just missing something here?

1

There are 1 best solutions below

0
Kevin Sch On

It seems that it is not looking correctly. It should look like:

return new FlightRetrievalResponese
{
   test = "this is a test"
};

What is your R# version?