Fixed issue w/custom accessors + reserved name + inheritance

Fixed an issue where custom accessor methods (such as those generated by
`enum`) with the same name as a global method are incorrectly overridden
when subclassing.

This was partially fixed in 4155431 then broken again by e5f15a8.

Fixes #16288.