toErr<S> method

Err<S, E> toErr<S>()

Convert the object to a Result type Err.

Implementation

@pragma("vm:prefer-inline")
Err<S, E> toErr<S>() {
  assert(this is! Result,
      'Don\'t use the "toErr()" method on instances of Result.');
  return Err(this);
}