matchError<E extends Object> method
Returns an Option containing the error if its type matches E
.
Implementation
@pragma('vm:prefer-inline')
Option<E> matchError<E extends Object>() =>
value is E ? Some(value as E) : const None();