3 ms·
Here's one that TypeScript gets wrong. It's kind of a canonical example of a program that is difficult to get right in a type system. (It's how I found the Fl
by evmar 10y ago
Here's one that TypeScript gets wrong. It's kind of a canonical example of a program that is difficult to get right in a type system. (It's how I found the Flow example linked upthread.)
let x: number[] = [];
let y: Object[] = x;
y.push('a');
let bad = x.pop();
// bad has type number but is actually a string.