Skip to content

SA1000 doesn't handle 'target-typed' new #3214

@davkean

Description

@davkean

With C# 9.0, SA1000 complains about "target type new expressions":

private readonly object syncObject = new();

Expected:

No message:

Actual:

Severity	Code	Description	Project	File	Line	Suppression State
Error	SA1000	The keyword 'new' should be followed by a space.	Microsoft.VisualStudio.ProjectSystem	C:\CPS\src\Microsoft.VisualStudio.ProjectSystem\Build\Logging\ProjectBuildTargetErrorList.cs	21	Active

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions