Well, it seems reasonable to me that both are valid candidates. In other words, I believe that for the conversion of () => { throw new Exception(); }both Func<int>, it Actionmakes sense to convert () => { throw new Exception(); }. In both cases, the end of the method is unavailable - it would be fair to put it in a normal named method as follows:
public int GoBang()
{
throw new Exception();
}
and then write:
Func<int> foo = GoBang;
, - Func<int> Action . , . 7.5.3.2 ( ), :
E x P x , E x Q < > >
7.5.3.3 ( ) :
C 1 , C 2, :
- [...]
E - , T 1 - D 1 . Expression < D 1 > , T 2 D 2, Expression < D 2 > , :
- [...]
- D 1 D 2 , :
- D 1 Y, D 2 void.
, Func<int> Action... .