Hacker news

  • Top
  • New
  • Past
  • Ask
  • Show
  • Jobs

Fixing a WebKit bug to see if promises are made of train tracks (https://alistair.sh)

35 points by dverlaeckt80 6 days ago | 1 comments | View on ycombinator

Groxx 3 days ago |

> we cannot guarantee the correct type of the exception at design time.

A #[non_exhaustive] type (Promise<T,E⁇> maybe) would probably be handy sometimes: https://rust-lang.github.io/rfcs/2008-non-exhaustive.html

Conceptually it's almost the same thing as checked/unchecked exceptions (ignoring Java's bad implementation). Known types are checked, runtime-injected are unchecked and mostly handled implicitly by propagating.