You can't do this, because these two calls just return object instance, which cannot be casted to expression
SafeRun(new SomeClass(arg1, arg2));
SafeRun(new SomeOtherClass());
And passing void is not allowed in C# at all
SafeRun(someObject.FooReturningVoid());
Take a look on applicable function member verification, you'll see that
A function member is said to be an applicable function member with respect to an argument list A when all of the following are true:
The number of arguments in A is identical to the number of parameters in the function member declaration.
For each argument in A, the parameter passing mode of the argument (that is, value, ref, or out) is identical to the parameter passing mode of the corresponding parameter, and for a value parameter or a parameter array, an implicit conversion (Section 6.1) exists from the type of the argument to the type of the corresponding parameter
In your case there is no implicit conversion exists from the type of argument (SomeClass
, SomeOtherClass
) to parameter's Expression<Action>
type. Your code will work only if you will define implicit conversions between expression type and types you are passing to method.