Would I tell? Depends on why they say they’re asking.
I remember the leader of a training course I was on asking whether people at our place knew what each other were paid. As a former blue chip HR exec he expressed surprise that we did not. He considered it bad form not to know as it stopped people asking ‘why are they paid more than me?’. And that can apparently affect your desire to learn and improve. He was surprised when we expressed our belief that revealing your pay might be a disciplinary matter.
In England there seem to be a number of factors that affect how readily folks share the value of their pay: occupation, employer, class, origin, location…
Its very easy to guess the rough value of what some one is paid.
It might be in some places. Where I am, our grades have only a minimum value for base pay, with no upper limit. Additional benefits (pension contributions, car allowance, etc) vary according to a number of factors. The factors that affect base salary and benefits are sometimes not obvious.