Skip to content

IDE0028 initialization "with" constructor parameters #7817

@dellamonica

Description

@dellamonica

Right now code that calls a collection constructor with size parameters is raising an IDE0028 with the suggestion to use [with(...)]. While I understand that this is the direction the language is taking, perhaps a different code should be used for those that dislike the syntax (such as myself). In other words, I'd like to keep getting flagged on cases such as List<int> x = new() { 1, 2, 3 }, but silence Dictionary<,> d = new(128).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions