Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _rules/1553.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The only valid reason for using C# 4.0's optional parameters is to replace the e
return someText.IndexOf(phrase, startIndex, length);
}

Since strings, lists and collections should never be `null` according to rule [{{ site.default_rule_prefix }}1135](/member-design-guidelines#{{ site.default_rule_prefix }}1135), if you have an optional parameter of these types with default value `null` then you must use overloaded methods instead.
Since strings, collections and tasks should never be `null` according to rule [{{ site.default_rule_prefix }}1135](/member-design-guidelines#{{ site.default_rule_prefix }}1135), if you have an optional parameter of these types with default value `null` then you must use overloaded methods instead.

Strings, unlike other reference types, can have non-null default values. So an optional string parameter may be used to replace overloads with the condition of having a non-null default value.

Expand Down