That's insane. I would never want to work in a country with laws like that.
Market rate is based on what something worth, not what it costs or what it previously cost so there is no reason for a company to need to know what you previously made.
Having said that, couldn't you just change your terminology and say "package" instead of "salary", then if there is a discrepancy you could say "well, a portion of the package was year end bonus which I obviously didn't get this year..."
I agree with not getting caught in a lie. Personally I don't like the lie approach, even if I can't be caught because it forces me to remember two sides: the truth and what I've told people.
I think the take away here is that you shouldn't be discussing previous salary in any case. If I'm asked I always say "I'm not at liberty to discuss contract conditions at my previous employer" or something to that effect. As I mentioned: as a free market entity, I should be getting what I'm worth now, not some variation of what I was worth 2 years ago when I last tested the market.
Market rate is based on what something worth, not what it costs or what it previously cost so there is no reason for a company to need to know what you previously made.
Having said that, couldn't you just change your terminology and say "package" instead of "salary", then if there is a discrepancy you could say "well, a portion of the package was year end bonus which I obviously didn't get this year..."