'ParserError: Expected '{' but got reserved keyword 'override' function _mint(address to, uint256 tokenId) internal override(ERC721) {

I keep getting this error, Does anyone know the solution? the code its inheriting,

function _mint(address to, uint256 tokenId) internal virtual {
        // require that the address isnt zero
        require(to != address(0), 'ERC721: minting to the zero address');
        // require that token does not already exist
        require(!_exists(tokenId), 'ERC721 token already minted');
        // adding a new address with a token address for minting
        _tokenOwner[tokenId] = to;
        // keeping track of each address that is minted and adding to it
        _ownedTokenCount[to] += 1;

        emit transfer(address(0), to, tokenId);
    }

the code that's going to inherit

function _mint(address to, uint256 tokenId) internal override(ERC721) {
        super._mint(to, tokenId);
        _addTokensToAllTokenEnumeration(tokenId);
        _addTokensToOwnerEnumeration(to, tokenId);
    }


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source