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
This case happened to me when I was using FluentAssertions, when I try to call a C# method that receives the first argument with a default value and a second params argument I can't omit both parameters.
If I try to use this method in F# I expected to be able to call it in this way:
letresult1= Class1.Foo()
But this gives me an error :
Error FS0501:
The member or object constructor 'Foo' takes 2 argument(s) but is here given 0.
The required signature is 'Class1.Foo(?something: string, [<System.ParamArray>] args: obj[]) : string'.
So, to make it work I need to pass the first argument explicitly which I would expect to be optional :
letresult1= Class1.Foo("")
Pros and Cons
I don't know if this is bt design, but is very confusing and made the interop harder and noisy in some cases.
For Readers
If you would like to see this issue implemented, please click the 👍 emoji on this issue. These counts are used to generally order the suggestions by engagement.
The text was updated successfully, but these errors were encountered:
This case happened to me when I was using
FluentAssertions
, when I try to call a C# method that receives the first argument with a default value and a second params argument I can't omit both parameters.E.g:
If I try to use this method in F# I expected to be able to call it in this way:
But this gives me an error :
So, to make it work I need to pass the first argument explicitly which I would expect to be optional :
Pros and Cons
I don't know if this is bt design, but is very confusing and made the interop harder and noisy in some cases.
For Readers
If you would like to see this issue implemented, please click the 👍 emoji on this issue. These counts are used to generally order the suggestions by engagement.
The text was updated successfully, but these errors were encountered: