Fixed #17673 -- forbidding field shadowing

This is updated version of a patch written 7 months ago; it applies
clearly.