Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect list patttern formatting #45363

Open
MatisseHack opened this issue Dec 6, 2024 · 1 comment
Open

Incorrect list patttern formatting #45363

MatisseHack opened this issue Dec 6, 2024 · 1 comment
Labels
Area-Format untriaged Request triage from a team member

Comments

@MatisseHack
Copy link

Describe the bug

dotnet format removes indentation before list patterns in switch expressions

To Reproduce

Create a new console project with the following code:

Console.WriteLine(args switch
{
    [] => "empty",
    _ => "not empty"
});

Observe the following error:

$ dotnet format --verify-no-changes
/Users/matissehack/Desktop/format/Program.cs(3,1): error WHITESPACE: Fix whitespace formatting. Delete 4 characters. [/Users/matissehack/Desktop/format/format.csproj]

Exceptions (if any)

N/A

Further technical details

$ dotnet --info
.NET SDK:
 Version:           9.0.101
 Commit:            eedb237549
 Workload version:  9.0.100-manifests.4a280210
 MSBuild version:   17.12.12+1cce77968

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  15.1
 OS Platform: Darwin
 RID:         osx-arm64
 Base Path:   /usr/local/share/dotnet/sdk/9.0.101/

.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.

Host:
  Version:      9.0.0
  Architecture: arm64
  Commit:       9d5a6a9aa4

.NET SDKs installed:
  9.0.101 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 9.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 9.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-NetSDK untriaged Request triage from a team member labels Dec 6, 2024
@WeihanLi
Copy link
Contributor

WeihanLi commented Dec 8, 2024

Same issue +1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Format untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

3 participants