dotnet/roslyn
Auf GitHub ansehenWRN_ParamsArrayInLambdaOnly doesn't have single quotes around its argument.
Open
#66.389 geöffnet am 12. Jan. 2023
Area-CompilersConcept-Diagnostic Clarityhelp wanted
Repository-Metriken
- Stars
- (20.414 Stars)
- PR-Merge-Metriken
- (Durchschn. Merge 6T 17h) (256 gemergte PRs in 30 T)
Beschreibung
<data name="WRN_ParamsArrayInLambdaOnly" xml:space="preserve">
<value>Parameter {0} has params modifier in lambda but not in target delegate type.</value>
</data>
This is inconsistent with other diagnostics that we produce. Also the arguments blends in in the message. For example:
// (67,49): warning CS9100: Parameter 1 has params modifier in lambda but not in target delegate type.
// Action<string[]> q17 = (params string[] s)=>{};
Diagnostic(ErrorCode.WRN_ParamsArrayInLambdaOnly, "s").WithArguments("1").WithLocation(67, 49),
Another aspect to consider is, if we always use parameter number for the argument, then it might make sense to include the word "number" into the message. Number "1" could easily be confused with letter "l", for example, and interpreted as a name instead.