soundness

The guarantee that a program which passes type checking can never hold a value of the wrong type at run time.

In more detail

TypeScript is deliberately not fully sound: features such as any, type assertions and unchecked array indexes let wrong values slip through. The design trades some safety for convenience with existing JavaScript. Strict compiler options and avoiding any narrow the gap.

Related terms

Taught in

References