News for hackers. Stuff that matters.
Re:TypeScript 3.5 by negativegate on Wednesday May 29, 2019 @09:35PM (#20047555)
Interesting, though it does flag the push() as an error if you use "Array<string> | Array<number>" as the argument type.

It almost seems like some sort of co/contravariance issue?

A function that reads from an Array<string | number> should be able to accept either an Array<string> or an Array<number> (or Array<string | number>), but a function that mutates it should only be able to accept Array<string | number>?

There are no comments on this comment yet.