Inconsistent function overload resolution between top level call vs call inside generic imp

It is not a bug. The calls to f within wrappedValue are resolved statically at compile-time using the information known about T. There are no constraints on T, so the Any overload is used.

If you want dynamic dispatch at runtime, then constrain T to some protocol and call a requirement of that protocol.