https://github.com/tyilo/ts-unsoundness
https://github.com/tyilo/ts-unsoundness
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tyilo/ts-unsoundness
- Owner: tyilo
- Created: 2025-02-25T16:00:43.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-27T11:38:50.000Z (over 1 year ago)
- Last Synced: 2025-10-19T16:59:55.828Z (8 months ago)
- Language: TypeScript
- Size: 10.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ts-unsoundness
Examples of why TypeScript's type system is not sound.
All of the examples manages to produce a value at runtime which TypeScript thinks has the type [`never`](https://www.typescriptlang.org/docs/handbook/2/functions.html#never). This shouldn't be possible.
They then call the function `contradiction` from [src/util/index.ts](src/util/index.ts) which is defined something like:
```typescript
function contradiction(v: never) {
console.log(`Got a value with type never!`);
}
```