1. Create a law that penalizes companies for activities against current employees with attribute X (or who might have attribute X in the future)
2. Watch as companies ride the grey-line getting away with as much as they can whilst (a) staying within the letter of the law and (b) creatively discriminating to avoid hiring anyone who has (or might in the future have) attribute X.
I'm not making a moral judgement, but when you set the system up like this can you really be surprised by the results?