Is it possible to specify the data types of tuples in a way that allows for type inference as illustrated in the comments within the code snippet below?
declare const tuples: [number, null] | [null, number];
const [a, b] = tuples;
const fun = () => {
if (a === null) {
const c = b; // Can we define the type of 'tuples' so that 'c' is inferred as 'number'???
return;
}
const d = b; // How can we specify the type of 'tuples' so that 'd' infers as 'null'???
}