| Issue |
53153
|
| Summary |
[clang-format] C# `default!` is formatted inconsistently
|
| Labels |
clang-format
|
| Assignees |
|
| Reporter |
mkurdej
|
Just taking some simplified examples from https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/record:
```
public record Person {
public string GetInit { get; init; } = default!;
};
public record Person {
public string GetSet { get; set; } = default!;
};
```
yields (formatted with `-style=LLVM`).
```
public record Person {
public string GetInit { get; init; } = default!;
};
public record Person {
public string GetSet { get; set; } = default !;
};
```
Note the first `default!` has no space and the second `default !` does.
I guess that `!` is the [null-forgiving operator](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/null-forgiving) but I have a very limited knowledge of C#.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs