Bug Report T443163
Visible to All Users

'Declare local' refactoring should request a list of constructors

created 8 years ago

[DevExpress Support Team: CLONED FROM T442924: 'Declare local' refactoring does not new-up the object]
I seem to recall that CodeRush Classic instantiated objects/lists when using the 'Declare local' refactoring. With Coderush for Roslyn, declared objects are cast to a type, but are left null.  I then have to go back and change the code to new up the object.  Coderush has this behavior even when there is only a default constructor.  For cases when there are multiple constructors, even if I had to pick the constructor (for something like List), doing so would save a lot of typing.

Example:

Code
var items = (List<string>)null; MyMethod(items);
Comments (1)
DevExpress Support Team 8 years ago

    I have reproduced the problem on my side.
    We will try to fix the issue as soon as possible.
    Once we resolve the problem, we will let you know.

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.