How to overwrite totalSupply() in ERC20?

when i make contract for example
MyContract is ERC20("yada", "yadayada") {

and i want to overwrite the totalSupply() function

how do i do that? Basically want to do

	function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply + SOMETHING;
    }

PROBLEM IS: error appears:
_totalSupply is "Undeclared identifier"

(in ERC20 _totalSupply is private. How can i access it? How do i solve this problem? I know i could add another method, but i want to override totalSupply()

Maybe you can use super | Solidity 0.8.17 documentation

return super.totalSupply() + SOMETHING;

This works. Does this sound alright? Is super.totalSupply calling the method from old contract(that we are overwriting here)?

Check the documentation I mentioned above.

It seems to be working on testnet.

But i am not sure(could i be wrong?) Can't you just validate me

Thanks for the documentation :slight_smile: