Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 856
AvetisG Avatar asked Apr 15 '15 19:04

AvetisG


1 Answers

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?

like image 88
Kevin Sch Avatar answered Oct 20 '22 07:10

Kevin Sch