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
If we define out parameter in a lambda, we have to explicitly define the type like:
delegate int D<TResult, TArgument>(TArgument argument, out TResult result);
D<int, int> d = (int arg, out int rst) => {...}; //have to claim int
//D<int, int> d = (arg, out rst) => {...}; //CS2046
Can we get rid of int (the type define) for out and do the similar thing like the case without out?
delegate int D<TResult, TArgument>(TArgument argument, TResult result);
D<int, int> d = (arg, rst) => {...}; // without `out`, you can just omit `int`
The text was updated successfully, but these errors were encountered:
If we define
out
parameter in a lambda, we have to explicitly define the type like:Can we get rid of
int
(the type define) forout
and do the similar thing like the case withoutout
?The text was updated successfully, but these errors were encountered: