Skip to content
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

@karlhorky

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:

  1. What is soundness / type safety and why is it important?
  2. Maybe: what is completeness?
  3. An overview of the general state of soundness in TypeScript (maybe from Type Compatibility)
  4. 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)

Incorrect definition of spread and Object.assign (Playground)

Trade-offs in Control Flow Analysis


This has been prompted by the high-quality criticisms as of late on Twitter by Sebastian (@sebmck):

This has been going on since ~ June 18:


Articles / discussion on the topic:

Activity

  1. orta commented on Aug 30, 2019

    @orta
    Contributor

    I've included an example on soundness in microsoft/TypeScript-Website#43 which I think is probably enough, it doesn't aim to be comprehensive but it explains what soundness is, why TS isn't sound, provides examples and then links to the two main places where it is documented.

  2. karlhorky commented on Aug 30, 2019

    @karlhorky
    ContributorAuthor

    Ah cool, thanks Orta Therox (@orta)!

    I think I would still suggest documenting and publicizing this more openly than an example - feels like having this in the top-level handbook documentation would help clear up a lot of things for beginners and experienced developers alike.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions