Assume I'm implementing EIP-712 signatures in solidity.
contract Nice { bytes32 private constant BID_TYPE_HASH = keccak256("Bid(uint256 num1,uint256 num2)"); struct Bid { uint256 num1; uint256 num2; } function verify(Bid memory bid) { bytes32 hashed = keccak256(abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR, keccak256(abi.encode( BID_TYPE_HASH, bid.num1, bid.num2 )) )); } } The above works great, but what's the rationale of even using BID_TYPE_HASH ? To ask it in better words, what if EIP suggested to do:
bytes32 hashed = keccak256(abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR, keccak256(abi.encode( bid.num1, bid.num2 )) )); What could go wrong now ? Domain Separator already distinguishes dapps, so isn't that enough ? Can you provide an example where this suggested code breaks and defeats the use-case ?

