Skip to content

Commit 31e67e6

Browse files
committed
Update SA1023 documentation for function pointers
1 parent 2579be4 commit 31e67e6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

documentation/SA1023.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ The spacing around the symbol depends upon whether the symbol is used within a t
2929
object* x = null;
3030
```
3131

32+
This applies to function pointer declarations as well. In `delegate* unmanaged[Cdecl]<int*, void>`, the `*` immediately
33+
following `delegate` is treated as part of the type declaration and follows the same spacing rules. When a calling
34+
convention is omitted, the `*` should be written directly before the parameter list, for example `delegate*<int*>` (no
35+
space before the `<`).
36+
3237
When a dereference or access-of symbol is used outside of a type declaration, the opposite rule applies. In this case, the symbol should always be preceded by a single space, unless it is the first character on the line, or is preceded by an opening square bracket, a parenthesis or a symbol of the same type i.e. an equals. The symbol should not be followed by whitespace, and should not be the last character on the line. For example:
3338

3439
```csharp

0 commit comments

Comments
 (0)