Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-190704: Need context action to move assignment out of object initializer

$
0
0
Reporter Valentin Kipiatkov (valentin) Valentin Kipiatkov (valentin)
Created Sep 9, 2010 10:23:43 PM
Updated Apr 7, 2018 3:06:04 PM
Resolved Apr 7, 2018 3:06:04 PM
Subsystem Context Actions
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Obsolete
Type Feature
Fix version Backlog
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
  Foo foo = new Foo{ Prop1 = Bar1(), Prop2 = Bar2() };

Sometimes it's necessary to move one of the initializers out. For example:

  Foo foo = new Foo{ Prop2 = Bar2() };
Prop1 = Bar1();

This can be needed, for example, to make property assignment conditional, or to extract object creation into separate method.

Viewing all articles
Browse latest Browse all 106942

Trending Articles