Clarification needed? #44404
Labels
dotnet-csharp/svc
fundamentals/subsvc
help wanted
Good for community contributors to help [up-for-grabs]
in-pr
This issue will be closed (fixed) by an active pull request.
Type of issue
Other (describe below)
Description
The section about Optional arguments could in my opinion be improved with a description of how nullable types fit in with respect to whether they are optional or not.
The section specifically says that an argument is considered optional if it has a default value assigned in the parameter list. But one could argue that because of the nullability, a
T? myArgument
definition does implicitly have a default value beingnull
ordefault(T)
.Looking into the C# Language Specification does not enlight the issue either.
Page URL
https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/named-and-optional-arguments#optional-arguments
Content source URL
https://github.com/dotnet/docs/blob/main/docs/csharp/programming-guide/classes-and-structs/named-and-optional-arguments.md
Document Version Independent Id
6be20f15-e5eb-0778-5fbe-38326d8e8f00
Article author
@BillWagner
Metadata
Related Issues
The text was updated successfully, but these errors were encountered: