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.

📉 Falling 0.4x Programming Languages
4,726
Comments
17
Years Active
5
Top Authors
#4136
Topic ID

Activity Over Time

2008
1
2011
2
2012
19
2013
33
2014
43
2015
71
2016
200
2017
246
2018
253
2019
448
2020
485
2021
521
2022
589
2023
756
2024
496
2025
554
2026
9

Keywords

deepkit.io CSS TypeStyle TypeScript cached.set PropTypes typescriptlang.org github.com github.io API typescript type ts type safety fn types undefined const array playground

Sample Comments

azangru Oct 2, 2019 View on HN

My god, you are right!(example in typescript playground: https://www.typescriptlang.org/play/#code/C4TwDgpgBAIglgJwgY...)

dickeytk Feb 22, 2019 View on HN

I love this, but I feel TypeScript would be very unhappy with such a thing.

tom_mellior Feb 6, 2021 View on HN

The article has a whole section called "TypeScript doesn't solve this", with examples and stuff. Is it mistaken?

scrollaway Jan 15, 2020 View on HN

I use what you describe on a regular basis in typescript without issues indeed.

shepherdjerred Oct 20, 2023 View on HN

If you're looking for type safety, isn't TypeScript enough?

jupp0r Jul 8, 2023 View on HN

Typescript purposefully influences this not at all.

latchkey Jun 6, 2018 View on HN

Apologies, my comment was not a complaint. I'm all for type safety and a huge fan of typescript!

boubiyeah Jan 17, 2018 View on HN

It's true it's easier now that typescript has richer types (nullable, mapped, etc)

nine_k Aug 21, 2024 View on HN

Sorry, are we speaking about the same language?https://www.typescriptlang.org/play/?#code/MYewdgzgLgBCA2ATA...

fireattack Aug 7, 2020 View on HN

Not exactly sure what you mean but you can check this: https://github.com/microsoft/TypeScript/issues/2719