Skip to content

ChangeSignature and target-typed new #42558

@jcouv

Description

@jcouv

Removing a parameter from a constructor does not update implicit object creations that use that constructor. This is probably related to FindAllReferences not being aware of new().

The same problem exists with InlineRename

class C
{
    C(int i) { } // use ChangeSignature to remove this parameter, or InlineRename to change the parameter name
    void M()
    {
       C c = new(1); // this implicit object creation doesn't get updated
    }
}

Relates to #28489 (target-typed new feature)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions