This is what people mean when they say "make invalid states unrepresentable", languages with union types can easily avoid this problem.
For example this is something you can do with typescript.
function(args: Arguments) { ... }
type Arguments = { a: number, b: number } | { a: number, b: string, c: number }
the Arguments { a: 1, b: 1, c: 1 } is not representable.Only if there is a niche optimization happens if T is never null, otherwise it's a tagged union.
That's not what you're replying to is about.