This repository was archived by the owner on Oct 12, 2022. It is now read-only.
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
Full Handbook Page on Soundness #1059
Open
Description
From my tweet, where I suggested that it would be beneficial to have a Handbook page on Soundness:
https://twitter.com/karlhorky/status/1146687994142842880
My initial top-of-my-head suggestions in the tweet were to include at least the following information:
- What is soundness / type safety and why is it important?
- Maybe: what is completeness?
- An overview of the general state of soundness in TypeScript (maybe from Type Compatibility)
- What common structures or patterns can be expected to be unsound
Happy to add to the list, if anyone thinks of anything!
Unsound Behaviors
For 2. above, starting a list of unsound behaviors here:
No excess property checks in object types with spread (Playground)
- No excess property error for spread properties TypeScript#26798
- Object spread allows unknown properties as function return values TypeScript#17422
- potential solution: Exact Types
Incorrect definition of spread and Object.assign (Playground)
- Object.assign return assigned type instead merged TypeScript#28553
- Generic spread expressions in object literals TypeScript#28234
- Bug Report + Proposal: Object.assign() TypeScript#31982
Trade-offs in Control Flow Analysis
This has been prompted by the high-quality criticisms as of late on Twitter by @sebmck:
- https://twitter.com/sebmck/status/1146524039227174914
- https://twitter.com/sebmck/status/1142601004241657856
This has been going on since ~ June 18:
Articles / discussion on the topic:
- Surviving the TypeScript Ecosystem — Part 3: Interfaces and Structural Typing
- Are unsound type systems wrong?
- Type-checking unsoundness: standardize treatment of such issues among TypeScript team/community?
- TypeScript Design Goals - Non-Goals: "Non-goal 3: Apply a sound or "provably correct" type system. Instead, strike a balance between correctness and productivity."
Metadata
Metadata
Assignees
Labels
No labels