If a company is going to outsource they were going to do it anyways.
So there has to be some downside for even this law.
But, that's actually the reason companies hate this law: in "perfect competition" no long-term economic profit is possible. Long-term profits are the result of when a market disobeys the definition of "perfect competition," such as when there's information asymmetry, patents and trade secrets to protect innovation, or when barriers to entry are significant.
In this case, hiding salary ranges from employees provides the employer an obvious benefit in that they know how much is budgeted for the position, but a candidate doesn't get that information when giving their salary requirements. I recently had to play a round of "don't give a number" with a recruiter last week. Needless to say, that didn't go very far.
I had this happen to be last week too. I am not sure what ppl say to recruiters when they keep asking this question.
They just clamped down on "I'm not at liberty to say." So, I told them to get back to me when they have a little more liberty.
What I usually say in those initial conversations is something like "I don't have any real requirements beyond the amount that pays my bills. And, at this point, I don't know enough about the job, the team, management, benefits, etc. or the value I could bring, to give an educated number."
That usually satisfies them on the first phone call.
RECRUITER: Tell me what your current salary is.
ME: No. I'm not going to disclose this. Why don't you tell me what the range is for this role.
RECRUITER: It depends on what you're currently making.
ME: How does what I'm currently making change what value I'm offering to the company? I have a range, you have a range, let's just figure out where it overlaps.
RECRUITER: OK then you tell me how much do you want.
ME: $500K (knowing this was a ridiculous number)
RECRUITER: HAHAHAHAROTFL
ME: See how stupid this is? You obviously have a range and that number is outside of it. I'm not going to negotiate against myself.
We didn't get much farther than that.
The only way I know of to break through that kind of BS gamesmanship is to do a lot of research and determine what the market salary distribution is for comparable roles. Sites like comp.fyi and payscale.com have been helpful for me here.
BTW, if you just want to get offer numbers on comp.fyi, use 0 years at company. If you need more data, you can try including 1 or 2 years at company, but, if you start including too much, you're going to lose the original offer numbers in the noise.
But I agree with you that CO has committed a rights violation.