dotnet / dotnet/csharpstandard

12.6.3.1 Optional parameters and parameter arrays supposedly foil type inference

Open
#100 13 comments 0 reactions 0 assignees View on GitHub
status: gnarly type: bug
Dominant language
C#
Stars
815
Forks
99
Avg merge
1d 14h
Merged PRs (30d)
16

Description

Current text:

> If the supplied number of arguments is different than the number of parameters in the method, then inference immediately fails.

That would suggest that:

``` csharp
Foo(10);
...
static void Foo(T value, params string[] args) { }
```

should fail to compile.

Perhaps we should say that there has to be a corresponding parameter for each argument in the argument list? Basically, it should use 13.6.2 somehow, I'm sure - but it's not clear how.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.