Hacker News new | ask | show | jobs
by neongreen 684 days ago
https://counterexamples.org/ is a good collection of unsoundness examples in various languages.

For TypeScript, they list an example with `instanceof`:

https://counterexamples.org/polymorphic-union-refinement.htm...

In the playground:

https://www.typescriptlang.org/play/?#code/GYVwdgxgLglg9mABA...