-
Notifications
You must be signed in to change notification settings - Fork 263
Support variadic parameters for .NET #153
Copy link
Copy link
Closed
Labels
effort/mediumMedium work item – a couple days of effortMedium work item – a couple days of effortfeature-requestA feature should be added or improved.A feature should be added or improved.good first issueRelated to contributions. See CONTRIBUTING.mdRelated to contributions. See CONTRIBUTING.mdlanguage/dotnetRelated to .NET bindings (C#, F#, ...)Related to .NET bindings (C#, F#, ...)p0
Description
This might be more involved that just adding the "params" keyword. Consider the following signature:
public void DoSomething(params object[] myParam)
{
}
// ...
object[] foo = // ...
// Because an object[] is also an object, the compiler treats foo as the first element
// of the params array, rather than the params array itself.
DoSomething(foo);
But in this case, there's no ambiguity:
public void DoSomething(params string[] myParam)
{
}
// ...
string[] foo = // ...
// The compiler treats foo as the params array, rather than the first element of the params array.
DoSomething(foo);
This might not matter, since generated code does not include any invocations of the generated methods. Just something to keep in mind.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
effort/mediumMedium work item – a couple days of effortMedium work item – a couple days of effortfeature-requestA feature should be added or improved.A feature should be added or improved.good first issueRelated to contributions. See CONTRIBUTING.mdRelated to contributions. See CONTRIBUTING.mdlanguage/dotnetRelated to .NET bindings (C#, F#, ...)Related to .NET bindings (C#, F#, ...)p0