Skip to content

Commit 1624b0a

Browse files
committed
Improve documentation clarity
1 parent 23587a2 commit 1624b0a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

documentation/SA1129.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ should always be created using the syntax `default(T)` instead.
4545

4646
To fix a violation of this rule, replace the syntax `new T()` with the equivalent syntax `default(T)`.
4747

48-
For native-sized integers, the code fix will use `IntPtr.Zero`/`UIntPtr.Zero` when the project targets C# 11 with
49-
runtime support for native-sized integers (e.g. .NET 7 or later), and `default(nint)`/`default(nuint)` otherwise.
48+
For native-sized integers constructed with `new nint()`/`new nuint()`, the code fix will only use
49+
`IntPtr.Zero`/`UIntPtr.Zero` in projects where this has the same meaning, specifically, C# 11 with
50+
runtime support for native-sized integers (e.g. .NET 7 or later). Otherwise, the code fix will use
51+
`default(nint)`/`default(nuint)` to ensure identical behavior to the original code.
5052

5153
## How to suppress violations
5254

0 commit comments

Comments
 (0)