expect method

T expect(
  1. String msg
)
inherited

Unwraps an option, yielding the content of a Some.

Throws an Exception if the value is a None, with the passed message.

Implementation

T expect(String msg) => toNullable() ?? (throw OptionUnwrapException<T>(msg));