Implement automatic overloaded deref #7141

**NOTE**: Temporarily rebased on top of #12491.