Skip to content

1.1.16 — Compile-time get(), getErr()

Compare
Choose a tag to compare
@hazae41 hazae41 released this 16 Jan 10:10
· 16 commits to master since this release
  • BREAKING: Modified get not to be callable when used on Err<T> where T isn't never
  • Added getErr for symmetry

Summary

The behaviour of get now becomes fully compile-safe as it no longer returns error types

function f(result: Result<string, Error>) {
   return result.get() // won't compile
}
function f(result: Result<string, never>) {
  return result.get() // will compile
}