Variance does not work with value types, since they need to be JITed differently.
Your lambda expression variant does not involve variance; instead, it compiles to a lambda expression with an implicit boxing conversion from DateTime
to object
.
If you use a method that returns a reference type, it work fine:
Func<string, object> f = string.Intern;