Don't be fooled. This is not a developer responsibility. These checks belong in the type system.