Skip to content

Commit b8ecdd3

Browse files
committed
Add final new errors.
1 parent 14a9259 commit b8ecdd3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/csharp/language-reference/compiler-messages/params-arrays.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ A method that implements an interface must include the `params` modifier if and
128128

129129
You must use the `params` modifier. You can't apply the equivalent attributes, either <xref:System.ParamArrayAttribute?displayProperty=nameWithType> or <xref:System.Runtime.CompilerServices.ParamCollectionAttribute?displayProperty=nameWithType>.
130130

131+
The compiler generates one of the final three errors in the preceding list when the code generated to create the collection type is invalid:
132+
133+
- The compiler emits **CS9223** when the code emitted to create the collection also contains a params collection of the same type. Typically, the `Add` method takes a `params` collection of the same type.
134+
- The compiler emits **CS9224** when the `Create` method for the collection type is less accessible than the method that takes the `params` parameter of the collection type.
135+
- The compiler emits **CS9225** when the collection type has a required member and the parameterless constructor doesn't initialize that member and have the <xref:System.Diagnostics.CodeAnalysis.SetsRequiredMembersAttribute?displayProperty=nameWithType> on the parameterless constructor.
136+
131137
## See also
132138

133139
- [Extension Methods](../../programming-guide/classes-and-structs/extension-methods.md)

0 commit comments

Comments
 (0)