You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/csharp/language-reference/compiler-messages/params-arrays.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,6 +128,12 @@ A method that implements an interface must include the `params` modifier if and
128
128
129
129
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>.
130
130
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.
0 commit comments