Expected<T, E>.error constructor

const Expected<T, E>.error(
  1. E error
)

Creates an Expected containing an error.

Implementation

const Expected.error(E error)
    : _value = null,
      _error = error,
      _hasValue = false;