The use of a tuple destructuring caused data that was correlated to become uncorrelated to the type checker. By returning an object with a type discriminator, the code paths all get the correctly associated types, which allows the knowledge we had earlier about the state of our data to be transmitted in code instead of in our heads.
The use of a tuple destructuring caused data that was correlated to become uncorrelated to the type checker. By returning an object with a type discriminator, the code paths all get the correctly associated types, which allows the knowledge we had earlier about the state of our data to be transmitted in code instead of in our heads.