The difference does not work with value types, since they must be JITed in different ways.
Your variant of lambda expression does not imply deviation; instead, it compiles into a lambda expression with an implicit conversion of the box from DateTimeto object.
If you use a method that returns a reference type, it works fine:
Func<string, object> f = string.Intern;
SLaks source
share