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
{{ message }}
Repository navigation
[Diagnostics] Better error message for conversion of fun to System.Func #3568
The general rule of thumb when interoping with C# is that methods in C# are tupled in F#... except when you try to create a new System.Func.
Example:
openSystem// Error:// [FS0001] Type mismatch. Expecting a// 'string -> int -> string * int' // but given a// ''a * 'b -> 'a * 'b' //The type 'string' does not match the type ''a * 'b'letfunc:Func<string,int,string*int>=letf(s,i)=(s,i)
Func<string, int, string*int>(f)// Okletfunc:Func<string,int,string*int>=letf s i =(s,i)
Func<string, int, string*int>(f)
In the spirit of the "elmish" error message improvements a few months ago, it would be awesome if the compiler could detect this case and give explicit instructions how to resolve this.
Activity