Skip to content

AddParameter and target-typed new #42559

@jcouv

Description

@jcouv

Adding an argument to an implicit object creation doesn't trigger AddParameter.

Similarly, GenerateConstructor doesn't trigger on C c = new(1, 2, 3, 4); to offer to add a constructor with 4 parameters.

class C
{
    C(int i) { }
    void M()
    {
       C c = new(1 $$); // typing a second argument here should trigger AddParameter
    }
}

Relates to #28489 (target-typed new feature)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions