TypeScript Type Safety
Cluster focuses on debates about TypeScript's type system capabilities, limitations, and type safety in handling scenarios like unions, inheritance, and structural typing, often with playground examples and GitHub issues.
Activity Over Time
Top Contributors
Keywords
Sample Comments
My god, you are right!(example in typescript playground: https://www.typescriptlang.org/play/#code/C4TwDgpgBAIglgJwgY...)
I love this, but I feel TypeScript would be very unhappy with such a thing.
The article has a whole section called "TypeScript doesn't solve this", with examples and stuff. Is it mistaken?
I use what you describe on a regular basis in typescript without issues indeed.
If you're looking for type safety, isn't TypeScript enough?
Typescript purposefully influences this not at all.
Apologies, my comment was not a complaint. I'm all for type safety and a huge fan of typescript!
It's true it's easier now that typescript has richer types (nullable, mapped, etc)
Sorry, are we speaking about the same language?https://www.typescriptlang.org/play/?#code/MYewdgzgLgBCA2ATA...
Not exactly sure what you mean but you can check this: https://github.com/microsoft/TypeScript/issues/2719