Skip to content

Rename: cascade through delegating constructors #6876

Open
@rchande

Description

@rchande

Rename one of the parameters named "y" in the following code. Callsites referencing the constructor whose parameter was renamed are updated, which is good. However, it would be awesome if we could cascade through all the delegating constructors and rename all the parameters named y that are passed in as the "y" being renamed. Similarly it would be awesome if renaming one of the fields updated the constructor parameter names as well.

class Program
{
    int y;
    int z;
    int z2;

    public Program(int y)
    {
        this.y = y;
    }

    public Program(int y, int z) : this(y: y)
    {
        this.z = z;
    }

    public Program(int y, int z, int z2) : this(y: y, z: z)
    {
        this.z2 = z2;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions